1 2007-10-27 Jakub Jelinek <jakub@redhat.com>
4 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
5 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
7 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
9 * error.c (dump_expr): Handle OFFSETOF_EXPR.
11 2007-10-26 Jason Merrill <jason@redhat.com>
14 * pt.c (get_template_info): New fn.
15 (template_class_depth): Use it.
16 (push_template_decl_real): Check that the template args of the
17 definition match the args of the previous declaration.
19 2007-10-26 Paolo Carlini <pcarlini@suse.de>
22 * decl2.c (coerce_new_type): Do not allow a default argument for
25 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
28 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
29 don't see the leading '('. Only lookup names if we get an
32 2007-10-26 Jakub Jelinek <jakub@redhat.com>
35 * parser.c (cp_parser_parenthesized_expression_list): Set
36 greater_than_is_operator_p to true in between the parens.
38 2007-10-26 Paolo Carlini <pcarlini@suse.de>
41 * decl.c (grokdeclarator): In case of conflicting specifiers
42 just return error_mark_node.
44 2007-10-26 Ollie Wild <aaw@google.com>
46 * expr.c (cxx_expand_expr): Removed.
47 * cp-tree.h (exx_expand_expr): Removed.
48 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
51 2007-10-25 Paolo Carlini <pcarlini@suse.de>
54 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
56 2007-10-23 Jason Merrill <jason@redhat.com>
59 * call.c (struct conversion): Remove check_copy_constructor_p.
60 (reference_binding): Always bind a reference directly to a
61 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
63 (check_constructor_callable): Remove.
64 (convert_like_real): Don't call it.
65 (initialize_reference): Don't call check_constructor_callable.
66 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
67 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
68 conversions if LOOKUP_NO_TEMP_BIND.
69 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
70 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
72 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
74 2007-10-22 Jakub Jelinek <jakub@redhat.com>
77 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
78 before checking if its type is integral.
80 2007-10-22 Jason Merrill <jason@redhat.com>
83 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
84 * pt.c (apply_late_template_attributes): Splice out dependent
85 attributes from DECL_ATTRIBUTES.
87 * decl.c (cxx_maybe_build_cleanup): Use build_address.
89 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
91 * typeck.c (build_binary_op) : Use appropriate warning option
92 instead of unnamed warning.
94 2007-10-16 Paolo Carlini <pcarlini@suse.de>
97 * pt.c (current_template_args): Do not change TREE_LIST elements
98 with a TREE_VALUE of error_mark_node.
100 2007-10-16 Mark Mitchell <mark@codesourcery.com>
102 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
103 * decl.c (start_decl): Tidy.
104 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
106 (grokdeclarator): Clarify comment.
108 2007-10-14 Andrew Pinski <pinskia@gmail.com>
111 * decl.c (grokfndecl): Return NULL after the "definition of
112 implicitly-declared" error happened.
114 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
117 * call.c (build_user_type_conversion_1): Do not consider conversion
118 functions to convert a (possibly cv-qualified) object to the (possibly
119 cv-qualified) same object type (or a reference to it), to a (possibly
120 cv-qualified) base class of that type (or a reference to it).
122 2007-10-12 Paolo Carlini <pcarlini@suse.de>
124 * pt.c (tsubst): Use template_parm_level_and_index.
126 2007-10-12 Jakub Jelinek <jakub@redhat.com>
129 * parser.c (cp_parser_compound_statement): Handle label-declarations
130 at the beginning of the compound statement.
131 (cp_parser_block_declaration): Issue diagnostics about __label__
132 not at the beginning of a block.
134 2007-10-11 Paolo Carlini <pcarlini@suse.de>
137 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
138 to convert_template_argument.
139 (coerce_template_parms): Return error_mark_node after fixed-length
141 (tsubst_decl): Check for error_mark_node the return value of the
142 first tsubst in 'case VAR_DECL'.
144 2007-10-08 Ollie Wild <aaw@google.com>
146 * typeck2.c (digest_init): Call cplus_expand_constant after
147 convert_for_initialization.
148 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
149 * expr.c (cplus_expand_constant): Updated function description.
151 2007-10-04 Jason Merrill <jason@redhat.com>
154 * call.c (initialize_reference): Handle local static reference
157 2007-10-03 Jason Merrill <jason@redhat.com>
160 * name-lookup.c (push_namespace_with_attrs): Fold back into...
161 (push_namespace): Here.
162 (handle_namespace_attrs): New fn for the attr code.
163 (leave_scope): Don't pop_visibility.
164 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
165 * parser.c (cp_parser_namespace_definition): Call
166 handle_namespace_attrs and pop_visibility as appropriate.
169 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
171 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
173 * decl.c (duplicate_decls): Preserve linkage flags for mere
174 redeclarations of gnu_inline definitions.
176 2007-10-03 Jason Merrill <jason@redhat.com>
179 * decl.c (wrap_cleanups_r): New fn.
180 (wrap_temporary_cleanups): New fn.
181 (initialize_local_var): Call it.
183 2007-09-29 Jason Merrill <jason@redhat.com>
186 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
187 constant to not have DECL_EXTERNAL if it's file-local.
189 2007-09-28 Ollie Wild <aaw@google.com>
192 2007-09-27 Ollie Wild <aaw@google.com>
194 * typeck2.c (digest_init): Call cplus_expand_constant after
195 convert_for_initialization.
196 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
197 * expr.c (cplus_expand_constant): Updated function description.
199 2007-09-28 Jason Merrill <jason@redhat.com>
202 * class.c (layout_empty_base): Take rli parameter, update
203 rli->record_align if empty base has user-specified alignment.
204 (build_base_field): Pass rli to it.
206 2007-09-28 Paolo Carlini <pcarlini@suse.de>
209 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
211 2007-09-28 Paolo Carlini <pcarlini@suse.de>
214 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
215 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
216 (dump_parameters): Just call dump_type for argument packs too.
218 2007-09-28 Jakub Jelinek <jakub@redhat.com>
221 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
222 qualification by creating qualified PACK_EXPANSION_PATTERN and
223 then calling make_pack_expansion on it.
225 2007-09-27 Ollie Wild <aaw@google.com>
227 * typeck2.c (digest_init): Call cplus_expand_constant after
228 convert_for_initialization.
229 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
230 * expr.c (cplus_expand_constant): Updated function description.
232 2007-09-27 Jason Merrill <jason@redhat.com>
235 * decl2.c (is_late_template_attribute): Don't crash on unknown
238 2007-09-27 Paolo Carlini <pcarlini@suse.de>
241 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
242 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
243 spaces in the formatting.
244 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
246 2007-09-27 Jakub Jelinek <jakub@redhat.com>
248 * error.c (cxx_print_error_function): Add third argument, pass
249 it over to lhd_print_error_function.
250 (cp_print_error_function): If diagnostic->abstract_origin, print
252 * cp-tree.h (struct diagnostic_info): New forward decl.
253 (cxx_print_error_function): Add third argument.
255 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
258 * name-lookup.c (pushtag): Do not create an implicit typedef before
259 the associated type declaration is known to be valid.
261 2007-09-25 Jakub Jelinek <jakub@redhat.com>
263 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
264 rather than pointers.
266 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
269 * search.c (check_final_overrider): Fail if
270 targetm.comp_type_attributes returns 0.
272 2007-09-24 Jason Merrill <jason@redhat.com>
275 * pt.c (resolve_typename_type): Don't look things up in the original
276 template if it would mean losing template arguments.
278 2007-09-24 Jakub Jelinek <jakub@redhat.com>
281 * cp-tree.h (cxx_type_hash_eq): New prototype.
282 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
283 * tree.c (cxx_type_hash_eq): New function.
285 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
288 * tree.c (cp_build_qualified_type_real): Build a canonical
289 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
291 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
295 * tree.c (cplus_array_compare): Compare pointers, not types.
296 (build_cplus_array_type_1): Store new array type into the hash
297 table before building the canonical type; build the canonical type
299 (cp_build_qualified_type_real): Put all of the array types with
300 cv-qualified element types into the C++ array hash table, built as
301 variants of the unqualified versions.
303 2007-09-23 Jason Merrill <jason@redhat.com>
306 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
307 for deprecation warnings.
309 2007-09-22 Jason Merrill <jason@redhat.com>
312 * call.c (build_over_call): Warn about deprecated virtuals.
315 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
316 (MAYBE_TAGGED_TYPE_P): Remove.
317 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
318 instead of calling is_late_template_attribute again.
319 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
320 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
321 Don't crash on typedefs from non-template classes.
322 * decl2.c (grokfield): Don't sorry about attrs on template parms.
323 (is_late_template_attribute): All attributes applied to template
324 parms or typename types are dependent. Static.
325 (splice_template_attributes): Pass decl through.
326 (save_template_attributes): Likewise.
328 2007-09-20 Jakub Jelinek <jakub@redhat.com>
331 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
332 returned from tsubst_pack_expansion.
333 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
334 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
336 2007-09-20 Paolo Carlini <pcarlini@suse.de>
339 * semantics.c (finish_id_expression): Use consistently
340 context_for_name_lookup.
341 * decl.c (fixup_anonymous_aggr): Fix error message for
342 anonymous struct (vs union).
344 2007-09-19 Jason Merrill <jason@redhat.com>
347 * pt.c (tsubst): Handle typedefs by looking for the specialization.
348 (retrieve_specialization): Only tagged types use
349 DECL_TEMPLATE_INSTANTIATIONS.
350 (instantiate_class_template): Push nested classes too.
351 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
353 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
354 * init.c (is_aggr_type): Remove redundant tests.
355 * class.c (push_nested_class): Use CLASS_TYPE_P.
357 2007-09-20 Paolo Carlini <pcarlini@suse.de>
360 * init.c (build_zero_init): If, recursively, build_zero_init
361 returns a NULL_TREE, do not append it to the VEC of constructors.
363 2007-09-18 Jason Merrill <jason@redhat.com>
366 * pt.c (apply_late_template_attributes): Set processing_template_decl.
367 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
368 ATTR_FLAG_TYPE_IN_PLACE.
369 (tsubst): Do unqualified lookup to find typedefs from current class.
370 [ARRAY_TYPE]: Propagate alignment info.
371 * decl2.c (is_late_template_attribute): Only defer handling of
372 attribute aligned if the expression is dependent.
373 (save_template_attributes): If we're deferring any attributes,
374 make this a naming typedef.
376 2007-09-18 Paolo Carlini <pcarlini@suse.de>
379 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
380 va_arg instead of __builtin_va_arg.
382 2007-09-18 Paolo Carlini <pcarlini@suse.de>
385 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
386 (pp_cxx_primary_expression): Use it.
387 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
388 * error.c (dump_expr): Use it.
390 2007-09-18 Paolo Carlini <pcarlini@suse.de>
393 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
394 out case TYPEID_EXPR to...
395 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
396 and pp_cxx_right_paren.
397 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
398 * error.c (dump_expr): Use it.
400 2007-09-18 Paolo Carlini <pcarlini@suse.de>
403 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
404 (pp_cxx_primary_expression): Use it.
405 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
406 * error.c (dump_expr): Use it.
408 2007-09-16 Paolo Carlini <pcarlini@suse.de>
411 * init.c (build_new): Remove warning for zero-element
414 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
417 * call.c (maybe_handle_implicit_object): Set this_p, clear
418 rvaluedness_matches_p.
419 (compare_ics): Do not compare rvaluedness matching when one of the
420 operands is an implicit object.
422 2007-09-14 Jason Merrill <jason@redhat.com>
424 PR c++/17743, c++/19163
425 * decl2.c (is_late_template_attribute): New fn.
426 (splice_template_attributes, save_template_attributes): New fns.
427 (cplus_decl_attributes): Call save_template_attributes.
428 * pt.c (apply_late_template_attributes): New fn.
429 (instantiate_class_template, tsubst_decl): Use it.
430 * cp-tree.h: Declare is_late_template_attribute.
432 2007-09-13 Tom Tromey <tromey@redhat.com>
434 * parser.c (cp_lexer_new_main): Don't use
435 c_lex_return_raw_strings.
436 (cp_lexer_get_preprocessor_token): Update. Add special case when
439 2007-09-11 Jan Hubicka <jh@suse.cz>
441 * method.c (use_thunk): Use tree_rest_of_compilation
442 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
443 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
444 * cp-tree.h (expand_body): Kill.
445 (emit_associated_thunks): Declare.
446 * semantics.c (emit_associated_thunks): Export.
449 2007-09-09 David Daney <ddaney@avtrex.com>
452 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
453 to calculate cookie_ptr.
455 2007-09-08 Jason Merrill <jason@redhat.com>
458 * pt.c (most_specialized_class): Set processing_template_decl
459 while tsubsting partial spec args.
461 2007-09-06 Jason Merrill <jason@redhat.com>
463 * decl2.c (get_guard): Copy visibility from the guarded variable.
465 2007-09-06 Jan Hubicka <jh@suse.cz>
467 * semantics.c (expand_body): Do not mark arguments of clones used.
469 2007-09-06 Paolo Carlini <pcarlini@suse.de>
472 * decl.c (cp_finish_decl): When processing_template_decl,
473 deal correctly with init as TREE_LIST.
475 2007-09-06 Tom Tromey <tromey@redhat.com>
477 * decl.c (finish_function): Put return's location on line zero of
480 2007-09-05 Jason Merrill <jason@redhat.com>
483 * except.c (prepare_eh_type): Use type_decays_to.
486 * init.c (build_delete): Use build_headof to get the address of the
487 complete object if we aren't using the deleting destructor.
488 * rtti.c (build_headof): No longer static.
489 * cp-tree.h: Declare it.
491 2007-09-06 Jakub Jelinek <jakub@redhat.com>
493 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
494 decl if a prototype for XX is provided with throw().
497 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
498 on __*_chk non-__builtin_* decls.
500 2007-09-05 Paolo Carlini <pcarlini@suse.de>
503 * semantics.c (finish_id_expression): Use context_for_name_lookup
504 insted of DECL_CONTEXT, to see through anonymous structs and unions.
505 * class.c (finish_struct_anon): Deal correctly with anonymous
506 structs (vs unions, as GNU extension) in error messages.
508 2007-09-05 Jan Hubicka <jh@suse.cz>
510 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
511 call, DECL_EXTERNAL checks and current_function_decl saving.
513 2007-09-05 Paolo Carlini <pcarlini@suse.de>
516 * parser.c (cp_parser_primary_expression): Return error_mark_node
517 when a statement-expression is found in a template-argument list.
519 2007-09-04 Jason Merrill <jason@redhat.com>
521 * except.c (initialize_handler_parm): Use
522 fold_build_cleanup_point_expr.
525 * call.c (reference_binding): Don't look for user-defined conversions
529 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
530 the MUST_NOT_THROW_EXPR.
532 2007-09-04 Richard Sandiford <richard@codesourcery.com>
534 * decl.c (cp_finish_decl): Call determine_visibility before
535 make_rtl_for_nonlocal_decl.
537 2007-09-04 Jason Merrill <jason@redhat.com>
540 * pt.c (most_specialized_class): Substitute outer template
541 arguments into the arguments of a member template partial
543 (strip_innermost_template_args): New fn.
545 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
547 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
549 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
551 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
552 * decl.c (cp_make_fname_decl): Likewise,
553 * parser.c (cp_parser_string_literal): Likewise,
554 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
555 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
558 2007-09-02 Paolo Carlini <pcarlini@suse.de>
561 * typeck.c (build_unary_op): Fix error message for
562 Boolean expression as operand to operator--.
564 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
566 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
567 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
570 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
573 * init.c (build_default_init): Make extern.
574 * cp-tree.h (build_default_init): Declare here.
575 * pt.c (tsubst_expr): When the instantiation of the initializer of
576 a variable results in an empty list, default-initialize the
578 (tsubst_copy_and_build): When the instantiation of the initializer
579 in a new expression results in an empty initializer list,
580 default-initialize it.
582 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
584 * mangle.c (write_type): Change mangling of rvalue reference from
587 2007-08-31 Jakub Jelinek <jakub@redhat.com>
589 * decl.c (duplicate_decls): Remove duplicated line.
591 2007-08-31 Paolo Carlini <pcarlini@suse.de>
594 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
595 BOUND_TEMPLATE_TEMPLATE_PARM.
597 2007-08-31 Paolo Carlini <pcarlini@suse.de>
600 * search.c (lookup_member): Check the name argument for
603 2007-08-31 Paolo Carlini <pcarlini@suse.de>
606 * parser.c (cp_parser_trait_expr): Check rerurn value of
609 2007-08-30 Ollie Wild <aaw@google.com>
611 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
612 convert_ptrmem for pointer to member conversions.
613 (convert_to_pointer_force): Update cp_convert_to_pointer call.
614 (ocp_convert): Update cp_convert_to_pointer call.
615 * typeck.c (convert_ptrmem): Add conditional for null pointers to
617 (build_static_cast_1): Check can_convert for conversions in either
619 (get_delta_difference_1): New function.
620 (get_delta_difference): Refactor to call get_delta_difference_1.
622 2007-08-30 Jakub Jelinek <jakub@redhat.com>
624 * decl.c (start_preparsed_function): Set
625 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
627 2007-08-28 Paolo Carlini <pcarlini@suse.de>
630 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
631 BOUND_TEMPLATE_TEMPLATE_PARM.
633 2007-08-28 Jakub Jelinek <jakub@redhat.com>
637 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
638 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
640 2007-08-27 Jason Merrill <jason@redhat.com>
643 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
644 Look inside STMT_EXPR.
645 * semantics.c (stmt_expr_value_expr): New fn.
646 * cp-tree.h: Declare it.
649 * decl.c (groktypename): Ignore attributes applied to class type.
651 2007-08-28 Richard Guenther <rguenther@suse.de>
653 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
655 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
657 * error.c (dump_expr): Handle COMPLEX_CST.
658 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
659 (pp_cxx_expression): Likewise.
661 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
663 * decl.c (GNU_INLINE_P): New.
664 (duplicate_decls): Handle gnu_inline. Merge attributes and
665 some flags in overriding definitions.
666 (redeclaration_error_message): Handle gnu_inline.
667 (start_preparsed_function): Likewise.
669 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
671 * call.c (sufficient_parms_p): Constify.
672 * class.c (same_signature_p): Likewise.
673 * cp-gimplify.c (is_invisiref_parm,
674 cxx_omp_privatize_by_reference): Likewise.
675 * cp-objcp-common.c (has_c_linkage): Likewise.
676 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
677 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
678 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
679 num_artificial_parms_for, comp_template_parms,
680 template_parameter_pack_p, any_dependent_template_arguments_p,
681 any_type_dependent_arguments_p, any_value_dependent_elements_p,
682 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
683 zero_init_p, member_p, cp_lvalue_kind,
684 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
685 varargs_function_p, is_dummy_object, special_function_kind,
686 string_conv_p, type_unknown_p, comp_except_specs, compparms,
687 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
688 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
689 cp_has_mutable_p, at_least_as_qualified_p,
690 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
691 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
692 * except.c (nothrow_libfn_p): Likewise.
693 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
695 * pt.c (comp_template_parms, template_parameter_pack_p,
696 any_type_dependent_arguments_p, any_value_dependent_elements_p,
697 any_dependent_template_arguments_p): Likewise.
698 * repo.c (repo_export_class_p): Likewise.
699 * semantics.c (anon_aggr_type_p): Likewise.
700 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
701 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
702 varargs_function_p, member_p, is_dummy_object, pod_type_p,
703 zero_init_p, special_function_p): Likewise.
704 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
705 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
706 compparms, invalid_nonstatic_memfn_p,
707 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
708 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
709 cp_has_mutable_p, lvalue_or_else): Likewise.
711 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
713 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
714 * cp-objcp-common.c (cp_tree_size): Ditto.
715 * tree.c (cp_walk_subtrees): Ditto
716 * cp-tree.def (TINST_LEVEL): Go away.
717 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
718 move together with other non-tree structs.
719 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
720 (union lang_tree_node): Eliminate tinst_level field.
721 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
722 (current_instantiation, outermost_tinst_level): Return
723 a "struct tinst_level *".
725 * error.c (print_instantiation_partial_context): Change second
726 parameter to a "struct tinst_level *". Replace accessor macros
728 (print_instantiation_full_context): Likewise.
729 * lex.c (in_main_input_context): Likewise.
731 * pt.c (struct pending_templates): New.
732 (pending_templates, last_pending_template): Use it as a type.
733 (current_tinst_level): Change typo to "struct tinst_level *"
734 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
735 (add_pending_template): Construct a "struct pending_template".
736 Replace TINST_LEVEL accessor macros with field access.
737 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
738 (pop_tinst_level): Likewise.
739 (instantiate_pending_templates): Likewise. Factor common code used
740 when an instantiation has been done.
741 (outermost_tinst_level): Replace tree_last with loop.
742 (current_instantiation): Return a "struct tinst_level *".
744 2007-08-24 Ollie Wild <aaw@google.com>
746 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
747 * name-lookup.h (cp_binding_level): Remove vtables member.
749 2007-08-24 Richard Guenther <rguenther@suse.de>
751 * tree.c (cp_cannot_inline_tree_fn): Remove.
752 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
753 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
756 2007-08-24 Jakub Jelinek <jakub@redhat.com>
759 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
760 error_mark_node right away if build_expr_type_conversion
764 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
765 is error_mark_node rather than NULL_TREE.
766 * pt.c (check_explicit_specialization): Likewise.
769 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
770 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
772 2007-08-22 Jason Merrill <jason@redhat.com>
775 * pt.c (outermost_tinst_level): New function.
776 * lex.c (in_main_input_context): New function.
777 * cp-tree.h: Declare it.
778 * decl2.c (constrain_class_visibility): Use it to avoid warning
779 about uses of the anonymous namespace in the main input file.
781 2007-08-21 Jakub Jelinek <jakub@redhat.com>
783 * init.c (build_new_1): Use get_target_expr instead of save_expr.
785 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
788 * class.c (finish_struct_1): Warn when a class has virtual
789 functions and accessible non-virtual destructor.
791 2007-08-20 Richard Guenther <rguenther@suse.de>
795 * call.c (build_new_method_call): Convert initializer to
797 * init.c (build_aggr_init): Do not fiddle with types.
798 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
799 * except.c (build_throw): Do not drop qualifiers for the
801 * typeck.c (get_member_function_from_ptrfunc): Do not
802 fiddle with types, instead convert.
803 (build_ptrmemfunc1): Convert to the target type for
805 (gfc_trans_allocate): Convert result to target type.
806 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
807 pointer-to-member structures shall have alias set zero as well.
809 2007-08-20 Richard Guenther <rguenther@suse.de>
811 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
813 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
814 (nonstatic_local_decl_p): Likewise.
815 * tree.c (cp_auto_var_in_fn_p): Remove.
816 * decl.c (nonstatic_local_decl_p): Remove.
818 2007-08-20 Richard Guenther <rguenther@suse.de>
820 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
822 * tree.h (cp_walk_tree): New define to walk_tree_1 with
823 cp_walk_subtrees lh parameter.
824 (cp_walk_tree_without_duplicates): New define to
825 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
826 * tree.c (count_trees): Call
827 cp_walk_tree_without_duplicates.
828 (verify_stmt_tree): Call cp_walk_tree.
829 (break_out_target_exprs): Likewise.
830 (WALK_SUBTREE): Likewise.
831 * cp-gimplify.c (cp_genericize): Likewise.
832 * cp-pt.c (find_parameter_packs_r): Likewise.
833 (uses_parameter_packs): Likewise.
834 (make_pack_expansion): Likewise.
835 (check_for_bare_parameter_packs): Likewise.
836 (for_each_template_parm): Likewise.
837 * decl.c (check_default_argument): Call
838 cp_walk_tree_without_duplicates.
839 * except.c (build_throw): Likewise.
840 * decl2.c (type_visibility): Likewise.
841 * semantics.c (expand_or_defer_fn): Likewise.
842 (finalize_nrv): Call cp_walk_tree.
844 2007-08-20 Jakub Jelinek <jakub@redhat.com>
847 * init.c (build_new_1): Rename placement_var variable to placement_expr.
848 Initialize it with save_expr rather than get_temp_regvar.
850 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
853 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
856 2007-08-17 Ollie Wild <aaw@google.com>
859 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
860 declarations into appropriate slots for comparison. Fix type
863 2007-08-17 Paolo Carlini <pcarlini@suse.de>
866 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
867 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
869 2007-08-17 Paolo Carlini <pcarlini@suse.de>
872 * parser.c (cp_parser_class_head): Improve error message.
874 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
876 * pt.c (instantiate_decl): Set input_location
877 for the function end.
879 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
881 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
883 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
884 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
885 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
886 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
887 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
888 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
889 * typeck.c (cp_type_quals): Likewise.
890 * typeck2.c (cxx_incomplete_type_diagnostic,
891 cxx_incomplete_type_error): Likewise.
893 2007-08-16 Paolo Carlini <pcarlini@suse.de>
896 * pt.c (tsubst_friend_function): When check_classfn
897 returns error_mark_node likewise return it.
899 2007-08-15 Jakub Jelinek <jakub@redhat.com>
902 * typeck.c (check_return_expr): Don't NRV optimize vars in
904 * decl.c (finish_function): Comment fix.
906 2007-08-15 Paolo Carlini <pcarlini@suse.de>
909 * pt.c (push_template_decl_real): Depending on TYPE_P
910 use either TYPE_CONTEXT or DECL_CONTEXT.
912 2007-08-14 Mark Mitchell <mark@codesourcery.com>
914 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
915 constructors and destructors return this.
917 2007-08-14 Paolo Carlini <pcarlini@suse.de>
920 * decl2.c (check_classfn): Return error_mark_node in case of error;
921 in that case, do not call add_method.
922 * decl.c (start_decl): Deal with check_classfn returning
924 (grokfndecl): Likewise.
925 * pt.c (tsubst_friend_function): Likewise.
927 2007-08-14 Andrew Pinski <pinskia@gmail.com>
930 * typeck.c (build_binary_op): Disallow vector float types with
931 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
933 2007-08-11 Ian Lance Taylor <iant@google.com>
935 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
937 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
939 2007-08-10 Ollie Wild <aaw@google.com>
941 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
943 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
945 (unqualified_namespace_lookup): Fix ambiguous_decl call.
946 (lookup_using_namespace): Fix ambiguous_decl call.
947 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
949 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
951 * call.c (name_as_c_string): Use CONST_CAST.
952 * decl.c (build_decl): Likewise.
953 * parser.c (cp_parser_string_literal): Likewise.
955 2007-08-10 Paolo Carlini <pcarlini@suse.de>
958 * error.c (dump_expr): Consistently use the *_cxx_*
959 variants of the pretty-print functions.
961 2007-08-10 Paolo Carlini <pcarlini@suse.de>
964 * decl.c (check_special_function_return_type): Just error
965 on return type specified for conversion operator.
967 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
969 * typeck2.c (readonly_error): Handle general expressions.
970 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
972 2007-08-06 Dan Hipschman <dsh@google.com>
974 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
975 access function name.
977 2007-08-04 Alfred Minarik <a.minarik@aon.at>
980 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
981 * g++spec.c (lang_specific_driver): Check them.
983 2007-08-06 Paolo Carlini <pcarlini@suse.de>
986 * pt.c (inline_needs_template_parms): Fix comment; change return type
989 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
992 2007-03-26 Dirk Mueller <dmueller@suse.de>
994 * parser.c (cp_parser_member_declaration): Pedwarn
995 about stray semicolons after member declarations.
997 2007-08-02 Lee Millward <lee.millward@gmail.com>
1002 * parser.c (cp_parser_asm_definition): Detect and discard asm
1003 statements with invalid inputs or outputs.
1004 (cp_parser_asm_operand_list): Return error mark node if any
1005 of the operands are invalid. Adjust documentation.
1007 2007-08-02 Nick Clifton <nickc@redhat.com>
1009 * typeck.c: Change copyright header to refer to version 3 of the
1010 GNU General Public License and to point readers at the COPYING3
1011 file and the FSF's license web page.
1012 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1013 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1014 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1015 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1016 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1017 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1018 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1019 name-lookup.h, parser.c: Likewise.
1021 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1024 * call.c (magic_varargs_p): Honor the "type generic" attribute.
1026 2007-07-30 Paolo Carlini <pcarlini@suse.de>
1029 * semantics.c (finish_label_stmt): Reject the __label__
1030 extension outside function scopes.
1032 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1034 * parser.c (eof_token): Un-constify.
1035 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1036 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1039 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
1041 * pt.c, tree.c, typeck2.c: Fix comment typos.
1043 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
1044 Mark Mitchell <mark@codesourcery.com>
1047 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1048 hidden due to friend declarations in local classes.
1050 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
1052 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1053 * cp-tree.def (DECLTYPE_TYPE): New.
1054 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1055 (dump_type_prefix): Ditto.
1056 (dump_type_suffix): Ditto.
1057 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1058 * mangle.c (write_type): Handle DECLTYPE_TYPE.
1059 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1061 (DECLTYPE_TYPE_EXPR): New.
1062 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1063 (finish_declared_type): Declare.
1064 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1065 DECLTYPE_TYPE nodes.
1066 (pp_cxx_type_id): Ditto.
1067 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1068 (tsubst): Substitute into a DECLTYPE_TYPE node.
1069 (tsubst_copy): Ditto.
1070 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1072 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1073 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1074 structural equality (because we can't hash the expressions).
1075 (finish_declared_type): New.
1076 * lex.c (reswords): Add "decltype" keyword.
1077 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1078 (cp_parser_postfix_expression): Add member_access_only_p to
1079 restrict postfix expression to member access expressions.
1080 (cp_parser_unary_expression): Update call to
1081 cp_parser_postfix_expression to reflect new parameter.
1082 (cp_parser_declared_type): New.
1083 (cp_parser_simple_type_specifier): Parse decltype types.
1085 2007-07-27 Mark Mitchell <mark@codesourcery.com>
1088 * call.c (convert_for_arg_passing): Only widen bitfields to their
1089 declared types if necessary.
1091 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1093 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1096 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1098 * decl.c (typename_hash, typename_compare): Constify.
1099 * mangle.c (hash_type, compare_type): Likewise.
1100 * pt.c (eq_local_specializations, hash_local_specialization):
1102 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1103 list_hash): Likewise.
1104 * typeck2.c (pat_compare): Likewise.
1106 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
1108 * method.c (implicitly_declare_fn): Increase alignment if member
1109 function pointer format requires it.
1111 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1114 * typeck.c (check_return_expr): Do not pass a null argument
1117 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1120 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1123 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1126 * typeck.c (convert_arguments): Only use default args if we have
1130 * typeck.c (structural_comptypes): No need to check
1131 resolve_typename_type return value here.
1132 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1133 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1134 original type rather than error_mark_node in case of failure.
1135 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1136 resolve_typename_type result check.
1137 (cp_parser_direct_declarator, cp_parser_head,
1138 cp_parser_constructor_declarator_p): Likewise.
1140 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1142 * pt.c (template_parms_variadic_p): Remove.
1143 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1145 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1148 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1149 argument to dump_aggr_init_expr_args instead of false.
1151 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1153 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1154 canonical types; otherwise, fall back to structural type
1155 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1156 internal compiler error if the canonical types are wrong.
1158 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1161 * parser.c (cp_parser_make_indirect_declarator): When the
1162 the code argument is ERROR_MARK return cp_error_declarator.
1164 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1167 * decl.c (cxx_init_decl_processing): Don't set
1168 force_align_functions_log.
1169 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1170 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1171 FUNCTION_DECL, return its alignment.
1173 2007-07-09 Richard Guenther <rguenther@suse.de>
1175 * decl.c (start_preparsed_function): Do not promote return type.
1177 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1180 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1182 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1185 * pt.c (resolve_overloaded_unification): Robustify. Return a
1187 (type_unification_real): Adjust accordingly.
1189 2007-07-06 Richard Guenther <rguenther@suse.de>
1191 * init.c (build_new_1): Use the correct pointer type.
1192 * typeck2.c (build_m_component_ref): Likewise.
1194 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1197 * init.c (build_zero_init): Always build an initializer for
1199 * typeck2.c (build_functional_cast): Use build_zero_init.
1202 * init.c (build_new_1): Always pass the allocation function to
1203 build_op_delete_call.
1204 * call.c (build_op_delete_call): Handle operator delete with a
1205 variable-argument list. Do not issue an error when no matching
1206 deallocation function is available for a new operator.
1209 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1210 * decl.c (value_dependent_init_p): New function.
1211 (cp_finish_decl): Use it.
1212 * pt.c (value_dependent_expression_p): Use
1213 any_value_dependent_elements_p.
1214 * parser.c (cp_parser_primary_expression): Add comment about
1215 treating dependent qualified names as integral
1216 constant-expressions.
1218 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1220 * decl.c (build_ptrmemfunc_type): Always use structural equality
1221 tests when comparing pointer-to-member-function types, because the
1222 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1225 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1227 * init.c (build_new): Tweak comment.
1229 2007-06-29 Dave Brolley <brolley@redhat.com>
1232 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1233 type to its base type and number of elements here.
1234 * init.c (build_new): Call complete_type_or_else to ensure that the
1235 type is complete and to issue a diagnostic if it is not.
1236 (build_new_1): Don't call complete_type_or_else here.
1238 2007-07-03 Richard Guenther <rguenther@suse.de>
1241 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1244 2007-07-02 Simon Baldwin <simonb@google.com>
1246 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1247 for inner-style nested forward declarations that don't declare
1250 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1253 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1254 DECL_P in not a variable and appears more than once error messages.
1256 2007-07-01 Ollie Wild <aaw@google.com>
1258 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1259 (select_decl): Remove function.
1260 (unqualified_namespace_lookup): Populate binding by calling
1261 ambiguous_decl. Remove select_decl call.
1262 (lookup_qualified_name): Remove select_decl call.
1263 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1264 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1265 generation when name lookup is ambiguous.
1267 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1270 * init.c (build_new_1): Use structural equality on the copy of the
1273 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1275 * decl2.c (determine_visibility): Implement
1276 flag_visibility_ms_compat effect on type info.
1277 * decl.c (cxx_init_decl_processing): Implement
1278 global effect of flag_visibility_ms_compat.
1280 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1282 * decl2.c (start_objects): Mark constructor-running function
1285 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1288 * decl.c (grokdeclarator): Reset friendp for member functions declared
1289 friend of their own class.
1291 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1293 * decl2.c (determine_visibility): Don't look for dllexport here.
1294 (determine_visibility_from_class): Tidy.
1296 2007-06-18 Simon Baldwin <simonb@google.com>
1299 * parser.c (cp_parser_single_declaration): Added check for storage
1300 class other than sc_none in parsed declaration, and a flag to indicate
1301 if the call is part of an explicit template specialization parse.
1302 * (cp_parser_explicit_specialization): Specialization check flag added
1303 to call to cp_parser_single_declaration(), set true.
1304 * (cp_parser_template_declaration_after_export): Specialization check
1305 flag added to call to cp_parser_single_declaration(), set false.
1306 * pt.c (check_explicit_specialization): Added code to copy visiblity
1307 and linkage from the templated function to the explicit specialization.
1309 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1311 * typeck.c (build_binary_op): For templates build the
1312 expression in pieces to avoid the assert in build2_stat.
1313 (get_member_function_from_ptrfunc):
1314 Change over to using POINTER_PLUS_EXPR and convert
1315 the second operand to sizetype.
1316 * typeck2.c (build_m_component_ref): Likewise.
1317 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1318 instead of PLUS_EXPR for pointers.
1319 (build_new_1): Likewise.
1320 (build_vec_delete_1): Likewise.
1321 (build_vec_delete): Likewise.
1322 * class.c (build_base_path): Likewise.
1323 (build_base_path): Likewise.
1324 (convert_to_base_statically): Likewise.
1325 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1326 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1327 instead of PLUS_EXPR.
1328 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1329 instead of PLUS_EXPR for pointers.
1330 * call.c (build_special_member_call): Likewise.
1331 * rtti.c (build_headof): Likewise.
1332 Use sizetype instead of ptrdiff_type_node.
1333 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1334 instead of PLUS_EXPR for pointers.
1335 * except.c (expand_start_catch_block): Do a
1336 NEGATIVE and then a POINTER_PLUS_EXPR instead
1338 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1339 PLUS_EXPR on pointer types over to use
1340 POINTER_PLUS_EXPR and remove the conversion
1341 to the pointer types.
1342 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1343 adding to a pointer type. Use size_int instead of
1344 ssize_int. Convert the index to sizetype before
1345 adding it to the pointer.
1347 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1349 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1350 (DECL_ANON_UNION_VAR_P): New macro.
1351 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1352 than DECL_VAR_MARKED_P, to keep track of which variables we have
1354 * decl.c (redeclaration_error_message): Complain about redeclaring
1355 anonymous union members at namespace scope.
1356 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1358 2007-06-14 Geoff Keating <geoffk@apple.com>
1360 * decl2.c (determine_visibility): Ensure that functions with
1361 hidden types as parameters are hidden.
1364 * decl2.c (determine_visibility): Remove duplicate code for
1367 2007-06-12 Ian Lance Taylor <iant@google.com>
1370 * init.c (avoid_placement_new_aliasing): New static function.
1371 (build_new_1): Call it.
1373 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1375 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1376 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1378 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1381 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1382 on init, the non-decl cond operand and increment value.
1384 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1387 * decl.c (check_initializer): Report an error when a brace enclosed
1388 initializer is used for a non-aggregate type in C++98.
1389 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1391 (grokdeclarator): Likewise.
1392 (move_fn_p): Likewise.
1393 * typeck.c (check_return_expr): Likewise.
1394 * call.c (reference_binding): Likewise.
1395 * error.c (cp_cpp_error): Likewise.
1396 * pt.c (check_default_tmpl_args): Likewise.
1398 * lex.c (init_reswords): Likewise.
1399 * parser.c (p_parser_primary_expression): Likewise.
1400 (TOKEN_PRECEDENCE): Likewise.
1401 (cp_parser_init_declarator): Likewise.
1402 (cp_parser_ptr_operator): Likewise.
1403 (cp_parser_parameter_declaration): Likewise.
1404 (cp_parser_enclosed_template_argument_list): Likewise.
1405 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1406 (cp_parser_next_token_ends_template_argument_p): Likewise.
1408 2007-06-04 Simon Baldwin <simonb@google.com>
1410 * decl.c (grokdeclarator): Readability change. Moved case labels
1411 into direct switch statement scope.
1413 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1415 * call.c (convert_like_real): Remove pointless code.
1417 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1419 * decl.c (get_atexit_fn_ptr_type): New function.
1420 (get_atexit_node): Use it.
1421 (start_cleanup_fn): Likewise.
1422 (register_dtor_fn): Use the object's destructor, instead of a
1423 separate cleanup function, where possible.
1424 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1425 (atexit_fn_ptr_type_node): New macro.
1426 * decl2.c (build_cleanup): Use build_address.
1428 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1430 * typeck.c (build_binary_op): Include types in error.
1432 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1435 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1436 needs runtime initialization.
1438 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1441 * semantics.c (finish_trait_expr): Complete the types.
1443 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1444 Douglas Gregor <doug.gregor@gmail.com>
1445 Pedro Lamarao <pedro.lamarao@mndfck.org>
1446 Howard Hinnant <howard.hinnant@gmail.com>
1450 * typeck.c (comptypes): Don't consider rvalue and lvalue
1451 reference types to be equivalent.
1452 (check_return_expr): Move from certain lvalues when returning
1454 * decl.c (grokdeclarator): Implement reference collapsing.
1455 (copy_fn_p): Don't consider constructors taking rvalue references
1456 to be copy constructors.
1458 * call.c (conversion): New "rvaluedness_matches_p" member.
1459 (convert_class_to_reference): Require reference type as first
1460 parameter instead of base type.
1461 (reference_binding): Add logic to handle rvalue references.
1462 (implicit_conversion): Update inaccurate comment.
1463 (convert_like_real): Disable creation of temporaries that are
1464 impossible to initialize for types with move constructors.
1465 (build_over_call): Elide move constructors when possible.
1466 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1467 (maybe_handle_ref_bind): Return conversion instead of type node.
1468 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1469 determine preferred conversion sequences.
1470 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1471 (LOOKUP_PREFER_RVALUE): New.
1472 (DECL_MOVE_CONSTRUCTOR_P): New.
1473 (struct cp_declarator): Add "reference" member for reference
1474 types, with new "rvalue_ref" flag.
1475 (cp_build_reference_type): Declare.
1476 (move_fn_p): Declare.
1477 * error.c (dump_type_prefix): Format rvalue reference types
1478 correctly in error messages.
1479 * except.c (build_throw): Move from certain lvalues when
1481 * mangle.c (write_type): Mangle rvalue references differently
1482 than regular references.
1483 * parser.c (make_reference_declarator): Add boolean parameter for
1485 (cp_parser_make_indirect_declarator): New.
1486 (cp_parser_new_declarator_opt): Call
1487 cp_parser_make_indirect_declarator.
1488 (cp_parser_conversion_declarator_opt): Ditto.
1489 (cp_parser_declarator): Ditto.
1490 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1492 * pt.c (tsubst): Implement reference collapsing.
1493 (maybe_adjust_types_for_deduction): Implement special template
1494 parameter deduction rule for rvalue references.
1495 (type_unification_real): Update calls to
1496 maybe_adjust_types_for_deduction.
1497 (try_one_overload): Ditto.
1498 (unify_pack_expansion): Ditto.
1499 * tree.c (lvalue_p_1): Handle rvalue reference types.
1500 (cp_build_reference_type): New.
1502 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1505 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1506 variables that need runtime initialization.
1508 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1511 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1512 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1513 case POSTDECREMENT_EXPR>): Return the error_mark_node
1514 if either the real or imaginary parts would an
1517 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1518 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1521 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1522 token is a closing brace, false if there are no tokens left.
1523 (cp_parser_namespace_alias_definition): Only consume the next token if
1524 it is a closing brace.
1526 * parser.c (cp_parser_class_specifier): Likewise.
1528 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1530 * semantics.c (finish_member_declaration): Fix a typo in the
1533 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1545 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1546 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1547 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1548 whether everything was okay. Fix indentation.
1549 (push_template_decl_real): Check for bare parameter packs in
1550 function parameters; where errors occur, mark the parameter types
1551 with ERROR_MARK_NODEs to avert ICEs.
1552 (coerce_template_parameter_pack): New.
1553 (coerce_template_parms): Moved parameter pack coercion into
1554 coerce_template_parameter_pack, and permit it anywhere in the
1555 template parameter list (not just at the end). Parameter and
1556 argument indices can vary (somewhat) separately now, so add
1557 PARM_IDX and ARG_IDX.
1558 (fn_type_unification): Don't set an argument pack as incomplete if
1559 no argument pack was deduced.
1560 (type_unification_real): If a type parameter is a parameter pack
1561 and has not otherwise been deduced, it will be deduced to an empty
1563 (more_specialized_fn): Use the actual lengths of the argument
1564 lists when comparing against expansions.
1565 * semantics.c (finish_member_declaration): If a field's type has
1566 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1568 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1571 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1573 2007-05-22 Ollie Wild <aaw@google.com>
1575 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1576 (unqualified_namespace_lookup): Adds check for hidden types.
1578 2007-05-22 Ollie Wild <aaw@google.com>
1580 * decl.c (duplicate_decls): Verify namespace names are unique.
1582 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1584 * decl.c (cxx_maybe_build_cleanup): Handle
1585 __attribute__((cleanup)).
1587 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1589 * cvt.c (cp_convert_and_check): Don't check warnings if the
1592 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1594 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1596 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1599 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1600 type only if is a class type (5.2.8/4).
1602 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1604 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1605 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1606 c_common_unsigned_type.
1608 2007-05-11 Silvius Rus <rus@google.com>
1610 * cp/typeck.c (build_indirect_ref): Add call to
1611 strict_aliasing_warning.
1612 (build_reinterpret_cast_1): Condition call to
1613 strict_aliasing_warning.
1615 2007-05-11 Jan Hubicka <jh@suse.cz>
1617 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1618 * decl2.c (start_objects): ctors and dtors are no longer public.
1619 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1621 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1623 * typeck.c (build_unary_op): Remove code that used to
1624 handle non lvalue increments/decrements.
1626 2007-05-07 Mike Stump <mrs@apple.com>
1628 * parser.c (check_empty_body): Add.
1629 (cp_parser_iteration_statement): Add call to check_empty_body.
1631 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1634 * mangle.c (write_mangled_name): Mangle static variable names.
1635 (write_unqualified_name): Use local-source-name for
1636 namespace-scope static variables.
1638 2007-05-04 Dirk Mueller <dmueller@suse.de>
1640 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1643 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1646 * decl2.c (constrain_class_visibility):
1647 Use strip_pointer_or_array_types instead of strip_array_types.
1649 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1652 * decl.c (reshape_init_r): Don't reshape the first element if it
1653 is a pointer to member function.
1655 2007-04-27 Simon Baldwin <simonb@google.com>
1657 * decl.c (grokparms): Changed message format from %qD to %qE.
1659 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1661 * error.c (maybe_warn_variadic_templates): Variadic templates are
1662 now in C++0x, so only warn about them in C++98 mode.
1664 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1667 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1668 integeral types from vectors types.
1670 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1673 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1674 for type dependent OMP_CLAUSE_DECLs.
1676 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1679 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1680 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1681 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1682 * init.c (build_zero_init): Adjust, as
1683 COMPLEX_TYPE is now a SCALAR_TYPE.
1684 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1685 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1687 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1689 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1690 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1691 (trait_expr_value): Adjust.
1693 2007-04-23 Simon Baldwin <simonb@google.com>
1695 * decl.c (grokparms): Added new error for duplicate function
1696 parameters names in function prototypes, to match gcc behavior.
1698 2007-04-23 Jan Hubicka <jh@suse.cz>
1700 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1703 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1705 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1706 instead of checking GIMPLE_STMT_P in chain_next.
1708 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1711 * call.c (convert_for_arg_passing): Convert bitfields to their
1714 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1717 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1719 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1722 * cp/decl2.c (constrain_class_visibility):
1723 Do not warn about the use of anonymous namespace in the main input file.
1725 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1727 * cp-tree.h (current_template_parms): Fix typo in comment.
1729 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1731 * cp-tree.h, error.c: Fix comment typos.
1733 2007-04-13 Jason Merrill <jason@redhat.com>
1736 * call.c (reference_binding): Add c_cast_p parm. If true,
1737 add quals to TO as needed to make it reference-compatible.
1739 2007-04-11 Jan Hubicka <jh@suse.cz>
1741 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1742 that we are not processing template_decl.
1744 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1747 * class.c (build_base_path): Ensure that the converted pointer has
1748 the same cv-qualification as the input.
1750 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1752 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1754 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1756 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1758 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1759 * tree.c (cp_add_pending_fn_decls): Remove.
1760 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1762 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1764 Revert change removing staticp.
1766 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1768 * cp-objcp-common.c (cxx_staticp): Remove.
1769 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1770 * cp-tree.h (cxx_staticp):
1772 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1774 * class.c (check_for_override): Don't remove dllmport attribute
1777 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1780 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1781 type issue error and return early.
1783 2007-03-30 Jason Merrill <jason@redhat.com>
1786 * typeck.c (cp_type_readonly): New fn.
1787 * cp-tree.h: Declare it.
1788 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1789 (cp_finish_decl): Not here.
1791 2007-03-31 Richard Guenther <rguenther@suse.de>
1793 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1796 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1801 * parser.c (declarator_can_be_parameter_pack): New.
1802 (cp_parser_template_parameter): Only parse the `...' if the
1803 declarator can be a parameter pack.
1804 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1806 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1807 types (they could be used as array bounds).
1808 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1809 (tsubst_pack_expansion): Handle failure to expand parameter
1812 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1815 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1816 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1817 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1818 (CLASS_TYPE_NON_UNION_P): Add.
1819 (struct lang_type_class): Add has_complex_dflt.
1820 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1821 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1822 * cp-tree.def: Add TRAIT_EXPR.
1823 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1824 * lex.c (struct resword): Add __has_nothrow_assign,
1825 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1826 __has_trivial_constructor, __has_trivial_copy,
1827 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1828 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1829 __is_pod, __is_polymorphic, __is_union.
1830 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1831 (cp_parser_trait_expr): New.
1832 * semantics.c (finish_trait_expr, trait_expr_value
1833 classtype_has_nothrow_copy_or_assign_p): New.
1834 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1836 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1837 * class.c (check_bases, check_field_decl, check_bases_and_members):
1838 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1839 * pt.c (uses_template_parms, tsubst_copy_and_build,
1840 value_dependent_expression_p, type_dependent_expression_p): Deal with
1842 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1844 2007-03-29 Richard Guenther <rguenther@suse.de>
1846 * tree.c (cp_walk_subtrees): Do not set input_location.
1848 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1851 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1854 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1856 * parser.c (struct cp_parser): Update comment for
1857 greater_than_is_operator_p.
1858 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1859 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1860 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1861 !GREATER_THAN_IS_OPERATOR_P.
1862 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1863 `>>' operators that will become two `>' tokens in C++0x.
1864 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1865 mode, allowing it to terminate default arguments.
1866 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1867 `>>' like two consecutive `>' tokens.
1868 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1869 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1870 ends a template argument.
1872 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1874 * decl.c (redeclaration_error_message): Complain when redeclaring
1875 a friend function with default template arguments (C++0x mode only).
1876 * cp-tree.h (check_default_tmpl_args): Declare.
1877 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1878 template arguments in function templates. Add support for checking
1879 the default template arguments of friend templates.
1880 (push_template_decl_real): Fix call to check_default_tmpl_args.
1881 (type_unification_real): If a template parameter has not been
1882 deduced but provides a default template argument, substitute into
1883 that default template argument.
1884 * parser.c (cp_parser_init_declarator): When declaring (but not
1885 defining!) a function template in C++0x mode, check for default
1888 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1891 * decl.c (grokdeclarator): Deal with cv-qualified function type
1892 typedefs in the same way for member and non-member functions.
1894 2007-03-26 Dirk Mueller <dmueller@suse.de>
1896 * parser.c (cp_parser_member_declaration): Pedwarn
1897 about stray semicolons after member declarations.
1899 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1902 * pt.c (instantiate_decl): Set in_system_header.
1904 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1906 * cp-tree.h (current_tempalte_parms): Improve documentation.
1907 * pt.c (current_template_args): Likewise.
1910 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1911 not consume tokens when failing.
1913 2007-03-22 Jim Wilson <wilson@specifix.com>
1914 Mark Mitchell <mark@codesourcery.com>
1917 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1918 consistent with FROM.
1920 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1922 * error.c (dump_expr): Handle dependent names that designate types.
1923 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1925 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1927 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1929 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1931 * cvt.c (cp_convert_and_check) : Define.
1932 * cp-tree.h (cp_convert_and_check): Declare.
1933 * call.c (convert_conversion_warnings): Rename to
1934 conversion_null_warnings. The warning for floating-point to
1935 integer is handled by convert_and_check in convert_like_real.
1936 (convert_like_real): convert_conversion_warnings was renamed as
1937 conversion_null_warnings.
1938 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1939 overflow and changes of value during conversion.
1941 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1944 * parser.c (cp_parser_statement): If 'namespace' is found, this
1945 only can be a namespace alias definition, so parse it now.
1946 (cp_parser_namespace_alias_definition): if we find an open brace
1947 instead of '=', then this is actually a misplaced namespace
1950 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1953 * decl.c (cxx_init_decl_processing): Move command-line options
1954 processing to c-opts.c.
1956 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1958 * ptree.c (cxx_print_type): Use formatting markup for integers
1959 when printing template parameter index/level/orig level.
1960 (cxx_print_xnode): Ditto.
1961 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1962 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1963 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1965 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1966 rather than a HOST_WIDE_INT.
1967 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1968 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1970 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1971 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1972 IN_BASE_INITIALIZER bool bitfields.
1973 (struct cp_declarator): Make KIND a 4-bit field. Make
1974 PARAMETER_PACK_P a bool bitfield just after KIND.
1975 * pt.c (uses_parameter_packs): Destroy the pointer set.
1976 (make_pack_expansion): Ditto.
1977 (check_for_bare_parameter_packs): Ditto.
1978 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1980 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1983 * call.c (convert_default_arg): Instead of copying the node,
1986 2007-03-15 Dirk Mueller <dmueller@suse.de>
1989 * call.c (convert_conversion_warnings): New..
1990 (convert_like_real): .. factored out from here.
1991 (convert_conversion_warnings): Add warning about
1992 false being converted to NULL in argument passing.
1994 2007-03-14 Dirk Mueller <dmueller@suse.de>
1996 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1997 (finish_do_body): Warn about empty body in do/while statement.
1999 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2001 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2003 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2006 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2009 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
2011 * cp/repo.c (init_repo): Initialize random_seed saved options.
2012 (finish_repo): Adjust.
2014 2007-03-13 Mark Mitchell <mark@codesourcery.com>
2017 * Make-lang.in (doc/g++.1): Use $< to specify the location from
2020 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
2022 * decl.c (compute_array_index_type): New warning flag warn_vla.
2024 2007-03-12 Mark Mitchell <mark@codesourcery.com>
2027 * call.c (convert_default_arg): Copy non-constant arguments.
2029 2007-03-11 Mark Mitchell <mark@codesourcery.com>
2032 * parser.c (cp_parser_postfix_expression): Disallow compound
2033 literals in constant expressions.
2036 * semantics.c (finish_typeof): Use unlowered_expr_type.
2038 2007-03-10 Mark Mitchell <mark@codesourcery.com>
2041 * cp-tree.h (unlowered_expr_type): New function.
2042 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2043 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2044 (unlowered_expr_type): New function.
2045 (build_unary_op): Disallow predecrements of bool bitfields.
2046 * call.c (build_conditional_expr): Use unlowered_expr_type.
2047 * pt.c (type_unification_real): Likewise.
2049 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
2052 * typeck.c (check_return_expr): Check for bare parameter packs.
2053 (comptypes): Compare template parameter packs and
2054 type pack expansions.
2055 * decl.c (grokdeclarator): Deal with the declaration of function
2057 (grokparms): Verify that the (optional) function parameter pack is
2058 at the end of the parameter list.
2059 (xref_basetypes): Handle pack expansions in the base class.
2060 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2061 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2062 (NONTYPE_ARGUMENT_PACK): New.
2063 (TYPE_PACK_EXPANSION): New.
2064 (EXPR_PACK_EXPANSION): New.
2065 (ARGUMENT_PACK_SELECT): New.
2066 * cp-objcp-common.c (cp_tree_size): Compute size of
2067 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2068 ARGUMENT_PACK_SELECT.
2069 * error.c (dump_template_argument): Print template argument packs.
2070 (dump_template_argument_list): Ditto.
2071 (dump_template_parameter): Dump `...' for template type parameter
2073 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2074 (dump_parameters): Print function parameter packs.
2075 (dump_template_parms): Print template argument packs.
2076 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2077 (maybe_warn_variadic_templates): New.
2078 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2079 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2080 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2082 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2083 (write_template_arg): Write argument packs as separate arguments.
2084 * cp-tree.h (struct template_parm_index_s): Add flag that
2085 indicates that the template parameter is actually a parameter
2087 (struct tree_argument_pack_select): New.
2088 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2089 (union lang_tree_node): Add argument_pack_select.
2090 (FUNCTION_PARAMETER_PACK_P): New.
2091 (PACK_EXPANSION_P): New.
2092 (PACK_EXPANSION_PATTERN): New.
2093 (SET_PACK_EXPANSION_PATTERN): New.
2094 (PACK_EXPANSION_PARAMETER_PACKS): New.
2095 (ARGUMENT_PACK_P): New.
2096 (ARGUMENT_PACK_ARGS): New.
2097 (SET_ARGUMENT_PACK_ARGS): New.
2098 (ARGUMENT_PACK_INCOMPLETE_P): New.
2099 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2100 (TEMPLATE_PARM_PARAMETER_PACK): New.
2101 (TEMPLATE_TYPE_PARAMETER_PACK): New.
2102 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2103 (ARGUMENT_PACK_SELECT_INDEX): New.
2104 (ARGUMENT_PACK_SELECT_ARG): New.
2105 (struct cp_declarator): Add parameter_pack_p flag.
2106 (maybe_warn_variadic_templates): Declare.
2107 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2108 indicate a template parameter pack.
2109 (uses_parameter_packs): Declare.
2110 (template_parameter_pack_p): Declare.
2111 (template_parms_variadic_p): Declare.
2112 (make_pack_expansion): Declare.
2113 (check_for_bare_parameter_packs): Declare.
2114 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2115 sizeof... expressions.
2116 (pp_cxx_expression): Print pack expansions and non-type argument
2118 (pp_cxx_exception_specification): Print pack expansions.
2119 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2120 (pp_cxx_ctor_initializer): Print pack expansions.
2121 (pp_cxx_type_id): Print pack expansions.
2122 (pp_cxx_template_argument_list): Print argument packs.
2123 (pp_cxx_template_parameter): Print ellipsis for template parameter
2125 * pt.c (comp_template_parms): Compare template parameter packs.
2126 (template_parameter_pack_p): New.
2127 (template_parms_variadic_p): New.
2128 (template_args_variadic_p): New.
2129 (make_ith_pack_parameter_name): New.
2130 (struct find_parameter_pack_data): New.
2131 (find_parameter_packs_r): New.
2132 (uses_parameter_packs): New.
2133 (make_pack_expansion): New.
2134 (check_for_bare_parameter_packs): New.
2135 (expand_template_argument_pack): New.
2136 (reduce_template_parm_level): Propagate parameter pack flag.
2137 (process_template_parm): Add is_parameter_pack parameter to state
2138 when the parameter is actually a parameter pack. Create template
2139 parameter packs when is_parameter_pack is true.
2140 (current_template_args): The argument for a template parameter
2141 pack is an argument pack containing a single pack expansion.
2142 (process_partial_specialization): When checking that non-type
2143 argument expressions do not involve template parameters, loop over
2144 the arguments in argument packs separately.
2145 (push_template_decl_real): Check that the type of the declaration
2146 does not have any bare parameter packs. Check that primary
2147 templates have no more than one parameter pack, and that it comes
2148 at the end of the template parameter list.
2149 (convert_template_argument): Handle coercions for pack expansion
2150 expressions by coercing the pattern then rebuilding the expansion.
2151 (coerce_template_parms): When coercing the arguments for a
2152 variadic template, pack "extra" arguments into an argument pack.
2153 (coerce_template_template_parms): Cannot coerce between parameter
2154 packs and non-pack parameters.
2155 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2156 (comp_template_args): Expand all template arguments packs before
2157 comparing template argument lists.
2158 (mangle_class_name_for_template): Make argument packs as separate
2160 (for_each_template_parm_r): No need to handle BASELINK.
2161 (instantiate_class_template): Handle pack expansions in the base
2163 (tsubst_pack_expansion): New.
2164 (tsubst_template_args): Handle substitutions of argument packs and
2165 pack expansion into template argument lists.
2166 (tsubst_decl): Expand function parameter packs into separate
2167 function parameters.
2168 (tsubst_arg_types): Expand a type pack expansion into separate
2170 (tsubst_exception_specification): Handle pack expansions in
2171 exception specifiers.
2172 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2173 replacing a template parameter with its argument. If we encounter
2174 a substitution for an argument pack, just return the parameter
2176 (tsubst_copy): sizeof(X...) returns the number of elements in
2177 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2178 PARM_DECL is a parameter pack.
2179 (tsubst_expr): Expression pack expansions and argument packs
2180 cannot show up here; they will all be handled through function
2181 calls, sizeof, and template argument lists.
2182 (tsubst_copy_and_build): sizeof(X...) returns the number of
2183 elements in parameter pack X. Handle pack expansions in TREE_LIST
2184 and CONSTRUCTOR nodes.
2185 (fn_type_unification): Handle "incomplete" explicit template
2186 argument lists that specify some of the arguments for a template
2188 (type_unification_real): Unify arguments against pack expansions.
2189 (template_parm_level_and_index): New, helper function.
2190 (unify_pack_expansion): New.
2191 (unify): Unify argument packs on an argument-by-argument basis,
2192 handling variadic argument packs as well.
2193 (more_specialized_fn): Handle unification of function parameter
2194 packs. All things being equal, prefer non-variadic function
2195 templates to variadic function templates.
2196 (more_specialized_class): Prefer the variadic class template
2197 partial specialization that binds fewer arguments to a parameter
2199 (regenerate_decl_from_template): Expand function parameter packs
2200 into separate parameters.
2201 (instantiate_decl): Ditto.
2202 (tsubst_initializer_list): Handle pack expansions for base-class
2204 (dependent_type_p_r): Determine dependent types in argument packs
2205 and pack expansions.
2206 (value_dependent_expression_p): Determine value-dependence of
2207 non-type argument packs.
2208 (dependent_template_arg_p): Handle argument packs.
2209 * semantics.c (finish_cond): Check for bare parameter packs.
2210 (finish_expr_stmt): Ditto.
2211 (finish_for_expr): Ditto.
2212 (finish_switch_cond): Ditto.
2213 (finish_mem_initializers): Ditto.
2214 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2216 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2217 * parser.c (make_declarator): Declarator is not an expansion.
2218 (make_pointer_declarator): Transfer parameter pack flag to outer
2220 (make_reference_declarator): Ditto.
2221 (make_ptrmem_declarator): Ditto.
2222 (make_call_declarator): Ditto.
2223 (make_array_declarator): Ditto.
2224 (cp_parser_postfix_expression): Allow pack expansion expressions
2225 in the argument list for a call expression.
2226 (cp_parser_parenthesized_expression_list): Add new parameter
2227 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2228 into separate arguments."
2229 (cp_parser_new_placement): Allow pack expansion expressions.
2230 (cp_parser_new_initializer): Ditto.
2231 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2232 base-class initializer expansion.
2233 (cp_parser_mem_initializer): Ditto.
2234 (cp_parser_template_parameter_list): Keep track of whether the
2235 template parameter is a template parameter pack.
2236 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2237 template parameter pack.
2238 (cp_parser_type_parameter): Ditto.
2239 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2241 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2242 this declarator is a parameter pack.
2243 (cp_parser_parameter_declaration): The ellipsis does not end the
2244 parameter declaration, because it might be a parameter pack. Parse
2245 the ellipsis to indicate a parameter pack.
2246 (cp_parser_initializer): Allow pack expansions.
2247 (cp_parser_initializer_list): Allow ellipsis to create an
2248 initializer expansion.
2249 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2251 (cp_parser_type_id_list): Allow ellipsis to create an exception
2252 specifier expansion.
2253 (cp_parser_attribute_list): Don't allow pack expansions.
2254 (cp_parser_functional_cast): Allow pack expansions.
2255 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2256 compute the length of a parameter pack.
2257 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2258 end a template argument.
2259 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2260 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2263 2007-03-09 Dirk Mueller <dmueller@suse.de>
2265 * cp/call.c (build_new_op): Call warn_logical_operator.
2267 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2270 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2273 * pt.c (any_template_arguments_need_structural_equality_p):
2276 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2278 * decl.c (grokdeclarator): Disable warnings for anonymous
2281 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2283 * typeck2.c (readonly_error): Always emit a hard error.
2284 Remove last argument.
2285 * cp-tree.h (readonly_error): Adjust prototype.
2286 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2287 * typeck.c (build_unary_op): Likewise.
2288 (build_modify_expr): Likewise.
2290 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2293 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2295 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2298 * parser.c (struct cp_parser): New IN_IF_STMT.
2299 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2300 returning if parsing the body of an 'if' statement or issuing an
2301 error and continuing.
2302 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2304 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2306 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2309 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2312 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2314 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2315 Objective-C++. Don't exit early if -shared-libgcc needs to be
2318 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2320 * typeck.c (common_base_type): Delete unused function.
2322 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2324 * Make-lang.in: Add dummy lang.install-pdf target.
2326 2007-03-01 Simon Baldwin <simonb@google.com>
2329 * decl.c (check_tag_decl): Added new warning for typedef ignored
2330 when it precedes an otherwise valid non-typedef declaration.
2332 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2334 * typeck.c (build_function_call): Store converted arguments
2335 in a stack-allocated array instead of building a list.
2336 (convert_arguments): Store arguments in the array passed in as an
2337 argument, and return the actual number of arguments.
2338 * call.c (build_call): Delete, and replace with...
2339 (build_call_n, build_call_a): New.
2340 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2341 (build_over_call): Store converted arguments in a stack-allocated
2342 array instead of building a list.
2343 (build_cxx_call): Pass arguments in an array instead of as a list.
2344 (build_java_interface_fn_ref): Rewrite to avoid constructing
2346 * tree.h: Update declarations to reflect above changes.
2347 * method.c (use_thunk): Use a stack-allocated array to hold
2348 the arguments instead of a list.
2349 * rtti.c (throw_bad_cast): Update call to cxx_call.
2350 (throw_bad_typeid): Likewise.
2351 (build_dynamic_cast_1): Likewise.
2352 * init.c (build_builtin_delete_call): Use build_call_n.
2353 * decl.c (expand_static_init): Likewise.
2354 * except.c (cp_protect_cleanup_actions): Likewise.
2355 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2356 (gimplify_must_not_throw_expr): Likewise.
2357 (cxx_omp_apply_fn): Use build_call_a.
2359 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2361 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2362 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2364 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2366 * cp-tree.h (static_ctors): Remove.
2367 * cp-tree.h (static_dtors): Likewise.
2368 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2369 refactoring of tree_map hierarchy.
2370 (decl_shadowed_for_var_insert): Likewise.
2371 * semantics.c (expand_body): Use c_expand_body.
2372 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2373 * decl2.c (static_ctors): Remove.
2374 (static_dtors): Likewise.
2375 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2376 objc_generate_static_init_call. Do not call static_[cd]tors.
2377 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2379 (cp_write_global_declarations): Likewise.
2381 2007-02-23 Richard Guenther <rguenther@suse.de>
2383 * class.c (note_name_declared_in_class): Make declaration
2384 changes meaning a pedwarn.
2386 2007-02-22 Michael Matz <matz@suse.de>
2389 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2390 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2391 dump_function_decl): Guard emitting outer scopes by new flag.
2392 * cp-lang.c (cxx_dwarf_name): New function.
2393 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2394 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2396 (push_template_decl_real, lookup_template_class): Remove calls
2399 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2401 * call.c (build_new_method_call): Ensure that explicit calls of
2402 destructors have type "void".
2404 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2406 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2407 and -Walways-true with -Waddress.
2408 * cvt.c (convert_to_void): Replace unconditional warning with
2411 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2413 * decl.c, tree.c: Fix comment typos.
2415 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2418 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2419 statement expression if we had an error mark node.
2421 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2422 Brooks Moses <brooks.moses@codesourcery.com>
2423 Lee Millward <lee.millward@codesourcery.com>
2425 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2426 Change class to tcc_vl_exp.
2428 * call.c (build_call): Use build_call_list instead
2430 (build_over_call): Likewise.
2431 (build_new_method_call): Use build_min_non_dep_call_list
2432 instead of build_min_non_dep.
2434 * error.c (dump_call_expr_args): New function.
2435 (dump_aggr_init_expr_args): New function.
2436 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2437 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2439 * cvt.c (convert_to_void): Use build_call_array instead
2440 of build3; use new AGGR_INIT_EXPR accessor macros.
2442 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2443 instead of TREE_CODE_LENGTH.
2445 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2446 AGGR_INIT_EXPR accessor macros.
2448 * cp-gimplify.c (cp_gimplify_init_expr): Use
2449 AGGR_INIT_EXPR_SLOT to set the slot operand.
2451 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2452 (AGGR_INIT_EXPR_SLOT): New macro.
2453 (AGGR_INIT_EXPR_ARG): New macro.
2454 (aggr_init_expr_nargs): New macro.
2455 (AGGR_INIT_EXPR_ARGP): New macro.
2456 (aggr_init_expr_arg_iterator): New.
2457 (init_aggr_init_expr_arg_iterator): New.
2458 (next_aggr_init_expr_arg): New.
2459 (first_aggr_init_expr_arg): New.
2460 (more_aggr_init_expr_args_p): New.
2461 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2462 (stabilize_aggr_init): New declaration.
2463 (build_min_non_dep_call_list): Likewise.
2465 * tree.c (process_aggr_init_operands): New function.
2466 (build_aggr_init_array) New function.
2467 (build_cplus_new): Update to use new CALL_EXPR and
2468 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2469 build_aggr_init_array.
2470 (build_min_non_dep_call_list) New function.
2471 (build_min_nt): Assert input code parameter is not a variable
2472 length expression class.
2473 (build_min, build_min_non_dep): Likewise.
2474 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2475 to check for equality instead of recursing. Handle tcc_vl_exp
2477 (stabilize_call): Update to only handle CALL_EXPRs, not
2478 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2479 (stabilize_aggr_init): New function.
2480 (stabilize_init): Use it.
2482 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2483 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2484 AGGR_INIT_EXPR accessor macros and argument iterators.
2486 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2487 build_vl_exp. Iterate through the operands, recursively
2488 processing each one.
2489 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2490 CALL_EXPR accessor macros.
2491 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2492 tree code classes. Use TREE_OPERAND_LENGTH instead of
2495 * semantics.c (finish_call_expr): Use build_nt_call_list
2496 instead of build_nt.
2497 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2498 accessor macros. Use build_call_array to construct the
2499 CALL_EXPR node instead of build3
2501 * decl2.c (build_offset_ref_call_from_tree): Use
2502 build_nt_call_list and build_min_non_dep_call_list instead
2503 of build_min_nt and build_min_non_dep.
2505 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2506 Use build_nt_call_list instead of build_min_nt.
2508 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2511 * call.c (build_conditional_expr): Improve error message.
2513 2007-02-13 Dirk Mueller <dmueller@suse.de>
2515 * friend.c (do_friend): Annotate warning about friend
2516 declarations in templates with OPT_Wnon_template_friend.
2517 Convert informal message from warning() to inform().
2519 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2520 Mark Mitchell <mark@codesourcery.com>
2523 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2524 instantiations for variables.
2526 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2529 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2530 Check warn_unused_value just once.
2532 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2535 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2536 (fn_type_unificiation): Likewise.
2537 (get_bindings): Likewise.
2539 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2542 * decl.c (finish_function): Use DECL_REPLACEABLE.
2543 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2545 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2547 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2549 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2551 * decl.c (grokvardecl): Don't error if !have_tls.
2552 (grokdeclarator): Likewise.
2553 * parser.c (cp_parser_omp_threadprivate): Likewise.
2555 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2558 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2559 parameters and result decls in omp clauses.
2560 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2563 2007-02-05 Dirk Mueller <dmueller@suse.de>
2566 * parser.c (cp_parser_class_specifier): Always initialize bases.
2568 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2570 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2571 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2572 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2574 * semantics.c (finish_omp_atomic): Store a whole expression node
2575 in operand 1, and integer_zero_node in operand 0, for dependent
2576 OMP_ATOMIC. Rewrite to make flow easier to understand.
2578 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2580 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2582 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2584 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2585 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2587 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2589 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2590 keyword warning to -Wc++0x-compat.
2592 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2594 * decl.c (grokdeclarator): Update documentation.
2596 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2599 * decl.c (grokdeclarator): If __thread is used together with
2600 a storage class other than extern and static, clear thread_p
2601 after issuing diagnostics and fall through to checking the
2604 2007-01-30 Roger Sayle <roger@eyesopen.com>
2606 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2607 calculating the size of an array (to avoid recursive errors).
2609 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2612 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2614 * call.c (convert_like_real): Don't warn when converting to
2617 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2619 * decl.c (pop_label): Replace warning with call to
2620 warn_for_unused_label.
2622 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2625 * semantics.c (finish_pseudo_destructor_expr): Check the
2626 destrutor name by calling check_dtor_name.
2628 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2630 * lex.c (D_CPP0X): Rename.
2632 (reswords): D_CPP0X -> D_CXX0X.
2633 (init_reswords): Ditto.
2634 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2635 of C++0x keywords as identifiers.
2637 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2640 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2643 2007-01-23 Ian Lance Taylor <iant@google.com>
2645 * typeck.c (convert_for_assignment): Only warn about a = b = c
2646 when converting to bool.
2648 2007-01-23 Roger Sayle <roger@eyesopen.com>
2650 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2652 * typeck.c (ignore_overflows): Remove the remaining uses of
2653 TREE_CONSTANT_OVERFLOW.
2655 2007-01-20 Jan Hubicka <jh@suse.cz>
2657 * decl2.c (start_objects, start_static_storage_duration_function):
2658 Do not make the functions uninlinable.
2660 2007-01-17 Ian Lance Taylor <iant@google.com>
2662 * class.c (add_method): Call VEC_reserve_exact rather than passing
2663 a negative size to VEC_reserve.
2665 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2668 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2670 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2673 * decl.c (make_typename_type): If the qualified name is not a
2674 type, issue an error.
2675 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2678 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2680 * rtti.c: Include target.h.
2681 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2682 don't emit typeinfo for fundamental types as weak.
2683 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2685 2007-01-08 Richard Guenther <rguenther@suse.de>
2687 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2689 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2691 * call.c (standard_conversion): Pass flag to
2692 vector_types_convertible_p to disallow emission of note.
2693 * typeck.c (convert_for_assignment): Pass flag to
2694 vector_types_convertible_p to allow emission of note.
2695 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2696 to disallow emission of note.
2698 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2701 * typeck.c (build_binary_op): Call overflow_warning if
2702 TREE_OVERFLOW_P is true for the result and not for any of the
2705 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2708 * class.c (add_method): Don't wait until template
2709 instantiation time to complain about duplicate methods.
2711 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2714 * semantics.c (finish_unary_op_expr): Warn only if result
2715 overflowed and operands did not.
2717 2007-01-05 Ian Lance Taylor <iant@google.com>
2719 * typeck.c (build_binary_op): Warn about comparing a non-weak
2722 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2724 * pt.c (tsubst): Propagate the need for structural equality checks
2725 when reducing the level of template parameters.
2727 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2729 * pt.c: Fix a comment typo.
2731 2007-01-02 Ian Lance Taylor <iant@google.com>
2733 * semantics.c (maybe_convert_cond): Optionally warn when using an
2734 assignment as a condition.
2735 * typeck.c (convert_for_assignment): Optionally warn about
2736 assigning the result of an assignment to a bool.
2738 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2740 * pt.c (canonical_template_parms): Correct typo in comment.
2742 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2744 * typeck.c (structural_comptypes): Renamed from "comptypes".
2745 (comptypes): Use canonical type information to perform fast type
2746 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2747 canonical type comparison returns the same results as we would see
2748 from the current, structural check. Support COMPARE_STRUCTURAL
2749 when we need structural checks.
2750 * decl.c (typename_compare): Fix comment.
2751 (build_typename_type): TYPENAME_TYPE nodes require structural
2752 equality checks, because they resolve different based on the
2754 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2755 require structural equality checks (for now).
2756 (build_ptrmemfunc_type): Build the canonical pointer to member
2758 (compute_array_index_type): Whenever we build a new index type
2759 to represent the size of an array in a template, we need to mark
2760 this index type as requiring structural equality. This goes for
2761 arrays with value-dependent sizes with the current ABI, or all
2763 * tree.c (cplus_array_hash): New.
2764 (struct cplus_array_info): New.
2765 (cplus_array_compare): New.
2766 (cplus_array_htab): New.
2767 (build_cplus_array_type_1): Use a hash table to cache the array
2768 types we build. Build the canonical array type for each array
2770 (cp_build_qualified_type_real): When building a cv-qualified array
2771 type, use the hash table of array types and build canonical array
2773 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2774 use structural equality (for now).
2775 * cp-tree.h (COMPARE_STRUCTURAL): New.
2776 * pt.c (canonical_template_parms): New.
2777 (canonical_type_parameter): New.
2778 (process_template_parm): Find the canonical type parameter.
2779 (lookup_template_class): When we have named the primary template
2780 type, set the canonical type for our template class to the primary
2781 template type. If any of the template arguments need structural
2782 equality checks, the template class needs structural equality
2784 (tsubst): When reducing the level of a template template
2785 parameter, we require structural equality tests for the resulting
2786 parameter because its template parameters have not had their types
2787 canonicalized. When reducing a template type parameter, find the
2788 canonical reduced type parameter.
2789 (any_template_arguments_need_structural_equality_p): New.