1 2007-09-02 Paolo Carlini <pcarlini@suse.de>
4 * typeck.c (build_unary_op): Fix error message for
5 Boolean expression as operand to operator--.
7 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
10 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
13 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
16 * init.c (build_default_init): Make extern.
17 * cp-tree.h (build_default_init): Declare here.
18 * pt.c (tsubst_expr): When the instantiation of the initializer of
19 a variable results in an empty list, default-initialize the
21 (tsubst_copy_and_build): When the instantiation of the initializer
22 in a new expression results in an empty initializer list,
23 default-initialize it.
25 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
27 * mangle.c (write_type): Change mangling of rvalue reference from
30 2007-08-31 Jakub Jelinek <jakub@redhat.com>
32 * decl.c (duplicate_decls): Remove duplicated line.
34 2007-08-31 Paolo Carlini <pcarlini@suse.de>
37 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
38 BOUND_TEMPLATE_TEMPLATE_PARM.
40 2007-08-31 Paolo Carlini <pcarlini@suse.de>
43 * search.c (lookup_member): Check the name argument for
46 2007-08-31 Paolo Carlini <pcarlini@suse.de>
49 * parser.c (cp_parser_trait_expr): Check rerurn value of
52 2007-08-30 Ollie Wild <aaw@google.com>
54 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
55 convert_ptrmem for pointer to member conversions.
56 (convert_to_pointer_force): Update cp_convert_to_pointer call.
57 (ocp_convert): Update cp_convert_to_pointer call.
58 * typeck.c (convert_ptrmem): Add conditional for null pointers to
60 (build_static_cast_1): Check can_convert for conversions in either
62 (get_delta_difference_1): New function.
63 (get_delta_difference): Refactor to call get_delta_difference_1.
66 2007-08-28 Paolo Carlini <pcarlini@suse.de>
69 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
70 BOUND_TEMPLATE_TEMPLATE_PARM.
72 2007-08-28 Jakub Jelinek <jakub@redhat.com>
76 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
77 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
79 2007-08-27 Jason Merrill <jason@redhat.com>
82 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
83 Look inside STMT_EXPR.
84 * semantics.c (stmt_expr_value_expr): New fn.
85 * cp-tree.h: Declare it.
88 * decl.c (groktypename): Ignore attributes applied to class type.
90 2007-08-28 Richard Guenther <rguenther@suse.de>
92 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
94 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
96 * error.c (dump_expr): Handle COMPLEX_CST.
97 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
98 (pp_cxx_expression): Likewise.
100 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
102 * decl.c (GNU_INLINE_P): New.
103 (duplicate_decls): Handle gnu_inline. Merge attributes and
104 some flags in overriding definitions.
105 (redeclaration_error_message): Handle gnu_inline.
106 (start_preparsed_function): Likewise.
108 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
110 * call.c (sufficient_parms_p): Constify.
111 * class.c (same_signature_p): Likewise.
112 * cp-gimplify.c (is_invisiref_parm,
113 cxx_omp_privatize_by_reference): Likewise.
114 * cp-objcp-common.c (has_c_linkage): Likewise.
115 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
116 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
117 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
118 num_artificial_parms_for, comp_template_parms,
119 template_parameter_pack_p, any_dependent_template_arguments_p,
120 any_type_dependent_arguments_p, any_value_dependent_elements_p,
121 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
122 zero_init_p, member_p, cp_lvalue_kind,
123 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
124 varargs_function_p, is_dummy_object, special_function_kind,
125 string_conv_p, type_unknown_p, comp_except_specs, compparms,
126 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
127 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
128 cp_has_mutable_p, at_least_as_qualified_p,
129 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
130 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
131 * except.c (nothrow_libfn_p): Likewise.
132 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
134 * pt.c (comp_template_parms, template_parameter_pack_p,
135 any_type_dependent_arguments_p, any_value_dependent_elements_p,
136 any_dependent_template_arguments_p): Likewise.
137 * repo.c (repo_export_class_p): Likewise.
138 * semantics.c (anon_aggr_type_p): Likewise.
139 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
140 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
141 varargs_function_p, member_p, is_dummy_object, pod_type_p,
142 zero_init_p, special_function_p): Likewise.
143 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
144 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
145 compparms, invalid_nonstatic_memfn_p,
146 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
147 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
148 cp_has_mutable_p, lvalue_or_else): Likewise.
150 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
152 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
153 * cp-objcp-common.c (cp_tree_size): Ditto.
154 * tree.c (cp_walk_subtrees): Ditto
155 * cp-tree.def (TINST_LEVEL): Go away.
156 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
157 move together with other non-tree structs.
158 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
159 (union lang_tree_node): Eliminate tinst_level field.
160 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
161 (current_instantiation, outermost_tinst_level): Return
162 a "struct tinst_level *".
164 * error.c (print_instantiation_partial_context): Change second
165 parameter to a "struct tinst_level *". Replace accessor macros
167 (print_instantiation_full_context): Likewise.
168 * lex.c (in_main_input_context): Likewise.
170 * pt.c (struct pending_templates): New.
171 (pending_templates, last_pending_template): Use it as a type.
172 (current_tinst_level): Change typo to "struct tinst_level *"
173 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
174 (add_pending_template): Construct a "struct pending_template".
175 Replace TINST_LEVEL accessor macros with field access.
176 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
177 (pop_tinst_level): Likewise.
178 (instantiate_pending_templates): Likewise. Factor common code used
179 when an instantiation has been done.
180 (outermost_tinst_level): Replace tree_last with loop.
181 (current_instantiation): Return a "struct tinst_level *".
183 2007-08-24 Ollie Wild <aaw@google.com>
185 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
186 * name-lookup.h (cp_binding_level): Remove vtables member.
188 2007-08-24 Richard Guenther <rguenther@suse.de>
190 * tree.c (cp_cannot_inline_tree_fn): Remove.
191 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
192 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
195 2007-08-24 Jakub Jelinek <jakub@redhat.com>
198 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
199 error_mark_node right away if build_expr_type_conversion
203 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
204 is error_mark_node rather than NULL_TREE.
205 * pt.c (check_explicit_specialization): Likewise.
208 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
209 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
211 2007-08-22 Jason Merrill <jason@redhat.com>
214 * pt.c (outermost_tinst_level): New function.
215 * lex.c (in_main_input_context): New function.
216 * cp-tree.h: Declare it.
217 * decl2.c (constrain_class_visibility): Use it to avoid warning
218 about uses of the anonymous namespace in the main input file.
220 2007-08-21 Jakub Jelinek <jakub@redhat.com>
222 * init.c (build_new_1): Use get_target_expr instead of save_expr.
224 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
227 * class.c (finish_struct_1): Warn when a class has virtual
228 functions and accessible non-virtual destructor.
230 2007-08-20 Richard Guenther <rguenther@suse.de>
234 * call.c (build_new_method_call): Convert initializer to
236 * init.c (build_aggr_init): Do not fiddle with types.
237 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
238 * except.c (build_throw): Do not drop qualifiers for the
240 * typeck.c (get_member_function_from_ptrfunc): Do not
241 fiddle with types, instead convert.
242 (build_ptrmemfunc1): Convert to the target type for
244 (gfc_trans_allocate): Convert result to target type.
245 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
246 pointer-to-member structures shall have alias set zero as well.
248 2007-08-20 Richard Guenther <rguenther@suse.de>
250 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
252 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
253 (nonstatic_local_decl_p): Likewise.
254 * tree.c (cp_auto_var_in_fn_p): Remove.
255 * decl.c (nonstatic_local_decl_p): Remove.
257 2007-08-20 Richard Guenther <rguenther@suse.de>
259 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
261 * tree.h (cp_walk_tree): New define to walk_tree_1 with
262 cp_walk_subtrees lh parameter.
263 (cp_walk_tree_without_duplicates): New define to
264 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
265 * tree.c (count_trees): Call
266 cp_walk_tree_without_duplicates.
267 (verify_stmt_tree): Call cp_walk_tree.
268 (break_out_target_exprs): Likewise.
269 (WALK_SUBTREE): Likewise.
270 * cp-gimplify.c (cp_genericize): Likewise.
271 * cp-pt.c (find_parameter_packs_r): Likewise.
272 (uses_parameter_packs): Likewise.
273 (make_pack_expansion): Likewise.
274 (check_for_bare_parameter_packs): Likewise.
275 (for_each_template_parm): Likewise.
276 * decl.c (check_default_argument): Call
277 cp_walk_tree_without_duplicates.
278 * except.c (build_throw): Likewise.
279 * decl2.c (type_visibility): Likewise.
280 * semantics.c (expand_or_defer_fn): Likewise.
281 (finalize_nrv): Call cp_walk_tree.
283 2007-08-20 Jakub Jelinek <jakub@redhat.com>
286 * init.c (build_new_1): Rename placement_var variable to placement_expr.
287 Initialize it with save_expr rather than get_temp_regvar.
289 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
292 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
295 2007-08-17 Ollie Wild <aaw@google.com>
298 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
299 declarations into appropriate slots for comparison. Fix type
302 2007-08-17 Paolo Carlini <pcarlini@suse.de>
305 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
306 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
308 2007-08-17 Paolo Carlini <pcarlini@suse.de>
311 * parser.c (cp_parser_class_head): Improve error message.
313 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
315 * pt.c (instantiate_decl): Set input_location
316 for the function end.
318 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
320 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
322 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
323 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
324 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
325 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
326 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
327 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
328 * typeck.c (cp_type_quals): Likewise.
329 * typeck2.c (cxx_incomplete_type_diagnostic,
330 cxx_incomplete_type_error): Likewise.
332 2007-08-16 Paolo Carlini <pcarlini@suse.de>
335 * pt.c (tsubst_friend_function): When check_classfn
336 returns error_mark_node likewise return it.
338 2007-08-15 Jakub Jelinek <jakub@redhat.com>
341 * typeck.c (check_return_expr): Don't NRV optimize vars in
343 * decl.c (finish_function): Comment fix.
345 2007-08-15 Paolo Carlini <pcarlini@suse.de>
348 * pt.c (push_template_decl_real): Depending on TYPE_P
349 use either TYPE_CONTEXT or DECL_CONTEXT.
351 2007-08-14 Mark Mitchell <mark@codesourcery.com>
353 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
354 constructors and destructors return this.
356 2007-08-14 Paolo Carlini <pcarlini@suse.de>
359 * decl2.c (check_classfn): Return error_mark_node in case of error;
360 in that case, do not call add_method.
361 * decl.c (start_decl): Deal with check_classfn returning
363 (grokfndecl): Likewise.
364 * pt.c (tsubst_friend_function): Likewise.
366 2007-08-14 Andrew Pinski <pinskia@gmail.com>
369 * typeck.c (build_binary_op): Disallow vector float types with
370 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
372 2007-08-11 Ian Lance Taylor <iant@google.com>
374 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
376 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
378 2007-08-10 Ollie Wild <aaw@google.com>
380 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
382 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
384 (unqualified_namespace_lookup): Fix ambiguous_decl call.
385 (lookup_using_namespace): Fix ambiguous_decl call.
386 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
388 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
390 * call.c (name_as_c_string): Use CONST_CAST.
391 * decl.c (build_decl): Likewise.
392 * parser.c (cp_parser_string_literal): Likewise.
394 2007-08-10 Paolo Carlini <pcarlini@suse.de>
397 * error.c (dump_expr): Consistently use the *_cxx_*
398 variants of the pretty-print functions.
400 2007-08-10 Paolo Carlini <pcarlini@suse.de>
403 * decl.c (check_special_function_return_type): Just error
404 on return type specified for conversion operator.
406 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
408 * typeck2.c (readonly_error): Handle general expressions.
409 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
411 2007-08-06 Dan Hipschman <dsh@google.com>
413 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
414 access function name.
416 2007-08-04 Alfred Minarik <a.minarik@aon.at>
419 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
420 * g++spec.c (lang_specific_driver): Check them.
422 2007-08-06 Paolo Carlini <pcarlini@suse.de>
425 * pt.c (template_class_depth): Fix comment; change return type
428 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
431 2007-03-26 Dirk Mueller <dmueller@suse.de>
433 * parser.c (cp_parser_member_declaration): Pedwarn
434 about stray semicolons after member declarations.
436 2007-08-02 Lee Millward <lee.millward@gmail.com>
441 * parser.c (cp_parser_asm_definition): Detect and discard asm
442 statements with invalid inputs or outputs.
443 (cp_parser_asm_operand_list): Return error mark node if any
444 of the operands are invalid. Adjust documentation.
446 2007-08-02 Nick Clifton <nickc@redhat.com>
448 * typeck.c: Change copyright header to refer to version 3 of the
449 GNU General Public License and to point readers at the COPYING3
450 file and the FSF's license web page.
451 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
452 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
453 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
454 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
455 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
456 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
457 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
458 name-lookup.h, parser.c: Likewise.
460 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
463 * call.c (magic_varargs_p): Honor the "type generic" attribute.
465 2007-07-30 Paolo Carlini <pcarlini@suse.de>
468 * semantics.c (finish_label_stmt): Reject the __label__
469 extension outside function scopes.
471 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
473 * parser.c (eof_token): Un-constify.
474 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
475 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
478 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
480 * pt.c, tree.c, typeck2.c: Fix comment typos.
482 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
483 Mark Mitchell <mark@codesourcery.com>
486 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
487 hidden due to friend declarations in local classes.
489 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
491 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
492 * cp-tree.def (DECLTYPE_TYPE): New.
493 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
494 (dump_type_prefix): Ditto.
495 (dump_type_suffix): Ditto.
496 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
497 * mangle.c (write_type): Handle DECLTYPE_TYPE.
498 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
500 (DECLTYPE_TYPE_EXPR): New.
501 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
502 (finish_declared_type): Declare.
503 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
505 (pp_cxx_type_id): Ditto.
506 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
507 (tsubst): Substitute into a DECLTYPE_TYPE node.
508 (tsubst_copy): Ditto.
509 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
511 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
512 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
513 structural equality (because we can't hash the expressions).
514 (finish_declared_type): New.
515 * lex.c (reswords): Add "decltype" keyword.
516 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
517 (cp_parser_postfix_expression): Add member_access_only_p to
518 restrict postfix expression to member access expressions.
519 (cp_parser_unary_expression): Update call to
520 cp_parser_postfix_expression to reflect new parameter.
521 (cp_parser_declared_type): New.
522 (cp_parser_simple_type_specifier): Parse decltype types.
524 2007-07-27 Mark Mitchell <mark@codesourcery.com>
527 * call.c (convert_for_arg_passing): Only widen bitfields to their
528 declared types if necessary.
530 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
532 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
535 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
537 * decl.c (typename_hash, typename_compare): Constify.
538 * mangle.c (hash_type, compare_type): Likewise.
539 * pt.c (eq_local_specializations, hash_local_specialization):
541 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
542 list_hash): Likewise.
543 * typeck2.c (pat_compare): Likewise.
545 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
547 * method.c (implicitly_declare_fn): Increase alignment if member
548 function pointer format requires it.
550 2007-07-24 Paolo Carlini <pcarlini@suse.de>
553 * typeck.c (check_return_expr): Do not pass a null argument
556 2007-07-24 Paolo Carlini <pcarlini@suse.de>
559 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
562 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
565 * typeck.c (convert_arguments): Only use default args if we have
569 * typeck.c (structural_comptypes): No need to check
570 resolve_typename_type return value here.
571 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
572 * pt.c (resolve_typename_type): Follow typename typedefs. Return
573 original type rather than error_mark_node in case of failure.
574 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
575 resolve_typename_type result check.
576 (cp_parser_direct_declarator, cp_parser_head,
577 cp_parser_constructor_declarator_p): Likewise.
579 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
581 * pt.c (template_parms_variadic_p): Remove.
582 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
584 2007-07-12 Jakub Jelinek <jakub@redhat.com>
587 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
588 argument to dump_aggr_init_expr_args instead of false.
590 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
592 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
593 canonical types; otherwise, fall back to structural type
594 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
595 internal compiler error if the canonical types are wrong.
597 2007-07-11 Paolo Carlini <pcarlini@suse.de>
600 * parser.c (cp_parser_make_indirect_declarator): When the
601 the code argument is ERROR_MARK return cp_error_declarator.
603 2007-07-09 Geoffrey Keating <geoffk@apple.com>
606 * decl.c (cxx_init_decl_processing): Don't set
607 force_align_functions_log.
608 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
609 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
610 FUNCTION_DECL, return its alignment.
612 2007-07-09 Richard Guenther <rguenther@suse.de>
614 * decl.c (start_preparsed_function): Do not promote return type.
616 2007-07-08 Paolo Carlini <pcarlini@suse.de>
619 * pt.c (unify): Never pass error_mark_node to template_decl_level.
621 2007-07-07 Mark Mitchell <mark@codesourcery.com>
624 * pt.c (resolve_overloaded_unification): Robustify. Return a
626 (type_unification_real): Adjust accordingly.
628 2007-07-06 Richard Guenther <rguenther@suse.de>
630 * init.c (build_new_1): Use the correct pointer type.
631 * typeck2.c (build_m_component_ref): Likewise.
633 2007-07-05 Mark Mitchell <mark@codesourcery.com>
636 * init.c (build_zero_init): Always build an initializer for
638 * typeck2.c (build_functional_cast): Use build_zero_init.
641 * init.c (build_new_1): Always pass the allocation function to
642 build_op_delete_call.
643 * call.c (build_op_delete_call): Handle operator delete with a
644 variable-argument list. Do not issue an error when no matching
645 deallocation function is available for a new operator.
648 * cp-tree.h (any_value_dependent_elements_p): Declare it.
649 * decl.c (value_dependent_init_p): New function.
650 (cp_finish_decl): Use it.
651 * pt.c (value_dependent_expression_p): Use
652 any_value_dependent_elements_p.
653 * parser.c (cp_parser_primary_expression): Add comment about
654 treating dependent qualified names as integral
655 constant-expressions.
657 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
659 * decl.c (build_ptrmemfunc_type): Always use structural equality
660 tests when comparing pointer-to-member-function types, because the
661 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
664 2007-07-03 Mark Mitchell <mark@codesourcery.com>
666 * init.c (build_new): Tweak comment.
668 2007-06-29 Dave Brolley <brolley@redhat.com>
671 * parser.c (cp_parser_new_type_id): Don't reduce a named array
672 type to its base type and number of elements here.
673 * init.c (build_new): Call complete_type_or_else to ensure that the
674 type is complete and to issue a diagnostic if it is not.
675 (build_new_1): Don't call complete_type_or_else here.
677 2007-07-03 Richard Guenther <rguenther@suse.de>
680 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
683 2007-07-02 Simon Baldwin <simonb@google.com>
685 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
686 for inner-style nested forward declarations that don't declare
689 2007-07-02 Jakub Jelinek <jakub@redhat.com>
692 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
693 DECL_P in not a variable and appears more than once error messages.
695 2007-07-01 Ollie Wild <aaw@google.com>
697 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
698 (select_decl): Remove function.
699 (unqualified_namespace_lookup): Populate binding by calling
700 ambiguous_decl. Remove select_decl call.
701 (lookup_qualified_name): Remove select_decl call.
702 * decl.c (lookup_and_check_tag): Check for ambiguous references.
703 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
704 generation when name lookup is ambiguous.
706 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
709 * init.c (build_new_1): Use structural equality on the copy of the
712 2007-06-28 Geoffrey Keating <geoffk@apple.com>
714 * decl2.c (determine_visibility): Implement
715 flag_visibility_ms_compat effect on type info.
716 * decl.c (cxx_init_decl_processing): Implement
717 global effect of flag_visibility_ms_compat.
719 2007-06-28 Geoffrey Keating <geoffk@apple.com>
721 * decl2.c (start_objects): Mark constructor-running function
724 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
727 * decl.c (grokdeclarator): Reset friendp for member functions declared
728 friend of their own class.
730 2007-06-23 Mark Mitchell <mark@codesourcery.com>
732 * decl2.c (determine_visibility): Don't look for dllexport here.
733 (determine_visibility_from_class): Tidy.
735 2007-06-18 Simon Baldwin <simonb@google.com>
738 * parser.c (cp_parser_single_declaration): Added check for storage
739 class other than sc_none in parsed declaration, and a flag to indicate
740 if the call is part of an explicit template specialization parse.
741 * (cp_parser_explicit_specialization): Specialization check flag added
742 to call to cp_parser_single_declaration(), set true.
743 * (cp_parser_template_declaration_after_export): Specialization check
744 flag added to call to cp_parser_single_declaration(), set false.
745 * pt.c (check_explicit_specialization): Added code to copy visiblity
746 and linkage from the templated function to the explicit specialization.
748 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
750 * typeck.c (build_binary_op): For templates build the
751 expression in pieces to avoid the assert in build2_stat.
752 (get_member_function_from_ptrfunc):
753 Change over to using POINTER_PLUS_EXPR and convert
754 the second operand to sizetype.
755 * typeck2.c (build_m_component_ref): Likewise.
756 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
757 instead of PLUS_EXPR for pointers.
758 (build_new_1): Likewise.
759 (build_vec_delete_1): Likewise.
760 (build_vec_delete): Likewise.
761 * class.c (build_base_path): Likewise.
762 (build_base_path): Likewise.
763 (convert_to_base_statically): Likewise.
764 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
765 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
766 instead of PLUS_EXPR.
767 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
768 instead of PLUS_EXPR for pointers.
769 * call.c (build_special_member_call): Likewise.
770 * rtti.c (build_headof): Likewise.
771 Use sizetype instead of ptrdiff_type_node.
772 (tinfo_base_init): Create a POINTER_PLUS_EXPR
773 instead of PLUS_EXPR for pointers.
774 * except.c (expand_start_catch_block): Do a
775 NEGATIVE and then a POINTER_PLUS_EXPR instead
777 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
778 PLUS_EXPR on pointer types over to use
779 POINTER_PLUS_EXPR and remove the conversion
780 to the pointer types.
781 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
782 adding to a pointer type. Use size_int instead of
783 ssize_int. Convert the index to sizetype before
784 adding it to the pointer.
786 2007-06-15 Mark Mitchell <mark@codesourcery.com>
788 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
789 (DECL_ANON_UNION_VAR_P): New macro.
790 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
791 than DECL_VAR_MARKED_P, to keep track of which variables we have
793 * decl.c (redeclaration_error_message): Complain about redeclaring
794 anonymous union members at namespace scope.
795 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
797 2007-06-14 Geoff Keating <geoffk@apple.com>
799 * decl2.c (determine_visibility): Ensure that functions with
800 hidden types as parameters are hidden.
803 * decl2.c (determine_visibility): Remove duplicate code for
806 2007-06-12 Ian Lance Taylor <iant@google.com>
809 * init.c (avoid_placement_new_aliasing): New static function.
810 (build_new_1): Call it.
812 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
814 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
815 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
817 2007-06-08 Jakub Jelinek <jakub@redhat.com>
820 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
821 on init, the non-decl cond operand and increment value.
823 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
826 * decl.c (check_initializer): Report an error when a brace enclosed
827 initializer is used for a non-aggregate type in C++98.
828 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
830 (grokdeclarator): Likewise.
831 (move_fn_p): Likewise.
832 * typeck.c (check_return_expr): Likewise.
833 * call.c (reference_binding): Likewise.
834 * error.c (cp_cpp_error): Likewise.
835 * pt.c (check_default_tmpl_args): Likewise.
837 * lex.c (init_reswords): Likewise.
838 * parser.c (p_parser_primary_expression): Likewise.
839 (TOKEN_PRECEDENCE): Likewise.
840 (cp_parser_init_declarator): Likewise.
841 (cp_parser_ptr_operator): Likewise.
842 (cp_parser_parameter_declaration): Likewise.
843 (cp_parser_enclosed_template_argument_list): Likewise.
844 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
845 (cp_parser_next_token_ends_template_argument_p): Likewise.
847 2007-06-04 Simon Baldwin <simonb@google.com>
849 * decl.c (grokdeclarator): Readability change. Moved case labels
850 into direct switch statement scope.
852 2007-06-04 Paolo Carlini <pcarlini@suse.de>
854 * call.c (convert_like_real): Remove pointless code.
856 2007-05-31 Mark Mitchell <mark@codesourcery.com>
858 * decl.c (get_atexit_fn_ptr_type): New function.
859 (get_atexit_node): Use it.
860 (start_cleanup_fn): Likewise.
861 (register_dtor_fn): Use the object's destructor, instead of a
862 separate cleanup function, where possible.
863 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
864 (atexit_fn_ptr_type_node): New macro.
865 * decl2.c (build_cleanup): Use build_address.
867 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
869 * typeck.c (build_binary_op): Include types in error.
871 2007-05-31 Jakub Jelinek <jakub@redhat.com>
874 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
875 needs runtime initialization.
877 2007-05-31 Paolo Carlini <pcarlini@suse.de>
880 * semantics.c (finish_trait_expr): Complete the types.
882 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
883 Douglas Gregor <doug.gregor@gmail.com>
884 Pedro Lamarao <pedro.lamarao@mndfck.org>
885 Howard Hinnant <howard.hinnant@gmail.com>
889 * typeck.c (comptypes): Don't consider rvalue and lvalue
890 reference types to be equivalent.
891 (check_return_expr): Move from certain lvalues when returning
893 * decl.c (grokdeclarator): Implement reference collapsing.
894 (copy_fn_p): Don't consider constructors taking rvalue references
895 to be copy constructors.
897 * call.c (conversion): New "rvaluedness_matches_p" member.
898 (convert_class_to_reference): Require reference type as first
899 parameter instead of base type.
900 (reference_binding): Add logic to handle rvalue references.
901 (implicit_conversion): Update inaccurate comment.
902 (convert_like_real): Disable creation of temporaries that are
903 impossible to initialize for types with move constructors.
904 (build_over_call): Elide move constructors when possible.
905 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
906 (maybe_handle_ref_bind): Return conversion instead of type node.
907 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
908 determine preferred conversion sequences.
909 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
910 (LOOKUP_PREFER_RVALUE): New.
911 (DECL_MOVE_CONSTRUCTOR_P): New.
912 (struct cp_declarator): Add "reference" member for reference
913 types, with new "rvalue_ref" flag.
914 (cp_build_reference_type): Declare.
915 (move_fn_p): Declare.
916 * error.c (dump_type_prefix): Format rvalue reference types
917 correctly in error messages.
918 * except.c (build_throw): Move from certain lvalues when
920 * mangle.c (write_type): Mangle rvalue references differently
921 than regular references.
922 * parser.c (make_reference_declarator): Add boolean parameter for
924 (cp_parser_make_indirect_declarator): New.
925 (cp_parser_new_declarator_opt): Call
926 cp_parser_make_indirect_declarator.
927 (cp_parser_conversion_declarator_opt): Ditto.
928 (cp_parser_declarator): Ditto.
929 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
931 * pt.c (tsubst): Implement reference collapsing.
932 (maybe_adjust_types_for_deduction): Implement special template
933 parameter deduction rule for rvalue references.
934 (type_unification_real): Update calls to
935 maybe_adjust_types_for_deduction.
936 (try_one_overload): Ditto.
937 (unify_pack_expansion): Ditto.
938 * tree.c (lvalue_p_1): Handle rvalue reference types.
939 (cp_build_reference_type): New.
941 2007-05-30 Jakub Jelinek <jakub@redhat.com>
944 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
945 variables that need runtime initialization.
947 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
950 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
951 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
952 case POSTDECREMENT_EXPR>): Return the error_mark_node
953 if either the real or imaginary parts would an
956 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
957 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
960 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
961 token is a closing brace, false if there are no tokens left.
962 (cp_parser_namespace_alias_definition): Only consume the next token if
963 it is a closing brace.
965 * parser.c (cp_parser_class_specifier): Likewise.
967 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
969 * semantics.c (finish_member_declaration): Fix a typo in the
972 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
984 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
985 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
986 * pt.c (check_for_bare_parameter_packs): Return bool indicated
987 whether everything was okay. Fix indentation.
988 (push_template_decl_real): Check for bare parameter packs in
989 function parameters; where errors occur, mark the parameter types
990 with ERROR_MARK_NODEs to avert ICEs.
991 (coerce_template_parameter_pack): New.
992 (coerce_template_parms): Moved parameter pack coercion into
993 coerce_template_parameter_pack, and permit it anywhere in the
994 template parameter list (not just at the end). Parameter and
995 argument indices can vary (somewhat) separately now, so add
996 PARM_IDX and ARG_IDX.
997 (fn_type_unification): Don't set an argument pack as incomplete if
998 no argument pack was deduced.
999 (type_unification_real): If a type parameter is a parameter pack
1000 and has not otherwise been deduced, it will be deduced to an empty
1002 (more_specialized_fn): Use the actual lengths of the argument
1003 lists when comparing against expansions.
1004 * semantics.c (finish_member_declaration): If a field's type has
1005 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1007 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1010 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1012 2007-05-22 Ollie Wild <aaw@google.com>
1014 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1015 (unqualified_namespace_lookup): Adds check for hidden types.
1017 2007-05-22 Ollie Wild <aaw@google.com>
1019 * decl.c (duplicate_decls): Verify namespace names are unique.
1021 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1023 * decl.c (cxx_maybe_build_cleanup): Handle
1024 __attribute__((cleanup)).
1026 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1028 * cvt.c (cp_convert_and_check): Don't check warnings if the
1031 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1033 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1035 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1038 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1039 type only if is a class type (5.2.8/4).
1041 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1043 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1044 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1045 c_common_unsigned_type.
1047 2007-05-11 Silvius Rus <rus@google.com>
1049 * cp/typeck.c (build_indirect_ref): Add call to
1050 strict_aliasing_warning.
1051 (build_reinterpret_cast_1): Condition call to
1052 strict_aliasing_warning.
1054 2007-05-11 Jan Hubicka <jh@suse.cz>
1056 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1057 * decl2.c (start_objects): ctors and dtors are no longer public.
1058 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1060 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1062 * typeck.c (build_unary_op): Remove code that used to
1063 handle non lvalue increments/decrements.
1065 2007-05-07 Mike Stump <mrs@apple.com>
1067 * parser.c (check_empty_body): Add.
1068 (cp_parser_iteration_statement): Add call to check_empty_body.
1070 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1073 * mangle.c (write_mangled_name): Mangle static variable names.
1074 (write_unqualified_name): Use local-source-name for
1075 namespace-scope static variables.
1077 2007-05-04 Dirk Mueller <dmueller@suse.de>
1079 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1082 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1085 * decl2.c (constrain_class_visibility):
1086 Use strip_pointer_or_array_types instead of strip_array_types.
1088 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1091 * decl.c (reshape_init_r): Don't reshape the first element if it
1092 is a pointer to member function.
1094 2007-04-27 Simon Baldwin <simonb@google.com>
1096 * decl.c (grokparms): Changed message format from %qD to %qE.
1098 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1100 * error.c (maybe_warn_variadic_templates): Variadic templates are
1101 now in C++0x, so only warn about them in C++98 mode.
1103 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1106 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1107 integeral types from vectors types.
1109 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1112 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1113 for type dependent OMP_CLAUSE_DECLs.
1115 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1118 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1119 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1120 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1121 * init.c (build_zero_init): Adjust, as
1122 COMPLEX_TYPE is now a SCALAR_TYPE.
1123 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1124 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1126 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1128 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1129 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1130 (trait_expr_value): Adjust.
1132 2007-04-23 Simon Baldwin <simonb@google.com>
1134 * decl.c (grokparms): Added new error for duplicate function
1135 parameters names in function prototypes, to match gcc behavior.
1137 2007-04-23 Jan Hubicka <jh@suse.cz>
1139 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1142 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1144 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1145 instead of checking GIMPLE_STMT_P in chain_next.
1147 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1150 * call.c (convert_for_arg_passing): Convert bitfields to their
1153 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1156 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1158 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1161 * cp/decl2.c (constrain_class_visibility):
1162 Do not warn about the use of anonymous namespace in the main input file.
1164 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1166 * cp-tree.h (current_template_parms): Fix typo in comment.
1168 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1170 * cp-tree.h, error.c: Fix comment typos.
1172 2007-04-13 Jason Merrill <jason@redhat.com>
1175 * call.c (reference_binding): Add c_cast_p parm. If true,
1176 add quals to TO as needed to make it reference-compatible.
1178 2007-04-11 Jan Hubicka <jh@suse.cz>
1180 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1181 that we are not processing template_decl.
1183 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1186 * class.c (build_base_path): Ensure that the converted pointer has
1187 the same cv-qualification as the input.
1189 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1191 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1193 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1195 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1197 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1198 * tree.c (cp_add_pending_fn_decls): Remove.
1199 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1201 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1203 Revert change removing staticp.
1205 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1207 * cp-objcp-common.c (cxx_staticp): Remove.
1208 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1209 * cp-tree.h (cxx_staticp):
1211 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1213 * class.c (check_for_override): Don't remove dllmport attribute
1216 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1219 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1220 type issue error and return early.
1222 2007-03-30 Jason Merrill <jason@redhat.com>
1225 * typeck.c (cp_type_readonly): New fn.
1226 * cp-tree.h: Declare it.
1227 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1228 (cp_finish_decl): Not here.
1230 2007-03-31 Richard Guenther <rguenther@suse.de>
1232 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1235 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1240 * parser.c (declarator_can_be_parameter_pack): New.
1241 (cp_parser_template_parameter): Only parse the `...' if the
1242 declarator can be a parameter pack.
1243 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1245 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1246 types (they could be used as array bounds).
1247 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1248 (tsubst_pack_expansion): Handle failure to expand parameter
1251 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1254 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1255 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1256 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1257 (CLASS_TYPE_NON_UNION_P): Add.
1258 (struct lang_type_class): Add has_complex_dflt.
1259 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1260 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1261 * cp-tree.def: Add TRAIT_EXPR.
1262 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1263 * lex.c (struct resword): Add __has_nothrow_assign,
1264 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1265 __has_trivial_constructor, __has_trivial_copy,
1266 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1267 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1268 __is_pod, __is_polymorphic, __is_union.
1269 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1270 (cp_parser_trait_expr): New.
1271 * semantics.c (finish_trait_expr, trait_expr_value
1272 classtype_has_nothrow_copy_or_assign_p): New.
1273 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1275 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1276 * class.c (check_bases, check_field_decl, check_bases_and_members):
1277 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1278 * pt.c (uses_template_parms, tsubst_copy_and_build,
1279 value_dependent_expression_p, type_dependent_expression_p): Deal with
1281 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1283 2007-03-29 Richard Guenther <rguenther@suse.de>
1285 * tree.c (cp_walk_subtrees): Do not set input_location.
1287 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1290 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1293 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1295 * parser.c (struct cp_parser): Update comment for
1296 greater_than_is_operator_p.
1297 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1298 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1299 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1300 !GREATER_THAN_IS_OPERATOR_P.
1301 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1302 `>>' operators that will become two `>' tokens in C++0x.
1303 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1304 mode, allowing it to terminate default arguments.
1305 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1306 `>>' like two consecutive `>' tokens.
1307 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1308 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1309 ends a template argument.
1311 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1313 * decl.c (redeclaration_error_message): Complain when redeclaring
1314 a friend function with default template arguments (C++0x mode only).
1315 * cp-tree.h (check_default_tmpl_args): Declare.
1316 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1317 template arguments in function templates. Add support for checking
1318 the default template arguments of friend templates.
1319 (push_template_decl_real): Fix call to check_default_tmpl_args.
1320 (type_unification_real): If a template parameter has not been
1321 deduced but provides a default template argument, substitute into
1322 that default template argument.
1323 * parser.c (cp_parser_init_declarator): When declaring (but not
1324 defining!) a function template in C++0x mode, check for default
1327 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1330 * decl.c (grokdeclarator): Deal with cv-qualified function type
1331 typedefs in the same way for member and non-member functions.
1333 2007-03-26 Dirk Mueller <dmueller@suse.de>
1335 * parser.c (cp_parser_member_declaration): Pedwarn
1336 about stray semicolons after member declarations.
1338 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1341 * pt.c (instantiate_decl): Set in_system_header.
1343 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1345 * cp-tree.h (current_tempalte_parms): Improve documentation.
1346 * pt.c (current_template_args): Likewise.
1349 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1350 not consume tokens when failing.
1352 2007-03-22 Jim Wilson <wilson@specifix.com>
1353 Mark Mitchell <mark@codesourcery.com>
1356 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1357 consistent with FROM.
1359 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1361 * error.c (dump_expr): Handle dependent names that designate types.
1362 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1364 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1366 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1368 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1370 * cvt.c (cp_convert_and_check) : Define.
1371 * cp-tree.h (cp_convert_and_check): Declare.
1372 * call.c (convert_conversion_warnings): Rename to
1373 conversion_null_warnings. The warning for floating-point to
1374 integer is handled by convert_and_check in convert_like_real.
1375 (convert_like_real): convert_conversion_warnings was renamed as
1376 conversion_null_warnings.
1377 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1378 overflow and changes of value during conversion.
1380 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1383 * parser.c (cp_parser_statement): If 'namespace' is found, this
1384 only can be a namespace alias definition, so parse it now.
1385 (cp_parser_namespace_alias_definition): if we find an open brace
1386 instead of '=', then this is actually a misplaced namespace
1389 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1392 * decl.c (cxx_init_decl_processing): Move command-line options
1393 processing to c-opts.c.
1395 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1397 * ptree.c (cxx_print_type): Use formatting markup for integers
1398 when printing template parameter index/level/orig level.
1399 (cxx_print_xnode): Ditto.
1400 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1401 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1402 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1404 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1405 rather than a HOST_WIDE_INT.
1406 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1407 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1409 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1410 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1411 IN_BASE_INITIALIZER bool bitfields.
1412 (struct cp_declarator): Make KIND a 4-bit field. Make
1413 PARAMETER_PACK_P a bool bitfield just after KIND.
1414 * pt.c (uses_parameter_packs): Destroy the pointer set.
1415 (make_pack_expansion): Ditto.
1416 (check_for_bare_parameter_packs): Ditto.
1417 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1419 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1422 * call.c (convert_default_arg): Instead of copying the node,
1425 2007-03-15 Dirk Mueller <dmueller@suse.de>
1428 * call.c (convert_conversion_warnings): New..
1429 (convert_like_real): .. factored out from here.
1430 (convert_conversion_warnings): Add warning about
1431 false being converted to NULL in argument passing.
1433 2007-03-14 Dirk Mueller <dmueller@suse.de>
1435 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1436 (finish_do_body): Warn about empty body in do/while statement.
1438 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1440 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1442 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1445 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1448 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
1450 * cp/repo.c (init_repo): Initialize random_seed saved options.
1451 (finish_repo): Adjust.
1453 2007-03-13 Mark Mitchell <mark@codesourcery.com>
1456 * Make-lang.in (doc/g++.1): Use $< to specify the location from
1459 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
1461 * decl.c (compute_array_index_type): New warning flag warn_vla.
1463 2007-03-12 Mark Mitchell <mark@codesourcery.com>
1466 * call.c (convert_default_arg): Copy non-constant arguments.
1468 2007-03-11 Mark Mitchell <mark@codesourcery.com>
1471 * parser.c (cp_parser_postfix_expression): Disallow compound
1472 literals in constant expressions.
1475 * semantics.c (finish_typeof): Use unlowered_expr_type.
1477 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1480 * cp-tree.h (unlowered_expr_type): New function.
1481 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1482 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1483 (unlowered_expr_type): New function.
1484 (build_unary_op): Disallow predecrements of bool bitfields.
1485 * call.c (build_conditional_expr): Use unlowered_expr_type.
1486 * pt.c (type_unification_real): Likewise.
1488 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1491 * typeck.c (check_return_expr): Check for bare parameter packs.
1492 (comptypes): Compare template parameter packs and
1493 type pack expansions.
1494 * decl.c (grokdeclarator): Deal with the declaration of function
1496 (grokparms): Verify that the (optional) function parameter pack is
1497 at the end of the parameter list.
1498 (xref_basetypes): Handle pack expansions in the base class.
1499 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1500 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1501 (NONTYPE_ARGUMENT_PACK): New.
1502 (TYPE_PACK_EXPANSION): New.
1503 (EXPR_PACK_EXPANSION): New.
1504 (ARGUMENT_PACK_SELECT): New.
1505 * cp-objcp-common.c (cp_tree_size): Compute size of
1506 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1507 ARGUMENT_PACK_SELECT.
1508 * error.c (dump_template_argument): Print template argument packs.
1509 (dump_template_argument_list): Ditto.
1510 (dump_template_parameter): Dump `...' for template type parameter
1512 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1513 (dump_parameters): Print function parameter packs.
1514 (dump_template_parms): Print template argument packs.
1515 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1516 (maybe_warn_variadic_templates): New.
1517 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1518 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1519 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1521 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1522 (write_template_arg): Write argument packs as separate arguments.
1523 * cp-tree.h (struct template_parm_index_s): Add flag that
1524 indicates that the template parameter is actually a parameter
1526 (struct tree_argument_pack_select): New.
1527 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1528 (union lang_tree_node): Add argument_pack_select.
1529 (FUNCTION_PARAMETER_PACK_P): New.
1530 (PACK_EXPANSION_P): New.
1531 (PACK_EXPANSION_PATTERN): New.
1532 (SET_PACK_EXPANSION_PATTERN): New.
1533 (PACK_EXPANSION_PARAMETER_PACKS): New.
1534 (ARGUMENT_PACK_P): New.
1535 (ARGUMENT_PACK_ARGS): New.
1536 (SET_ARGUMENT_PACK_ARGS): New.
1537 (ARGUMENT_PACK_INCOMPLETE_P): New.
1538 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1539 (TEMPLATE_PARM_PARAMETER_PACK): New.
1540 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1541 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1542 (ARGUMENT_PACK_SELECT_INDEX): New.
1543 (ARGUMENT_PACK_SELECT_ARG): New.
1544 (struct cp_declarator): Add parameter_pack_p flag.
1545 (maybe_warn_variadic_templates): Declare.
1546 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1547 indicate a template parameter pack.
1548 (uses_parameter_packs): Declare.
1549 (template_parameter_pack_p): Declare.
1550 (template_parms_variadic_p): Declare.
1551 (make_pack_expansion): Declare.
1552 (check_for_bare_parameter_packs): Declare.
1553 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1554 sizeof... expressions.
1555 (pp_cxx_expression): Print pack expansions and non-type argument
1557 (pp_cxx_exception_specification): Print pack expansions.
1558 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1559 (pp_cxx_ctor_initializer): Print pack expansions.
1560 (pp_cxx_type_id): Print pack expansions.
1561 (pp_cxx_template_argument_list): Print argument packs.
1562 (pp_cxx_template_parameter): Print ellipsis for template parameter
1564 * pt.c (comp_template_parms): Compare template parameter packs.
1565 (template_parameter_pack_p): New.
1566 (template_parms_variadic_p): New.
1567 (template_args_variadic_p): New.
1568 (make_ith_pack_parameter_name): New.
1569 (struct find_parameter_pack_data): New.
1570 (find_parameter_packs_r): New.
1571 (uses_parameter_packs): New.
1572 (make_pack_expansion): New.
1573 (check_for_bare_parameter_packs): New.
1574 (expand_template_argument_pack): New.
1575 (reduce_template_parm_level): Propagate parameter pack flag.
1576 (process_template_parm): Add is_parameter_pack parameter to state
1577 when the parameter is actually a parameter pack. Create template
1578 parameter packs when is_parameter_pack is true.
1579 (current_template_args): The argument for a template parameter
1580 pack is an argument pack containing a single pack expansion.
1581 (process_partial_specialization): When checking that non-type
1582 argument expressions do not involve template parameters, loop over
1583 the arguments in argument packs separately.
1584 (push_template_decl_real): Check that the type of the declaration
1585 does not have any bare parameter packs. Check that primary
1586 templates have no more than one parameter pack, and that it comes
1587 at the end of the template parameter list.
1588 (convert_template_argument): Handle coercions for pack expansion
1589 expressions by coercing the pattern then rebuilding the expansion.
1590 (coerce_template_parms): When coercing the arguments for a
1591 variadic template, pack "extra" arguments into an argument pack.
1592 (coerce_template_template_parms): Cannot coerce between parameter
1593 packs and non-pack parameters.
1594 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1595 (comp_template_args): Expand all template arguments packs before
1596 comparing template argument lists.
1597 (mangle_class_name_for_template): Make argument packs as separate
1599 (for_each_template_parm_r): No need to handle BASELINK.
1600 (instantiate_class_template): Handle pack expansions in the base
1602 (tsubst_pack_expansion): New.
1603 (tsubst_template_args): Handle substitutions of argument packs and
1604 pack expansion into template argument lists.
1605 (tsubst_decl): Expand function parameter packs into separate
1606 function parameters.
1607 (tsubst_arg_types): Expand a type pack expansion into separate
1609 (tsubst_exception_specification): Handle pack expansions in
1610 exception specifiers.
1611 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1612 replacing a template parameter with its argument. If we encounter
1613 a substitution for an argument pack, just return the parameter
1615 (tsubst_copy): sizeof(X...) returns the number of elements in
1616 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1617 PARM_DECL is a parameter pack.
1618 (tsubst_expr): Expression pack expansions and argument packs
1619 cannot show up here; they will all be handled through function
1620 calls, sizeof, and template argument lists.
1621 (tsubst_copy_and_build): sizeof(X...) returns the number of
1622 elements in parameter pack X. Handle pack expansions in TREE_LIST
1623 and CONSTRUCTOR nodes.
1624 (fn_type_unification): Handle "incomplete" explicit template
1625 argument lists that specify some of the arguments for a template
1627 (type_unification_real): Unify arguments against pack expansions.
1628 (template_parm_level_and_index): New, helper function.
1629 (unify_pack_expansion): New.
1630 (unify): Unify argument packs on an argument-by-argument basis,
1631 handling variadic argument packs as well.
1632 (more_specialized_fn): Handle unification of function parameter
1633 packs. All things being equal, prefer non-variadic function
1634 templates to variadic function templates.
1635 (more_specialized_class): Prefer the variadic class template
1636 partial specialization that binds fewer arguments to a parameter
1638 (regenerate_decl_from_template): Expand function parameter packs
1639 into separate parameters.
1640 (instantiate_decl): Ditto.
1641 (tsubst_initializer_list): Handle pack expansions for base-class
1643 (dependent_type_p_r): Determine dependent types in argument packs
1644 and pack expansions.
1645 (value_dependent_expression_p): Determine value-dependence of
1646 non-type argument packs.
1647 (dependent_template_arg_p): Handle argument packs.
1648 * semantics.c (finish_cond): Check for bare parameter packs.
1649 (finish_expr_stmt): Ditto.
1650 (finish_for_expr): Ditto.
1651 (finish_switch_cond): Ditto.
1652 (finish_mem_initializers): Ditto.
1653 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1655 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1656 * parser.c (make_declarator): Declarator is not an expansion.
1657 (make_pointer_declarator): Transfer parameter pack flag to outer
1659 (make_reference_declarator): Ditto.
1660 (make_ptrmem_declarator): Ditto.
1661 (make_call_declarator): Ditto.
1662 (make_array_declarator): Ditto.
1663 (cp_parser_postfix_expression): Allow pack expansion expressions
1664 in the argument list for a call expression.
1665 (cp_parser_parenthesized_expression_list): Add new parameter
1666 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1667 into separate arguments."
1668 (cp_parser_new_placement): Allow pack expansion expressions.
1669 (cp_parser_new_initializer): Ditto.
1670 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1671 base-class initializer expansion.
1672 (cp_parser_mem_initializer): Ditto.
1673 (cp_parser_template_parameter_list): Keep track of whether the
1674 template parameter is a template parameter pack.
1675 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1676 template parameter pack.
1677 (cp_parser_type_parameter): Ditto.
1678 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1680 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1681 this declarator is a parameter pack.
1682 (cp_parser_parameter_declaration): The ellipsis does not end the
1683 parameter declaration, because it might be a parameter pack. Parse
1684 the ellipsis to indicate a parameter pack.
1685 (cp_parser_initializer): Allow pack expansions.
1686 (cp_parser_initializer_list): Allow ellipsis to create an
1687 initializer expansion.
1688 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1690 (cp_parser_type_id_list): Allow ellipsis to create an exception
1691 specifier expansion.
1692 (cp_parser_attribute_list): Don't allow pack expansions.
1693 (cp_parser_functional_cast): Allow pack expansions.
1694 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1695 compute the length of a parameter pack.
1696 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1697 end a template argument.
1698 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1699 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1702 2007-03-09 Dirk Mueller <dmueller@suse.de>
1704 * cp/call.c (build_new_op): Call warn_logical_operator.
1706 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1709 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1712 * pt.c (any_template_arguments_need_structural_equality_p):
1715 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1717 * decl.c (grokdeclarator): Disable warnings for anonymous
1720 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1722 * typeck2.c (readonly_error): Always emit a hard error.
1723 Remove last argument.
1724 * cp-tree.h (readonly_error): Adjust prototype.
1725 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1726 * typeck.c (build_unary_op): Likewise.
1727 (build_modify_expr): Likewise.
1729 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1732 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1734 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1737 * parser.c (struct cp_parser): New IN_IF_STMT.
1738 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1739 returning if parsing the body of an 'if' statement or issuing an
1740 error and continuing.
1741 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1743 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1745 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1748 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1751 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1753 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1754 Objective-C++. Don't exit early if -shared-libgcc needs to be
1757 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1759 * typeck.c (common_base_type): Delete unused function.
1761 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1763 * Make-lang.in: Add dummy lang.install-pdf target.
1765 2007-03-01 Simon Baldwin <simonb@google.com>
1768 * decl.c (check_tag_decl): Added new warning for typedef ignored
1769 when it precedes an otherwise valid non-typedef declaration.
1771 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1773 * typeck.c (build_function_call): Store converted arguments
1774 in a stack-allocated array instead of building a list.
1775 (convert_arguments): Store arguments in the array passed in as an
1776 argument, and return the actual number of arguments.
1777 * call.c (build_call): Delete, and replace with...
1778 (build_call_n, build_call_a): New.
1779 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1780 (build_over_call): Store converted arguments in a stack-allocated
1781 array instead of building a list.
1782 (build_cxx_call): Pass arguments in an array instead of as a list.
1783 (build_java_interface_fn_ref): Rewrite to avoid constructing
1785 * tree.h: Update declarations to reflect above changes.
1786 * method.c (use_thunk): Use a stack-allocated array to hold
1787 the arguments instead of a list.
1788 * rtti.c (throw_bad_cast): Update call to cxx_call.
1789 (throw_bad_typeid): Likewise.
1790 (build_dynamic_cast_1): Likewise.
1791 * init.c (build_builtin_delete_call): Use build_call_n.
1792 * decl.c (expand_static_init): Likewise.
1793 * except.c (cp_protect_cleanup_actions): Likewise.
1794 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1795 (gimplify_must_not_throw_expr): Likewise.
1796 (cxx_omp_apply_fn): Use build_call_a.
1798 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1800 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1801 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1803 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1805 * cp-tree.h (static_ctors): Remove.
1806 * cp-tree.h (static_dtors): Likewise.
1807 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1808 refactoring of tree_map hierarchy.
1809 (decl_shadowed_for_var_insert): Likewise.
1810 * semantics.c (expand_body): Use c_expand_body.
1811 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1812 * decl2.c (static_ctors): Remove.
1813 (static_dtors): Likewise.
1814 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1815 objc_generate_static_init_call. Do not call static_[cd]tors.
1816 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1818 (cp_write_global_declarations): Likewise.
1820 2007-02-23 Richard Guenther <rguenther@suse.de>
1822 * class.c (note_name_declared_in_class): Make declaration
1823 changes meaning a pedwarn.
1825 2007-02-22 Michael Matz <matz@suse.de>
1828 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1829 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1830 dump_function_decl): Guard emitting outer scopes by new flag.
1831 * cp-lang.c (cxx_dwarf_name): New function.
1832 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1833 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1835 (push_template_decl_real, lookup_template_class): Remove calls
1838 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1840 * call.c (build_new_method_call): Ensure that explicit calls of
1841 destructors have type "void".
1843 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1845 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1846 and -Walways-true with -Waddress.
1847 * cvt.c (convert_to_void): Replace unconditional warning with
1850 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1852 * decl.c, tree.c: Fix comment typos.
1854 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1857 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1858 statement expression if we had an error mark node.
1860 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1861 Brooks Moses <brooks.moses@codesourcery.com>
1862 Lee Millward <lee.millward@codesourcery.com>
1864 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1865 Change class to tcc_vl_exp.
1867 * call.c (build_call): Use build_call_list instead
1869 (build_over_call): Likewise.
1870 (build_new_method_call): Use build_min_non_dep_call_list
1871 instead of build_min_non_dep.
1873 * error.c (dump_call_expr_args): New function.
1874 (dump_aggr_init_expr_args): New function.
1875 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1876 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1878 * cvt.c (convert_to_void): Use build_call_array instead
1879 of build3; use new AGGR_INIT_EXPR accessor macros.
1881 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1882 instead of TREE_CODE_LENGTH.
1884 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1885 AGGR_INIT_EXPR accessor macros.
1887 * cp-gimplify.c (cp_gimplify_init_expr): Use
1888 AGGR_INIT_EXPR_SLOT to set the slot operand.
1890 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1891 (AGGR_INIT_EXPR_SLOT): New macro.
1892 (AGGR_INIT_EXPR_ARG): New macro.
1893 (aggr_init_expr_nargs): New macro.
1894 (AGGR_INIT_EXPR_ARGP): New macro.
1895 (aggr_init_expr_arg_iterator): New.
1896 (init_aggr_init_expr_arg_iterator): New.
1897 (next_aggr_init_expr_arg): New.
1898 (first_aggr_init_expr_arg): New.
1899 (more_aggr_init_expr_args_p): New.
1900 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1901 (stabilize_aggr_init): New declaration.
1902 (build_min_non_dep_call_list): Likewise.
1904 * tree.c (process_aggr_init_operands): New function.
1905 (build_aggr_init_array) New function.
1906 (build_cplus_new): Update to use new CALL_EXPR and
1907 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1908 build_aggr_init_array.
1909 (build_min_non_dep_call_list) New function.
1910 (build_min_nt): Assert input code parameter is not a variable
1911 length expression class.
1912 (build_min, build_min_non_dep): Likewise.
1913 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1914 to check for equality instead of recursing. Handle tcc_vl_exp
1916 (stabilize_call): Update to only handle CALL_EXPRs, not
1917 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1918 (stabilize_aggr_init): New function.
1919 (stabilize_init): Use it.
1921 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1922 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1923 AGGR_INIT_EXPR accessor macros and argument iterators.
1925 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1926 build_vl_exp. Iterate through the operands, recursively
1927 processing each one.
1928 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1929 CALL_EXPR accessor macros.
1930 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1931 tree code classes. Use TREE_OPERAND_LENGTH instead of
1934 * semantics.c (finish_call_expr): Use build_nt_call_list
1935 instead of build_nt.
1936 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1937 accessor macros. Use build_call_array to construct the
1938 CALL_EXPR node instead of build3
1940 * decl2.c (build_offset_ref_call_from_tree): Use
1941 build_nt_call_list and build_min_non_dep_call_list instead
1942 of build_min_nt and build_min_non_dep.
1944 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1945 Use build_nt_call_list instead of build_min_nt.
1947 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1950 * call.c (build_conditional_expr): Improve error message.
1952 2007-02-13 Dirk Mueller <dmueller@suse.de>
1954 * friend.c (do_friend): Annotate warning about friend
1955 declarations in templates with OPT_Wnon_template_friend.
1956 Convert informal message from warning() to inform().
1958 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1959 Mark Mitchell <mark@codesourcery.com>
1962 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1963 instantiations for variables.
1965 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1968 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1969 Check warn_unused_value just once.
1971 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1974 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1975 (fn_type_unificiation): Likewise.
1976 (get_bindings): Likewise.
1978 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1981 * decl.c (finish_function): Use DECL_REPLACEABLE.
1982 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1984 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1986 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1988 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1990 * decl.c (grokvardecl): Don't error if !have_tls.
1991 (grokdeclarator): Likewise.
1992 * parser.c (cp_parser_omp_threadprivate): Likewise.
1994 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1997 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1998 parameters and result decls in omp clauses.
1999 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2002 2007-02-05 Dirk Mueller <dmueller@suse.de>
2005 * parser.c (cp_parser_class_specifier): Always initialize bases.
2007 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2009 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2010 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2011 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2013 * semantics.c (finish_omp_atomic): Store a whole expression node
2014 in operand 1, and integer_zero_node in operand 0, for dependent
2015 OMP_ATOMIC. Rewrite to make flow easier to understand.
2017 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2019 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2021 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2023 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2024 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2026 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2028 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2029 keyword warning to -Wc++0x-compat.
2031 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2033 * decl.c (grokdeclarator): Update documentation.
2035 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2038 * decl.c (grokdeclarator): If __thread is used together with
2039 a storage class other than extern and static, clear thread_p
2040 after issuing diagnostics and fall through to checking the
2043 2007-01-30 Roger Sayle <roger@eyesopen.com>
2045 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2046 calculating the size of an array (to avoid recursive errors).
2048 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2051 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2053 * call.c (convert_like_real): Don't warn when converting to
2056 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2058 * decl.c (pop_label): Replace warning with call to
2059 warn_for_unused_label.
2061 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2064 * semantics.c (finish_pseudo_destructor_expr): Check the
2065 destrutor name by calling check_dtor_name.
2067 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2069 * lex.c (D_CPP0X): Rename.
2071 (reswords): D_CPP0X -> D_CXX0X.
2072 (init_reswords): Ditto.
2073 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2074 of C++0x keywords as identifiers.
2076 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2079 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2082 2007-01-23 Ian Lance Taylor <iant@google.com>
2084 * typeck.c (convert_for_assignment): Only warn about a = b = c
2085 when converting to bool.
2087 2007-01-23 Roger Sayle <roger@eyesopen.com>
2089 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2091 * typeck.c (ignore_overflows): Remove the remaining uses of
2092 TREE_CONSTANT_OVERFLOW.
2094 2007-01-20 Jan Hubicka <jh@suse.cz>
2096 * decl2.c (start_objects, start_static_storage_duration_function):
2097 Do not make the functions uninlinable.
2099 2007-01-17 Ian Lance Taylor <iant@google.com>
2101 * class.c (add_method): Call VEC_reserve_exact rather than passing
2102 a negative size to VEC_reserve.
2104 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2107 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2109 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2112 * decl.c (make_typename_type): If the qualified name is not a
2113 type, issue an error.
2114 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2117 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2119 * rtti.c: Include target.h.
2120 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2121 don't emit typeinfo for fundamental types as weak.
2122 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2124 2007-01-08 Richard Guenther <rguenther@suse.de>
2126 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2128 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2130 * call.c (standard_conversion): Pass flag to
2131 vector_types_convertible_p to disallow emission of note.
2132 * typeck.c (convert_for_assignment): Pass flag to
2133 vector_types_convertible_p to allow emission of note.
2134 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2135 to disallow emission of note.
2137 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2140 * typeck.c (build_binary_op): Call overflow_warning if
2141 TREE_OVERFLOW_P is true for the result and not for any of the
2144 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2147 * class.c (add_method): Don't wait until template
2148 instantiation time to complain about duplicate methods.
2150 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2153 * semantics.c (finish_unary_op_expr): Warn only if result
2154 overflowed and operands did not.
2156 2007-01-05 Ian Lance Taylor <iant@google.com>
2158 * typeck.c (build_binary_op): Warn about comparing a non-weak
2161 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2163 * pt.c (tsubst): Propagate the need for structural equality checks
2164 when reducing the level of template parameters.
2166 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2168 * pt.c: Fix a comment typo.
2170 2007-01-02 Ian Lance Taylor <iant@google.com>
2172 * semantics.c (maybe_convert_cond): Optionally warn when using an
2173 assignment as a condition.
2174 * typeck.c (convert_for_assignment): Optionally warn about
2175 assigning the result of an assignment to a bool.
2177 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2179 * pt.c (canonical_template_parms): Correct typo in comment.
2181 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2183 * typeck.c (structural_comptypes): Renamed from "comptypes".
2184 (comptypes): Use canonical type information to perform fast type
2185 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2186 canonical type comparison returns the same results as we would see
2187 from the current, structural check. Support COMPARE_STRUCTURAL
2188 when we need structural checks.
2189 * decl.c (typename_compare): Fix comment.
2190 (build_typename_type): TYPENAME_TYPE nodes require structural
2191 equality checks, because they resolve different based on the
2193 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2194 require structural equality checks (for now).
2195 (build_ptrmemfunc_type): Build the canonical pointer to member
2197 (compute_array_index_type): Whenever we build a new index type
2198 to represent the size of an array in a template, we need to mark
2199 this index type as requiring structural equality. This goes for
2200 arrays with value-dependent sizes with the current ABI, or all
2202 * tree.c (cplus_array_hash): New.
2203 (struct cplus_array_info): New.
2204 (cplus_array_compare): New.
2205 (cplus_array_htab): New.
2206 (build_cplus_array_type_1): Use a hash table to cache the array
2207 types we build. Build the canonical array type for each array
2209 (cp_build_qualified_type_real): When building a cv-qualified array
2210 type, use the hash table of array types and build canonical array
2212 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2213 use structural equality (for now).
2214 * cp-tree.h (COMPARE_STRUCTURAL): New.
2215 * pt.c (canonical_template_parms): New.
2216 (canonical_type_parameter): New.
2217 (process_template_parm): Find the canonical type parameter.
2218 (lookup_template_class): When we have named the primary template
2219 type, set the canonical type for our template class to the primary
2220 template type. If any of the template arguments need structural
2221 equality checks, the template class needs structural equality
2223 (tsubst): When reducing the level of a template template
2224 parameter, we require structural equality tests for the resulting
2225 parameter because its template parameters have not had their types
2226 canonicalized. When reducing a template type parameter, find the
2227 canonical reduced type parameter.
2228 (any_template_arguments_need_structural_equality_p): New.