1 2007-10-27 Jason Merrill <jason@redhat.com>
4 * call.c (convert_default_arg): Detect recursion.
6 2007-10-27 Jakub Jelinek <jakub@redhat.com>
9 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
10 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
12 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
14 * error.c (dump_expr): Handle OFFSETOF_EXPR.
16 2007-10-26 Jason Merrill <jason@redhat.com>
19 * pt.c (get_template_info): New fn.
20 (template_class_depth): Use it.
21 (push_template_decl_real): Check that the template args of the
22 definition match the args of the previous declaration.
24 2007-10-26 Paolo Carlini <pcarlini@suse.de>
27 * decl2.c (coerce_new_type): Do not allow a default argument for
30 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
33 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
34 don't see the leading '('. Only lookup names if we get an
37 2007-10-26 Jakub Jelinek <jakub@redhat.com>
40 * parser.c (cp_parser_parenthesized_expression_list): Set
41 greater_than_is_operator_p to true in between the parens.
43 2007-10-26 Paolo Carlini <pcarlini@suse.de>
46 * decl.c (grokdeclarator): In case of conflicting specifiers
47 just return error_mark_node.
49 2007-10-26 Ollie Wild <aaw@google.com>
51 * expr.c (cxx_expand_expr): Removed.
52 * cp-tree.h (exx_expand_expr): Removed.
53 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
56 2007-10-25 Paolo Carlini <pcarlini@suse.de>
59 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
61 2007-10-23 Jason Merrill <jason@redhat.com>
64 * call.c (struct conversion): Remove check_copy_constructor_p.
65 (reference_binding): Always bind a reference directly to a
66 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
68 (check_constructor_callable): Remove.
69 (convert_like_real): Don't call it.
70 (initialize_reference): Don't call check_constructor_callable.
71 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
72 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
73 conversions if LOOKUP_NO_TEMP_BIND.
74 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
75 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
77 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
79 2007-10-22 Jakub Jelinek <jakub@redhat.com>
82 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
83 before checking if its type is integral.
85 2007-10-22 Jason Merrill <jason@redhat.com>
88 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
89 * pt.c (apply_late_template_attributes): Splice out dependent
90 attributes from DECL_ATTRIBUTES.
92 * decl.c (cxx_maybe_build_cleanup): Use build_address.
94 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
96 * typeck.c (build_binary_op) : Use appropriate warning option
97 instead of unnamed warning.
99 2007-10-16 Paolo Carlini <pcarlini@suse.de>
102 * pt.c (current_template_args): Do not change TREE_LIST elements
103 with a TREE_VALUE of error_mark_node.
105 2007-10-16 Mark Mitchell <mark@codesourcery.com>
107 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
108 * decl.c (start_decl): Tidy.
109 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
111 (grokdeclarator): Clarify comment.
113 2007-10-14 Andrew Pinski <pinskia@gmail.com>
116 * decl.c (grokfndecl): Return NULL after the "definition of
117 implicitly-declared" error happened.
119 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
122 * call.c (build_user_type_conversion_1): Do not consider conversion
123 functions to convert a (possibly cv-qualified) object to the (possibly
124 cv-qualified) same object type (or a reference to it), to a (possibly
125 cv-qualified) base class of that type (or a reference to it).
127 2007-10-12 Paolo Carlini <pcarlini@suse.de>
129 * pt.c (tsubst): Use template_parm_level_and_index.
131 2007-10-12 Jakub Jelinek <jakub@redhat.com>
134 * parser.c (cp_parser_compound_statement): Handle label-declarations
135 at the beginning of the compound statement.
136 (cp_parser_block_declaration): Issue diagnostics about __label__
137 not at the beginning of a block.
139 2007-10-11 Paolo Carlini <pcarlini@suse.de>
142 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
143 to convert_template_argument.
144 (coerce_template_parms): Return error_mark_node after fixed-length
146 (tsubst_decl): Check for error_mark_node the return value of the
147 first tsubst in 'case VAR_DECL'.
149 2007-10-08 Ollie Wild <aaw@google.com>
151 * typeck2.c (digest_init): Call cplus_expand_constant after
152 convert_for_initialization.
153 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
154 * expr.c (cplus_expand_constant): Updated function description.
156 2007-10-04 Jason Merrill <jason@redhat.com>
159 * call.c (initialize_reference): Handle local static reference
162 2007-10-03 Jason Merrill <jason@redhat.com>
165 * name-lookup.c (push_namespace_with_attrs): Fold back into...
166 (push_namespace): Here.
167 (handle_namespace_attrs): New fn for the attr code.
168 (leave_scope): Don't pop_visibility.
169 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
170 * parser.c (cp_parser_namespace_definition): Call
171 handle_namespace_attrs and pop_visibility as appropriate.
174 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
176 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
178 * decl.c (duplicate_decls): Preserve linkage flags for mere
179 redeclarations of gnu_inline definitions.
181 2007-10-03 Jason Merrill <jason@redhat.com>
184 * decl.c (wrap_cleanups_r): New fn.
185 (wrap_temporary_cleanups): New fn.
186 (initialize_local_var): Call it.
188 2007-09-29 Jason Merrill <jason@redhat.com>
191 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
192 constant to not have DECL_EXTERNAL if it's file-local.
194 2007-09-28 Ollie Wild <aaw@google.com>
197 2007-09-27 Ollie Wild <aaw@google.com>
199 * typeck2.c (digest_init): Call cplus_expand_constant after
200 convert_for_initialization.
201 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
202 * expr.c (cplus_expand_constant): Updated function description.
204 2007-09-28 Jason Merrill <jason@redhat.com>
207 * class.c (layout_empty_base): Take rli parameter, update
208 rli->record_align if empty base has user-specified alignment.
209 (build_base_field): Pass rli to it.
211 2007-09-28 Paolo Carlini <pcarlini@suse.de>
214 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
216 2007-09-28 Paolo Carlini <pcarlini@suse.de>
219 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
220 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
221 (dump_parameters): Just call dump_type for argument packs too.
223 2007-09-28 Jakub Jelinek <jakub@redhat.com>
226 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
227 qualification by creating qualified PACK_EXPANSION_PATTERN and
228 then calling make_pack_expansion on it.
230 2007-09-27 Ollie Wild <aaw@google.com>
232 * typeck2.c (digest_init): Call cplus_expand_constant after
233 convert_for_initialization.
234 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
235 * expr.c (cplus_expand_constant): Updated function description.
237 2007-09-27 Jason Merrill <jason@redhat.com>
240 * decl2.c (is_late_template_attribute): Don't crash on unknown
243 2007-09-27 Paolo Carlini <pcarlini@suse.de>
246 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
247 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
248 spaces in the formatting.
249 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
251 2007-09-27 Jakub Jelinek <jakub@redhat.com>
253 * error.c (cxx_print_error_function): Add third argument, pass
254 it over to lhd_print_error_function.
255 (cp_print_error_function): If diagnostic->abstract_origin, print
257 * cp-tree.h (struct diagnostic_info): New forward decl.
258 (cxx_print_error_function): Add third argument.
260 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
263 * name-lookup.c (pushtag): Do not create an implicit typedef before
264 the associated type declaration is known to be valid.
266 2007-09-25 Jakub Jelinek <jakub@redhat.com>
268 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
269 rather than pointers.
271 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
274 * search.c (check_final_overrider): Fail if
275 targetm.comp_type_attributes returns 0.
277 2007-09-24 Jason Merrill <jason@redhat.com>
280 * pt.c (resolve_typename_type): Don't look things up in the original
281 template if it would mean losing template arguments.
283 2007-09-24 Jakub Jelinek <jakub@redhat.com>
286 * cp-tree.h (cxx_type_hash_eq): New prototype.
287 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
288 * tree.c (cxx_type_hash_eq): New function.
290 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
293 * tree.c (cp_build_qualified_type_real): Build a canonical
294 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
296 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
300 * tree.c (cplus_array_compare): Compare pointers, not types.
301 (build_cplus_array_type_1): Store new array type into the hash
302 table before building the canonical type; build the canonical type
304 (cp_build_qualified_type_real): Put all of the array types with
305 cv-qualified element types into the C++ array hash table, built as
306 variants of the unqualified versions.
308 2007-09-23 Jason Merrill <jason@redhat.com>
311 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
312 for deprecation warnings.
314 2007-09-22 Jason Merrill <jason@redhat.com>
317 * call.c (build_over_call): Warn about deprecated virtuals.
320 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
321 (MAYBE_TAGGED_TYPE_P): Remove.
322 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
323 instead of calling is_late_template_attribute again.
324 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
325 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
326 Don't crash on typedefs from non-template classes.
327 * decl2.c (grokfield): Don't sorry about attrs on template parms.
328 (is_late_template_attribute): All attributes applied to template
329 parms or typename types are dependent. Static.
330 (splice_template_attributes): Pass decl through.
331 (save_template_attributes): Likewise.
333 2007-09-20 Jakub Jelinek <jakub@redhat.com>
336 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
337 returned from tsubst_pack_expansion.
338 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
339 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
341 2007-09-20 Paolo Carlini <pcarlini@suse.de>
344 * semantics.c (finish_id_expression): Use consistently
345 context_for_name_lookup.
346 * decl.c (fixup_anonymous_aggr): Fix error message for
347 anonymous struct (vs union).
349 2007-09-19 Jason Merrill <jason@redhat.com>
352 * pt.c (tsubst): Handle typedefs by looking for the specialization.
353 (retrieve_specialization): Only tagged types use
354 DECL_TEMPLATE_INSTANTIATIONS.
355 (instantiate_class_template): Push nested classes too.
356 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
358 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
359 * init.c (is_aggr_type): Remove redundant tests.
360 * class.c (push_nested_class): Use CLASS_TYPE_P.
362 2007-09-20 Paolo Carlini <pcarlini@suse.de>
365 * init.c (build_zero_init): If, recursively, build_zero_init
366 returns a NULL_TREE, do not append it to the VEC of constructors.
368 2007-09-18 Jason Merrill <jason@redhat.com>
371 * pt.c (apply_late_template_attributes): Set processing_template_decl.
372 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
373 ATTR_FLAG_TYPE_IN_PLACE.
374 (tsubst): Do unqualified lookup to find typedefs from current class.
375 [ARRAY_TYPE]: Propagate alignment info.
376 * decl2.c (is_late_template_attribute): Only defer handling of
377 attribute aligned if the expression is dependent.
378 (save_template_attributes): If we're deferring any attributes,
379 make this a naming typedef.
381 2007-09-18 Paolo Carlini <pcarlini@suse.de>
384 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
385 va_arg instead of __builtin_va_arg.
387 2007-09-18 Paolo Carlini <pcarlini@suse.de>
390 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
391 (pp_cxx_primary_expression): Use it.
392 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
393 * error.c (dump_expr): Use it.
395 2007-09-18 Paolo Carlini <pcarlini@suse.de>
398 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
399 out case TYPEID_EXPR to...
400 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
401 and pp_cxx_right_paren.
402 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
403 * error.c (dump_expr): Use it.
405 2007-09-18 Paolo Carlini <pcarlini@suse.de>
408 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
409 (pp_cxx_primary_expression): Use it.
410 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
411 * error.c (dump_expr): Use it.
413 2007-09-16 Paolo Carlini <pcarlini@suse.de>
416 * init.c (build_new): Remove warning for zero-element
419 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
422 * call.c (maybe_handle_implicit_object): Set this_p, clear
423 rvaluedness_matches_p.
424 (compare_ics): Do not compare rvaluedness matching when one of the
425 operands is an implicit object.
427 2007-09-14 Jason Merrill <jason@redhat.com>
429 PR c++/17743, c++/19163
430 * decl2.c (is_late_template_attribute): New fn.
431 (splice_template_attributes, save_template_attributes): New fns.
432 (cplus_decl_attributes): Call save_template_attributes.
433 * pt.c (apply_late_template_attributes): New fn.
434 (instantiate_class_template, tsubst_decl): Use it.
435 * cp-tree.h: Declare is_late_template_attribute.
437 2007-09-13 Tom Tromey <tromey@redhat.com>
439 * parser.c (cp_lexer_new_main): Don't use
440 c_lex_return_raw_strings.
441 (cp_lexer_get_preprocessor_token): Update. Add special case when
444 2007-09-11 Jan Hubicka <jh@suse.cz>
446 * method.c (use_thunk): Use tree_rest_of_compilation
447 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
448 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
449 * cp-tree.h (expand_body): Kill.
450 (emit_associated_thunks): Declare.
451 * semantics.c (emit_associated_thunks): Export.
454 2007-09-09 David Daney <ddaney@avtrex.com>
457 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
458 to calculate cookie_ptr.
460 2007-09-08 Jason Merrill <jason@redhat.com>
463 * pt.c (most_specialized_class): Set processing_template_decl
464 while tsubsting partial spec args.
466 2007-09-06 Jason Merrill <jason@redhat.com>
468 * decl2.c (get_guard): Copy visibility from the guarded variable.
470 2007-09-06 Jan Hubicka <jh@suse.cz>
472 * semantics.c (expand_body): Do not mark arguments of clones used.
474 2007-09-06 Paolo Carlini <pcarlini@suse.de>
477 * decl.c (cp_finish_decl): When processing_template_decl,
478 deal correctly with init as TREE_LIST.
480 2007-09-06 Tom Tromey <tromey@redhat.com>
482 * decl.c (finish_function): Put return's location on line zero of
485 2007-09-05 Jason Merrill <jason@redhat.com>
488 * except.c (prepare_eh_type): Use type_decays_to.
491 * init.c (build_delete): Use build_headof to get the address of the
492 complete object if we aren't using the deleting destructor.
493 * rtti.c (build_headof): No longer static.
494 * cp-tree.h: Declare it.
496 2007-09-06 Jakub Jelinek <jakub@redhat.com>
498 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
499 decl if a prototype for XX is provided with throw().
502 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
503 on __*_chk non-__builtin_* decls.
505 2007-09-05 Paolo Carlini <pcarlini@suse.de>
508 * semantics.c (finish_id_expression): Use context_for_name_lookup
509 insted of DECL_CONTEXT, to see through anonymous structs and unions.
510 * class.c (finish_struct_anon): Deal correctly with anonymous
511 structs (vs unions, as GNU extension) in error messages.
513 2007-09-05 Jan Hubicka <jh@suse.cz>
515 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
516 call, DECL_EXTERNAL checks and current_function_decl saving.
518 2007-09-05 Paolo Carlini <pcarlini@suse.de>
521 * parser.c (cp_parser_primary_expression): Return error_mark_node
522 when a statement-expression is found in a template-argument list.
524 2007-09-04 Jason Merrill <jason@redhat.com>
526 * except.c (initialize_handler_parm): Use
527 fold_build_cleanup_point_expr.
530 * call.c (reference_binding): Don't look for user-defined conversions
534 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
535 the MUST_NOT_THROW_EXPR.
537 2007-09-04 Richard Sandiford <richard@codesourcery.com>
539 * decl.c (cp_finish_decl): Call determine_visibility before
540 make_rtl_for_nonlocal_decl.
542 2007-09-04 Jason Merrill <jason@redhat.com>
545 * pt.c (most_specialized_class): Substitute outer template
546 arguments into the arguments of a member template partial
548 (strip_innermost_template_args): New fn.
550 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
552 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
554 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
556 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
557 * decl.c (cp_make_fname_decl): Likewise,
558 * parser.c (cp_parser_string_literal): Likewise,
559 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
560 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
563 2007-09-02 Paolo Carlini <pcarlini@suse.de>
566 * typeck.c (build_unary_op): Fix error message for
567 Boolean expression as operand to operator--.
569 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
571 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
572 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
575 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
578 * init.c (build_default_init): Make extern.
579 * cp-tree.h (build_default_init): Declare here.
580 * pt.c (tsubst_expr): When the instantiation of the initializer of
581 a variable results in an empty list, default-initialize the
583 (tsubst_copy_and_build): When the instantiation of the initializer
584 in a new expression results in an empty initializer list,
585 default-initialize it.
587 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
589 * mangle.c (write_type): Change mangling of rvalue reference from
592 2007-08-31 Jakub Jelinek <jakub@redhat.com>
594 * decl.c (duplicate_decls): Remove duplicated line.
596 2007-08-31 Paolo Carlini <pcarlini@suse.de>
599 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
600 BOUND_TEMPLATE_TEMPLATE_PARM.
602 2007-08-31 Paolo Carlini <pcarlini@suse.de>
605 * search.c (lookup_member): Check the name argument for
608 2007-08-31 Paolo Carlini <pcarlini@suse.de>
611 * parser.c (cp_parser_trait_expr): Check rerurn value of
614 2007-08-30 Ollie Wild <aaw@google.com>
616 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
617 convert_ptrmem for pointer to member conversions.
618 (convert_to_pointer_force): Update cp_convert_to_pointer call.
619 (ocp_convert): Update cp_convert_to_pointer call.
620 * typeck.c (convert_ptrmem): Add conditional for null pointers to
622 (build_static_cast_1): Check can_convert for conversions in either
624 (get_delta_difference_1): New function.
625 (get_delta_difference): Refactor to call get_delta_difference_1.
627 2007-08-30 Jakub Jelinek <jakub@redhat.com>
629 * decl.c (start_preparsed_function): Set
630 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
632 2007-08-28 Paolo Carlini <pcarlini@suse.de>
635 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
636 BOUND_TEMPLATE_TEMPLATE_PARM.
638 2007-08-28 Jakub Jelinek <jakub@redhat.com>
642 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
643 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
645 2007-08-27 Jason Merrill <jason@redhat.com>
648 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
649 Look inside STMT_EXPR.
650 * semantics.c (stmt_expr_value_expr): New fn.
651 * cp-tree.h: Declare it.
654 * decl.c (groktypename): Ignore attributes applied to class type.
656 2007-08-28 Richard Guenther <rguenther@suse.de>
658 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
660 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
662 * error.c (dump_expr): Handle COMPLEX_CST.
663 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
664 (pp_cxx_expression): Likewise.
666 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
668 * decl.c (GNU_INLINE_P): New.
669 (duplicate_decls): Handle gnu_inline. Merge attributes and
670 some flags in overriding definitions.
671 (redeclaration_error_message): Handle gnu_inline.
672 (start_preparsed_function): Likewise.
674 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
676 * call.c (sufficient_parms_p): Constify.
677 * class.c (same_signature_p): Likewise.
678 * cp-gimplify.c (is_invisiref_parm,
679 cxx_omp_privatize_by_reference): Likewise.
680 * cp-objcp-common.c (has_c_linkage): Likewise.
681 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
682 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
683 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
684 num_artificial_parms_for, comp_template_parms,
685 template_parameter_pack_p, any_dependent_template_arguments_p,
686 any_type_dependent_arguments_p, any_value_dependent_elements_p,
687 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
688 zero_init_p, member_p, cp_lvalue_kind,
689 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
690 varargs_function_p, is_dummy_object, special_function_kind,
691 string_conv_p, type_unknown_p, comp_except_specs, compparms,
692 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
693 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
694 cp_has_mutable_p, at_least_as_qualified_p,
695 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
696 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
697 * except.c (nothrow_libfn_p): Likewise.
698 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
700 * pt.c (comp_template_parms, template_parameter_pack_p,
701 any_type_dependent_arguments_p, any_value_dependent_elements_p,
702 any_dependent_template_arguments_p): Likewise.
703 * repo.c (repo_export_class_p): Likewise.
704 * semantics.c (anon_aggr_type_p): Likewise.
705 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
706 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
707 varargs_function_p, member_p, is_dummy_object, pod_type_p,
708 zero_init_p, special_function_p): Likewise.
709 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
710 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
711 compparms, invalid_nonstatic_memfn_p,
712 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
713 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
714 cp_has_mutable_p, lvalue_or_else): Likewise.
716 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
718 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
719 * cp-objcp-common.c (cp_tree_size): Ditto.
720 * tree.c (cp_walk_subtrees): Ditto
721 * cp-tree.def (TINST_LEVEL): Go away.
722 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
723 move together with other non-tree structs.
724 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
725 (union lang_tree_node): Eliminate tinst_level field.
726 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
727 (current_instantiation, outermost_tinst_level): Return
728 a "struct tinst_level *".
730 * error.c (print_instantiation_partial_context): Change second
731 parameter to a "struct tinst_level *". Replace accessor macros
733 (print_instantiation_full_context): Likewise.
734 * lex.c (in_main_input_context): Likewise.
736 * pt.c (struct pending_templates): New.
737 (pending_templates, last_pending_template): Use it as a type.
738 (current_tinst_level): Change typo to "struct tinst_level *"
739 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
740 (add_pending_template): Construct a "struct pending_template".
741 Replace TINST_LEVEL accessor macros with field access.
742 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
743 (pop_tinst_level): Likewise.
744 (instantiate_pending_templates): Likewise. Factor common code used
745 when an instantiation has been done.
746 (outermost_tinst_level): Replace tree_last with loop.
747 (current_instantiation): Return a "struct tinst_level *".
749 2007-08-24 Ollie Wild <aaw@google.com>
751 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
752 * name-lookup.h (cp_binding_level): Remove vtables member.
754 2007-08-24 Richard Guenther <rguenther@suse.de>
756 * tree.c (cp_cannot_inline_tree_fn): Remove.
757 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
758 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
761 2007-08-24 Jakub Jelinek <jakub@redhat.com>
764 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
765 error_mark_node right away if build_expr_type_conversion
769 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
770 is error_mark_node rather than NULL_TREE.
771 * pt.c (check_explicit_specialization): Likewise.
774 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
775 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
777 2007-08-22 Jason Merrill <jason@redhat.com>
780 * pt.c (outermost_tinst_level): New function.
781 * lex.c (in_main_input_context): New function.
782 * cp-tree.h: Declare it.
783 * decl2.c (constrain_class_visibility): Use it to avoid warning
784 about uses of the anonymous namespace in the main input file.
786 2007-08-21 Jakub Jelinek <jakub@redhat.com>
788 * init.c (build_new_1): Use get_target_expr instead of save_expr.
790 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
793 * class.c (finish_struct_1): Warn when a class has virtual
794 functions and accessible non-virtual destructor.
796 2007-08-20 Richard Guenther <rguenther@suse.de>
800 * call.c (build_new_method_call): Convert initializer to
802 * init.c (build_aggr_init): Do not fiddle with types.
803 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
804 * except.c (build_throw): Do not drop qualifiers for the
806 * typeck.c (get_member_function_from_ptrfunc): Do not
807 fiddle with types, instead convert.
808 (build_ptrmemfunc1): Convert to the target type for
810 (gfc_trans_allocate): Convert result to target type.
811 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
812 pointer-to-member structures shall have alias set zero as well.
814 2007-08-20 Richard Guenther <rguenther@suse.de>
816 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
818 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
819 (nonstatic_local_decl_p): Likewise.
820 * tree.c (cp_auto_var_in_fn_p): Remove.
821 * decl.c (nonstatic_local_decl_p): Remove.
823 2007-08-20 Richard Guenther <rguenther@suse.de>
825 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
827 * tree.h (cp_walk_tree): New define to walk_tree_1 with
828 cp_walk_subtrees lh parameter.
829 (cp_walk_tree_without_duplicates): New define to
830 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
831 * tree.c (count_trees): Call
832 cp_walk_tree_without_duplicates.
833 (verify_stmt_tree): Call cp_walk_tree.
834 (break_out_target_exprs): Likewise.
835 (WALK_SUBTREE): Likewise.
836 * cp-gimplify.c (cp_genericize): Likewise.
837 * cp-pt.c (find_parameter_packs_r): Likewise.
838 (uses_parameter_packs): Likewise.
839 (make_pack_expansion): Likewise.
840 (check_for_bare_parameter_packs): Likewise.
841 (for_each_template_parm): Likewise.
842 * decl.c (check_default_argument): Call
843 cp_walk_tree_without_duplicates.
844 * except.c (build_throw): Likewise.
845 * decl2.c (type_visibility): Likewise.
846 * semantics.c (expand_or_defer_fn): Likewise.
847 (finalize_nrv): Call cp_walk_tree.
849 2007-08-20 Jakub Jelinek <jakub@redhat.com>
852 * init.c (build_new_1): Rename placement_var variable to placement_expr.
853 Initialize it with save_expr rather than get_temp_regvar.
855 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
858 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
861 2007-08-17 Ollie Wild <aaw@google.com>
864 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
865 declarations into appropriate slots for comparison. Fix type
868 2007-08-17 Paolo Carlini <pcarlini@suse.de>
871 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
872 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
874 2007-08-17 Paolo Carlini <pcarlini@suse.de>
877 * parser.c (cp_parser_class_head): Improve error message.
879 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
881 * pt.c (instantiate_decl): Set input_location
882 for the function end.
884 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
886 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
888 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
889 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
890 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
891 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
892 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
893 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
894 * typeck.c (cp_type_quals): Likewise.
895 * typeck2.c (cxx_incomplete_type_diagnostic,
896 cxx_incomplete_type_error): Likewise.
898 2007-08-16 Paolo Carlini <pcarlini@suse.de>
901 * pt.c (tsubst_friend_function): When check_classfn
902 returns error_mark_node likewise return it.
904 2007-08-15 Jakub Jelinek <jakub@redhat.com>
907 * typeck.c (check_return_expr): Don't NRV optimize vars in
909 * decl.c (finish_function): Comment fix.
911 2007-08-15 Paolo Carlini <pcarlini@suse.de>
914 * pt.c (push_template_decl_real): Depending on TYPE_P
915 use either TYPE_CONTEXT or DECL_CONTEXT.
917 2007-08-14 Mark Mitchell <mark@codesourcery.com>
919 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
920 constructors and destructors return this.
922 2007-08-14 Paolo Carlini <pcarlini@suse.de>
925 * decl2.c (check_classfn): Return error_mark_node in case of error;
926 in that case, do not call add_method.
927 * decl.c (start_decl): Deal with check_classfn returning
929 (grokfndecl): Likewise.
930 * pt.c (tsubst_friend_function): Likewise.
932 2007-08-14 Andrew Pinski <pinskia@gmail.com>
935 * typeck.c (build_binary_op): Disallow vector float types with
936 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
938 2007-08-11 Ian Lance Taylor <iant@google.com>
940 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
942 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
944 2007-08-10 Ollie Wild <aaw@google.com>
946 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
948 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
950 (unqualified_namespace_lookup): Fix ambiguous_decl call.
951 (lookup_using_namespace): Fix ambiguous_decl call.
952 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
954 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
956 * call.c (name_as_c_string): Use CONST_CAST.
957 * decl.c (build_decl): Likewise.
958 * parser.c (cp_parser_string_literal): Likewise.
960 2007-08-10 Paolo Carlini <pcarlini@suse.de>
963 * error.c (dump_expr): Consistently use the *_cxx_*
964 variants of the pretty-print functions.
966 2007-08-10 Paolo Carlini <pcarlini@suse.de>
969 * decl.c (check_special_function_return_type): Just error
970 on return type specified for conversion operator.
972 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
974 * typeck2.c (readonly_error): Handle general expressions.
975 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
977 2007-08-06 Dan Hipschman <dsh@google.com>
979 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
980 access function name.
982 2007-08-04 Alfred Minarik <a.minarik@aon.at>
985 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
986 * g++spec.c (lang_specific_driver): Check them.
988 2007-08-06 Paolo Carlini <pcarlini@suse.de>
991 * pt.c (inline_needs_template_parms): Fix comment; change return type
994 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
997 2007-03-26 Dirk Mueller <dmueller@suse.de>
999 * parser.c (cp_parser_member_declaration): Pedwarn
1000 about stray semicolons after member declarations.
1002 2007-08-02 Lee Millward <lee.millward@gmail.com>
1007 * parser.c (cp_parser_asm_definition): Detect and discard asm
1008 statements with invalid inputs or outputs.
1009 (cp_parser_asm_operand_list): Return error mark node if any
1010 of the operands are invalid. Adjust documentation.
1012 2007-08-02 Nick Clifton <nickc@redhat.com>
1014 * typeck.c: Change copyright header to refer to version 3 of the
1015 GNU General Public License and to point readers at the COPYING3
1016 file and the FSF's license web page.
1017 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1018 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1019 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1020 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1021 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1022 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1023 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1024 name-lookup.h, parser.c: Likewise.
1026 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1029 * call.c (magic_varargs_p): Honor the "type generic" attribute.
1031 2007-07-30 Paolo Carlini <pcarlini@suse.de>
1034 * semantics.c (finish_label_stmt): Reject the __label__
1035 extension outside function scopes.
1037 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1039 * parser.c (eof_token): Un-constify.
1040 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1041 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1044 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
1046 * pt.c, tree.c, typeck2.c: Fix comment typos.
1048 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
1049 Mark Mitchell <mark@codesourcery.com>
1052 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1053 hidden due to friend declarations in local classes.
1055 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
1057 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1058 * cp-tree.def (DECLTYPE_TYPE): New.
1059 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1060 (dump_type_prefix): Ditto.
1061 (dump_type_suffix): Ditto.
1062 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1063 * mangle.c (write_type): Handle DECLTYPE_TYPE.
1064 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1066 (DECLTYPE_TYPE_EXPR): New.
1067 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1068 (finish_declared_type): Declare.
1069 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1070 DECLTYPE_TYPE nodes.
1071 (pp_cxx_type_id): Ditto.
1072 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1073 (tsubst): Substitute into a DECLTYPE_TYPE node.
1074 (tsubst_copy): Ditto.
1075 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1077 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1078 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1079 structural equality (because we can't hash the expressions).
1080 (finish_declared_type): New.
1081 * lex.c (reswords): Add "decltype" keyword.
1082 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1083 (cp_parser_postfix_expression): Add member_access_only_p to
1084 restrict postfix expression to member access expressions.
1085 (cp_parser_unary_expression): Update call to
1086 cp_parser_postfix_expression to reflect new parameter.
1087 (cp_parser_declared_type): New.
1088 (cp_parser_simple_type_specifier): Parse decltype types.
1090 2007-07-27 Mark Mitchell <mark@codesourcery.com>
1093 * call.c (convert_for_arg_passing): Only widen bitfields to their
1094 declared types if necessary.
1096 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1098 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1101 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1103 * decl.c (typename_hash, typename_compare): Constify.
1104 * mangle.c (hash_type, compare_type): Likewise.
1105 * pt.c (eq_local_specializations, hash_local_specialization):
1107 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1108 list_hash): Likewise.
1109 * typeck2.c (pat_compare): Likewise.
1111 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
1113 * method.c (implicitly_declare_fn): Increase alignment if member
1114 function pointer format requires it.
1116 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1119 * typeck.c (check_return_expr): Do not pass a null argument
1122 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1125 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1128 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1131 * typeck.c (convert_arguments): Only use default args if we have
1135 * typeck.c (structural_comptypes): No need to check
1136 resolve_typename_type return value here.
1137 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1138 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1139 original type rather than error_mark_node in case of failure.
1140 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1141 resolve_typename_type result check.
1142 (cp_parser_direct_declarator, cp_parser_head,
1143 cp_parser_constructor_declarator_p): Likewise.
1145 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1147 * pt.c (template_parms_variadic_p): Remove.
1148 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1150 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1153 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1154 argument to dump_aggr_init_expr_args instead of false.
1156 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1158 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1159 canonical types; otherwise, fall back to structural type
1160 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1161 internal compiler error if the canonical types are wrong.
1163 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1166 * parser.c (cp_parser_make_indirect_declarator): When the
1167 the code argument is ERROR_MARK return cp_error_declarator.
1169 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1172 * decl.c (cxx_init_decl_processing): Don't set
1173 force_align_functions_log.
1174 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1175 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1176 FUNCTION_DECL, return its alignment.
1178 2007-07-09 Richard Guenther <rguenther@suse.de>
1180 * decl.c (start_preparsed_function): Do not promote return type.
1182 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1185 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1187 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1190 * pt.c (resolve_overloaded_unification): Robustify. Return a
1192 (type_unification_real): Adjust accordingly.
1194 2007-07-06 Richard Guenther <rguenther@suse.de>
1196 * init.c (build_new_1): Use the correct pointer type.
1197 * typeck2.c (build_m_component_ref): Likewise.
1199 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1202 * init.c (build_zero_init): Always build an initializer for
1204 * typeck2.c (build_functional_cast): Use build_zero_init.
1207 * init.c (build_new_1): Always pass the allocation function to
1208 build_op_delete_call.
1209 * call.c (build_op_delete_call): Handle operator delete with a
1210 variable-argument list. Do not issue an error when no matching
1211 deallocation function is available for a new operator.
1214 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1215 * decl.c (value_dependent_init_p): New function.
1216 (cp_finish_decl): Use it.
1217 * pt.c (value_dependent_expression_p): Use
1218 any_value_dependent_elements_p.
1219 * parser.c (cp_parser_primary_expression): Add comment about
1220 treating dependent qualified names as integral
1221 constant-expressions.
1223 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1225 * decl.c (build_ptrmemfunc_type): Always use structural equality
1226 tests when comparing pointer-to-member-function types, because the
1227 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1230 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1232 * init.c (build_new): Tweak comment.
1234 2007-06-29 Dave Brolley <brolley@redhat.com>
1237 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1238 type to its base type and number of elements here.
1239 * init.c (build_new): Call complete_type_or_else to ensure that the
1240 type is complete and to issue a diagnostic if it is not.
1241 (build_new_1): Don't call complete_type_or_else here.
1243 2007-07-03 Richard Guenther <rguenther@suse.de>
1246 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1249 2007-07-02 Simon Baldwin <simonb@google.com>
1251 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1252 for inner-style nested forward declarations that don't declare
1255 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1258 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1259 DECL_P in not a variable and appears more than once error messages.
1261 2007-07-01 Ollie Wild <aaw@google.com>
1263 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1264 (select_decl): Remove function.
1265 (unqualified_namespace_lookup): Populate binding by calling
1266 ambiguous_decl. Remove select_decl call.
1267 (lookup_qualified_name): Remove select_decl call.
1268 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1269 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1270 generation when name lookup is ambiguous.
1272 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1275 * init.c (build_new_1): Use structural equality on the copy of the
1278 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1280 * decl2.c (determine_visibility): Implement
1281 flag_visibility_ms_compat effect on type info.
1282 * decl.c (cxx_init_decl_processing): Implement
1283 global effect of flag_visibility_ms_compat.
1285 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1287 * decl2.c (start_objects): Mark constructor-running function
1290 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1293 * decl.c (grokdeclarator): Reset friendp for member functions declared
1294 friend of their own class.
1296 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1298 * decl2.c (determine_visibility): Don't look for dllexport here.
1299 (determine_visibility_from_class): Tidy.
1301 2007-06-18 Simon Baldwin <simonb@google.com>
1304 * parser.c (cp_parser_single_declaration): Added check for storage
1305 class other than sc_none in parsed declaration, and a flag to indicate
1306 if the call is part of an explicit template specialization parse.
1307 * (cp_parser_explicit_specialization): Specialization check flag added
1308 to call to cp_parser_single_declaration(), set true.
1309 * (cp_parser_template_declaration_after_export): Specialization check
1310 flag added to call to cp_parser_single_declaration(), set false.
1311 * pt.c (check_explicit_specialization): Added code to copy visiblity
1312 and linkage from the templated function to the explicit specialization.
1314 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1316 * typeck.c (build_binary_op): For templates build the
1317 expression in pieces to avoid the assert in build2_stat.
1318 (get_member_function_from_ptrfunc):
1319 Change over to using POINTER_PLUS_EXPR and convert
1320 the second operand to sizetype.
1321 * typeck2.c (build_m_component_ref): Likewise.
1322 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1323 instead of PLUS_EXPR for pointers.
1324 (build_new_1): Likewise.
1325 (build_vec_delete_1): Likewise.
1326 (build_vec_delete): Likewise.
1327 * class.c (build_base_path): Likewise.
1328 (build_base_path): Likewise.
1329 (convert_to_base_statically): Likewise.
1330 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1331 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1332 instead of PLUS_EXPR.
1333 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1334 instead of PLUS_EXPR for pointers.
1335 * call.c (build_special_member_call): Likewise.
1336 * rtti.c (build_headof): Likewise.
1337 Use sizetype instead of ptrdiff_type_node.
1338 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1339 instead of PLUS_EXPR for pointers.
1340 * except.c (expand_start_catch_block): Do a
1341 NEGATIVE and then a POINTER_PLUS_EXPR instead
1343 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1344 PLUS_EXPR on pointer types over to use
1345 POINTER_PLUS_EXPR and remove the conversion
1346 to the pointer types.
1347 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1348 adding to a pointer type. Use size_int instead of
1349 ssize_int. Convert the index to sizetype before
1350 adding it to the pointer.
1352 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1354 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1355 (DECL_ANON_UNION_VAR_P): New macro.
1356 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1357 than DECL_VAR_MARKED_P, to keep track of which variables we have
1359 * decl.c (redeclaration_error_message): Complain about redeclaring
1360 anonymous union members at namespace scope.
1361 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1363 2007-06-14 Geoff Keating <geoffk@apple.com>
1365 * decl2.c (determine_visibility): Ensure that functions with
1366 hidden types as parameters are hidden.
1369 * decl2.c (determine_visibility): Remove duplicate code for
1372 2007-06-12 Ian Lance Taylor <iant@google.com>
1375 * init.c (avoid_placement_new_aliasing): New static function.
1376 (build_new_1): Call it.
1378 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1380 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1381 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1383 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1386 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1387 on init, the non-decl cond operand and increment value.
1389 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1392 * decl.c (check_initializer): Report an error when a brace enclosed
1393 initializer is used for a non-aggregate type in C++98.
1394 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1396 (grokdeclarator): Likewise.
1397 (move_fn_p): Likewise.
1398 * typeck.c (check_return_expr): Likewise.
1399 * call.c (reference_binding): Likewise.
1400 * error.c (cp_cpp_error): Likewise.
1401 * pt.c (check_default_tmpl_args): Likewise.
1403 * lex.c (init_reswords): Likewise.
1404 * parser.c (p_parser_primary_expression): Likewise.
1405 (TOKEN_PRECEDENCE): Likewise.
1406 (cp_parser_init_declarator): Likewise.
1407 (cp_parser_ptr_operator): Likewise.
1408 (cp_parser_parameter_declaration): Likewise.
1409 (cp_parser_enclosed_template_argument_list): Likewise.
1410 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1411 (cp_parser_next_token_ends_template_argument_p): Likewise.
1413 2007-06-04 Simon Baldwin <simonb@google.com>
1415 * decl.c (grokdeclarator): Readability change. Moved case labels
1416 into direct switch statement scope.
1418 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1420 * call.c (convert_like_real): Remove pointless code.
1422 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1424 * decl.c (get_atexit_fn_ptr_type): New function.
1425 (get_atexit_node): Use it.
1426 (start_cleanup_fn): Likewise.
1427 (register_dtor_fn): Use the object's destructor, instead of a
1428 separate cleanup function, where possible.
1429 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1430 (atexit_fn_ptr_type_node): New macro.
1431 * decl2.c (build_cleanup): Use build_address.
1433 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1435 * typeck.c (build_binary_op): Include types in error.
1437 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1440 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1441 needs runtime initialization.
1443 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1446 * semantics.c (finish_trait_expr): Complete the types.
1448 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1449 Douglas Gregor <doug.gregor@gmail.com>
1450 Pedro Lamarao <pedro.lamarao@mndfck.org>
1451 Howard Hinnant <howard.hinnant@gmail.com>
1455 * typeck.c (comptypes): Don't consider rvalue and lvalue
1456 reference types to be equivalent.
1457 (check_return_expr): Move from certain lvalues when returning
1459 * decl.c (grokdeclarator): Implement reference collapsing.
1460 (copy_fn_p): Don't consider constructors taking rvalue references
1461 to be copy constructors.
1463 * call.c (conversion): New "rvaluedness_matches_p" member.
1464 (convert_class_to_reference): Require reference type as first
1465 parameter instead of base type.
1466 (reference_binding): Add logic to handle rvalue references.
1467 (implicit_conversion): Update inaccurate comment.
1468 (convert_like_real): Disable creation of temporaries that are
1469 impossible to initialize for types with move constructors.
1470 (build_over_call): Elide move constructors when possible.
1471 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1472 (maybe_handle_ref_bind): Return conversion instead of type node.
1473 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1474 determine preferred conversion sequences.
1475 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1476 (LOOKUP_PREFER_RVALUE): New.
1477 (DECL_MOVE_CONSTRUCTOR_P): New.
1478 (struct cp_declarator): Add "reference" member for reference
1479 types, with new "rvalue_ref" flag.
1480 (cp_build_reference_type): Declare.
1481 (move_fn_p): Declare.
1482 * error.c (dump_type_prefix): Format rvalue reference types
1483 correctly in error messages.
1484 * except.c (build_throw): Move from certain lvalues when
1486 * mangle.c (write_type): Mangle rvalue references differently
1487 than regular references.
1488 * parser.c (make_reference_declarator): Add boolean parameter for
1490 (cp_parser_make_indirect_declarator): New.
1491 (cp_parser_new_declarator_opt): Call
1492 cp_parser_make_indirect_declarator.
1493 (cp_parser_conversion_declarator_opt): Ditto.
1494 (cp_parser_declarator): Ditto.
1495 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1497 * pt.c (tsubst): Implement reference collapsing.
1498 (maybe_adjust_types_for_deduction): Implement special template
1499 parameter deduction rule for rvalue references.
1500 (type_unification_real): Update calls to
1501 maybe_adjust_types_for_deduction.
1502 (try_one_overload): Ditto.
1503 (unify_pack_expansion): Ditto.
1504 * tree.c (lvalue_p_1): Handle rvalue reference types.
1505 (cp_build_reference_type): New.
1507 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1510 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1511 variables that need runtime initialization.
1513 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1516 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1517 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1518 case POSTDECREMENT_EXPR>): Return the error_mark_node
1519 if either the real or imaginary parts would an
1522 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1523 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1526 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1527 token is a closing brace, false if there are no tokens left.
1528 (cp_parser_namespace_alias_definition): Only consume the next token if
1529 it is a closing brace.
1531 * parser.c (cp_parser_class_specifier): Likewise.
1533 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1535 * semantics.c (finish_member_declaration): Fix a typo in the
1538 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1550 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1551 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1552 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1553 whether everything was okay. Fix indentation.
1554 (push_template_decl_real): Check for bare parameter packs in
1555 function parameters; where errors occur, mark the parameter types
1556 with ERROR_MARK_NODEs to avert ICEs.
1557 (coerce_template_parameter_pack): New.
1558 (coerce_template_parms): Moved parameter pack coercion into
1559 coerce_template_parameter_pack, and permit it anywhere in the
1560 template parameter list (not just at the end). Parameter and
1561 argument indices can vary (somewhat) separately now, so add
1562 PARM_IDX and ARG_IDX.
1563 (fn_type_unification): Don't set an argument pack as incomplete if
1564 no argument pack was deduced.
1565 (type_unification_real): If a type parameter is a parameter pack
1566 and has not otherwise been deduced, it will be deduced to an empty
1568 (more_specialized_fn): Use the actual lengths of the argument
1569 lists when comparing against expansions.
1570 * semantics.c (finish_member_declaration): If a field's type has
1571 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1573 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1576 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1578 2007-05-22 Ollie Wild <aaw@google.com>
1580 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1581 (unqualified_namespace_lookup): Adds check for hidden types.
1583 2007-05-22 Ollie Wild <aaw@google.com>
1585 * decl.c (duplicate_decls): Verify namespace names are unique.
1587 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1589 * decl.c (cxx_maybe_build_cleanup): Handle
1590 __attribute__((cleanup)).
1592 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1594 * cvt.c (cp_convert_and_check): Don't check warnings if the
1597 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1599 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1601 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1604 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1605 type only if is a class type (5.2.8/4).
1607 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1609 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1610 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1611 c_common_unsigned_type.
1613 2007-05-11 Silvius Rus <rus@google.com>
1615 * cp/typeck.c (build_indirect_ref): Add call to
1616 strict_aliasing_warning.
1617 (build_reinterpret_cast_1): Condition call to
1618 strict_aliasing_warning.
1620 2007-05-11 Jan Hubicka <jh@suse.cz>
1622 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1623 * decl2.c (start_objects): ctors and dtors are no longer public.
1624 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1626 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1628 * typeck.c (build_unary_op): Remove code that used to
1629 handle non lvalue increments/decrements.
1631 2007-05-07 Mike Stump <mrs@apple.com>
1633 * parser.c (check_empty_body): Add.
1634 (cp_parser_iteration_statement): Add call to check_empty_body.
1636 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1639 * mangle.c (write_mangled_name): Mangle static variable names.
1640 (write_unqualified_name): Use local-source-name for
1641 namespace-scope static variables.
1643 2007-05-04 Dirk Mueller <dmueller@suse.de>
1645 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1648 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1651 * decl2.c (constrain_class_visibility):
1652 Use strip_pointer_or_array_types instead of strip_array_types.
1654 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1657 * decl.c (reshape_init_r): Don't reshape the first element if it
1658 is a pointer to member function.
1660 2007-04-27 Simon Baldwin <simonb@google.com>
1662 * decl.c (grokparms): Changed message format from %qD to %qE.
1664 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1666 * error.c (maybe_warn_variadic_templates): Variadic templates are
1667 now in C++0x, so only warn about them in C++98 mode.
1669 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1672 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1673 integeral types from vectors types.
1675 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1678 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1679 for type dependent OMP_CLAUSE_DECLs.
1681 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1684 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1685 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1686 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1687 * init.c (build_zero_init): Adjust, as
1688 COMPLEX_TYPE is now a SCALAR_TYPE.
1689 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1690 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1692 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1694 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1695 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1696 (trait_expr_value): Adjust.
1698 2007-04-23 Simon Baldwin <simonb@google.com>
1700 * decl.c (grokparms): Added new error for duplicate function
1701 parameters names in function prototypes, to match gcc behavior.
1703 2007-04-23 Jan Hubicka <jh@suse.cz>
1705 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1708 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1710 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1711 instead of checking GIMPLE_STMT_P in chain_next.
1713 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1716 * call.c (convert_for_arg_passing): Convert bitfields to their
1719 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1722 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1724 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1727 * cp/decl2.c (constrain_class_visibility):
1728 Do not warn about the use of anonymous namespace in the main input file.
1730 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1732 * cp-tree.h (current_template_parms): Fix typo in comment.
1734 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1736 * cp-tree.h, error.c: Fix comment typos.
1738 2007-04-13 Jason Merrill <jason@redhat.com>
1741 * call.c (reference_binding): Add c_cast_p parm. If true,
1742 add quals to TO as needed to make it reference-compatible.
1744 2007-04-11 Jan Hubicka <jh@suse.cz>
1746 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1747 that we are not processing template_decl.
1749 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1752 * class.c (build_base_path): Ensure that the converted pointer has
1753 the same cv-qualification as the input.
1755 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1757 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1759 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1761 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1763 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1764 * tree.c (cp_add_pending_fn_decls): Remove.
1765 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1767 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1769 Revert change removing staticp.
1771 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1773 * cp-objcp-common.c (cxx_staticp): Remove.
1774 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1775 * cp-tree.h (cxx_staticp):
1777 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1779 * class.c (check_for_override): Don't remove dllmport attribute
1782 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1785 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1786 type issue error and return early.
1788 2007-03-30 Jason Merrill <jason@redhat.com>
1791 * typeck.c (cp_type_readonly): New fn.
1792 * cp-tree.h: Declare it.
1793 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1794 (cp_finish_decl): Not here.
1796 2007-03-31 Richard Guenther <rguenther@suse.de>
1798 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1801 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1806 * parser.c (declarator_can_be_parameter_pack): New.
1807 (cp_parser_template_parameter): Only parse the `...' if the
1808 declarator can be a parameter pack.
1809 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1811 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1812 types (they could be used as array bounds).
1813 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1814 (tsubst_pack_expansion): Handle failure to expand parameter
1817 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1820 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1821 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1822 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1823 (CLASS_TYPE_NON_UNION_P): Add.
1824 (struct lang_type_class): Add has_complex_dflt.
1825 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1826 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1827 * cp-tree.def: Add TRAIT_EXPR.
1828 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1829 * lex.c (struct resword): Add __has_nothrow_assign,
1830 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1831 __has_trivial_constructor, __has_trivial_copy,
1832 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1833 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1834 __is_pod, __is_polymorphic, __is_union.
1835 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1836 (cp_parser_trait_expr): New.
1837 * semantics.c (finish_trait_expr, trait_expr_value
1838 classtype_has_nothrow_copy_or_assign_p): New.
1839 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1841 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1842 * class.c (check_bases, check_field_decl, check_bases_and_members):
1843 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1844 * pt.c (uses_template_parms, tsubst_copy_and_build,
1845 value_dependent_expression_p, type_dependent_expression_p): Deal with
1847 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1849 2007-03-29 Richard Guenther <rguenther@suse.de>
1851 * tree.c (cp_walk_subtrees): Do not set input_location.
1853 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1856 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1859 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1861 * parser.c (struct cp_parser): Update comment for
1862 greater_than_is_operator_p.
1863 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1864 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1865 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1866 !GREATER_THAN_IS_OPERATOR_P.
1867 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1868 `>>' operators that will become two `>' tokens in C++0x.
1869 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1870 mode, allowing it to terminate default arguments.
1871 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1872 `>>' like two consecutive `>' tokens.
1873 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1874 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1875 ends a template argument.
1877 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1879 * decl.c (redeclaration_error_message): Complain when redeclaring
1880 a friend function with default template arguments (C++0x mode only).
1881 * cp-tree.h (check_default_tmpl_args): Declare.
1882 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1883 template arguments in function templates. Add support for checking
1884 the default template arguments of friend templates.
1885 (push_template_decl_real): Fix call to check_default_tmpl_args.
1886 (type_unification_real): If a template parameter has not been
1887 deduced but provides a default template argument, substitute into
1888 that default template argument.
1889 * parser.c (cp_parser_init_declarator): When declaring (but not
1890 defining!) a function template in C++0x mode, check for default
1893 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1896 * decl.c (grokdeclarator): Deal with cv-qualified function type
1897 typedefs in the same way for member and non-member functions.
1899 2007-03-26 Dirk Mueller <dmueller@suse.de>
1901 * parser.c (cp_parser_member_declaration): Pedwarn
1902 about stray semicolons after member declarations.
1904 2007-03-26 Paolo Carlini <pcarlini@suse.de>
1907 * pt.c (instantiate_decl): Set in_system_header.
1909 2007-03-22 Mark Mitchell <mark@codesourcery.com>
1911 * cp-tree.h (current_tempalte_parms): Improve documentation.
1912 * pt.c (current_template_args): Likewise.
1915 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1916 not consume tokens when failing.
1918 2007-03-22 Jim Wilson <wilson@specifix.com>
1919 Mark Mitchell <mark@codesourcery.com>
1922 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
1923 consistent with FROM.
1925 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1927 * error.c (dump_expr): Handle dependent names that designate types.
1928 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1930 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
1932 * cp-tree.def, parser.c, pt.c: Fix comment typos.
1934 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1936 * cvt.c (cp_convert_and_check) : Define.
1937 * cp-tree.h (cp_convert_and_check): Declare.
1938 * call.c (convert_conversion_warnings): Rename to
1939 conversion_null_warnings. The warning for floating-point to
1940 integer is handled by convert_and_check in convert_like_real.
1941 (convert_like_real): convert_conversion_warnings was renamed as
1942 conversion_null_warnings.
1943 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1944 overflow and changes of value during conversion.
1946 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1949 * parser.c (cp_parser_statement): If 'namespace' is found, this
1950 only can be a namespace alias definition, so parse it now.
1951 (cp_parser_namespace_alias_definition): if we find an open brace
1952 instead of '=', then this is actually a misplaced namespace
1955 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1958 * decl.c (cxx_init_decl_processing): Move command-line options
1959 processing to c-opts.c.
1961 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
1963 * ptree.c (cxx_print_type): Use formatting markup for integers
1964 when printing template parameter index/level/orig level.
1965 (cxx_print_xnode): Ditto.
1966 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1967 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1968 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1970 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1971 rather than a HOST_WIDE_INT.
1972 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1973 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1975 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1976 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1977 IN_BASE_INITIALIZER bool bitfields.
1978 (struct cp_declarator): Make KIND a 4-bit field. Make
1979 PARAMETER_PACK_P a bool bitfield just after KIND.
1980 * pt.c (uses_parameter_packs): Destroy the pointer set.
1981 (make_pack_expansion): Ditto.
1982 (check_for_bare_parameter_packs): Ditto.
1983 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1985 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
1988 * call.c (convert_default_arg): Instead of copying the node,
1991 2007-03-15 Dirk Mueller <dmueller@suse.de>
1994 * call.c (convert_conversion_warnings): New..
1995 (convert_like_real): .. factored out from here.
1996 (convert_conversion_warnings): Add warning about
1997 false being converted to NULL in argument passing.
1999 2007-03-14 Dirk Mueller <dmueller@suse.de>
2001 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
2002 (finish_do_body): Warn about empty body in do/while statement.
2004 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2006 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2008 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2011 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2014 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
2016 * cp/repo.c (init_repo): Initialize random_seed saved options.
2017 (finish_repo): Adjust.
2019 2007-03-13 Mark Mitchell <mark@codesourcery.com>
2022 * Make-lang.in (doc/g++.1): Use $< to specify the location from
2025 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
2027 * decl.c (compute_array_index_type): New warning flag warn_vla.
2029 2007-03-12 Mark Mitchell <mark@codesourcery.com>
2032 * call.c (convert_default_arg): Copy non-constant arguments.
2034 2007-03-11 Mark Mitchell <mark@codesourcery.com>
2037 * parser.c (cp_parser_postfix_expression): Disallow compound
2038 literals in constant expressions.
2041 * semantics.c (finish_typeof): Use unlowered_expr_type.
2043 2007-03-10 Mark Mitchell <mark@codesourcery.com>
2046 * cp-tree.h (unlowered_expr_type): New function.
2047 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2048 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2049 (unlowered_expr_type): New function.
2050 (build_unary_op): Disallow predecrements of bool bitfields.
2051 * call.c (build_conditional_expr): Use unlowered_expr_type.
2052 * pt.c (type_unification_real): Likewise.
2054 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
2057 * typeck.c (check_return_expr): Check for bare parameter packs.
2058 (comptypes): Compare template parameter packs and
2059 type pack expansions.
2060 * decl.c (grokdeclarator): Deal with the declaration of function
2062 (grokparms): Verify that the (optional) function parameter pack is
2063 at the end of the parameter list.
2064 (xref_basetypes): Handle pack expansions in the base class.
2065 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2066 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2067 (NONTYPE_ARGUMENT_PACK): New.
2068 (TYPE_PACK_EXPANSION): New.
2069 (EXPR_PACK_EXPANSION): New.
2070 (ARGUMENT_PACK_SELECT): New.
2071 * cp-objcp-common.c (cp_tree_size): Compute size of
2072 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2073 ARGUMENT_PACK_SELECT.
2074 * error.c (dump_template_argument): Print template argument packs.
2075 (dump_template_argument_list): Ditto.
2076 (dump_template_parameter): Dump `...' for template type parameter
2078 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2079 (dump_parameters): Print function parameter packs.
2080 (dump_template_parms): Print template argument packs.
2081 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2082 (maybe_warn_variadic_templates): New.
2083 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2084 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2085 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2087 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2088 (write_template_arg): Write argument packs as separate arguments.
2089 * cp-tree.h (struct template_parm_index_s): Add flag that
2090 indicates that the template parameter is actually a parameter
2092 (struct tree_argument_pack_select): New.
2093 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2094 (union lang_tree_node): Add argument_pack_select.
2095 (FUNCTION_PARAMETER_PACK_P): New.
2096 (PACK_EXPANSION_P): New.
2097 (PACK_EXPANSION_PATTERN): New.
2098 (SET_PACK_EXPANSION_PATTERN): New.
2099 (PACK_EXPANSION_PARAMETER_PACKS): New.
2100 (ARGUMENT_PACK_P): New.
2101 (ARGUMENT_PACK_ARGS): New.
2102 (SET_ARGUMENT_PACK_ARGS): New.
2103 (ARGUMENT_PACK_INCOMPLETE_P): New.
2104 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2105 (TEMPLATE_PARM_PARAMETER_PACK): New.
2106 (TEMPLATE_TYPE_PARAMETER_PACK): New.
2107 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2108 (ARGUMENT_PACK_SELECT_INDEX): New.
2109 (ARGUMENT_PACK_SELECT_ARG): New.
2110 (struct cp_declarator): Add parameter_pack_p flag.
2111 (maybe_warn_variadic_templates): Declare.
2112 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2113 indicate a template parameter pack.
2114 (uses_parameter_packs): Declare.
2115 (template_parameter_pack_p): Declare.
2116 (template_parms_variadic_p): Declare.
2117 (make_pack_expansion): Declare.
2118 (check_for_bare_parameter_packs): Declare.
2119 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2120 sizeof... expressions.
2121 (pp_cxx_expression): Print pack expansions and non-type argument
2123 (pp_cxx_exception_specification): Print pack expansions.
2124 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2125 (pp_cxx_ctor_initializer): Print pack expansions.
2126 (pp_cxx_type_id): Print pack expansions.
2127 (pp_cxx_template_argument_list): Print argument packs.
2128 (pp_cxx_template_parameter): Print ellipsis for template parameter
2130 * pt.c (comp_template_parms): Compare template parameter packs.
2131 (template_parameter_pack_p): New.
2132 (template_parms_variadic_p): New.
2133 (template_args_variadic_p): New.
2134 (make_ith_pack_parameter_name): New.
2135 (struct find_parameter_pack_data): New.
2136 (find_parameter_packs_r): New.
2137 (uses_parameter_packs): New.
2138 (make_pack_expansion): New.
2139 (check_for_bare_parameter_packs): New.
2140 (expand_template_argument_pack): New.
2141 (reduce_template_parm_level): Propagate parameter pack flag.
2142 (process_template_parm): Add is_parameter_pack parameter to state
2143 when the parameter is actually a parameter pack. Create template
2144 parameter packs when is_parameter_pack is true.
2145 (current_template_args): The argument for a template parameter
2146 pack is an argument pack containing a single pack expansion.
2147 (process_partial_specialization): When checking that non-type
2148 argument expressions do not involve template parameters, loop over
2149 the arguments in argument packs separately.
2150 (push_template_decl_real): Check that the type of the declaration
2151 does not have any bare parameter packs. Check that primary
2152 templates have no more than one parameter pack, and that it comes
2153 at the end of the template parameter list.
2154 (convert_template_argument): Handle coercions for pack expansion
2155 expressions by coercing the pattern then rebuilding the expansion.
2156 (coerce_template_parms): When coercing the arguments for a
2157 variadic template, pack "extra" arguments into an argument pack.
2158 (coerce_template_template_parms): Cannot coerce between parameter
2159 packs and non-pack parameters.
2160 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2161 (comp_template_args): Expand all template arguments packs before
2162 comparing template argument lists.
2163 (mangle_class_name_for_template): Make argument packs as separate
2165 (for_each_template_parm_r): No need to handle BASELINK.
2166 (instantiate_class_template): Handle pack expansions in the base
2168 (tsubst_pack_expansion): New.
2169 (tsubst_template_args): Handle substitutions of argument packs and
2170 pack expansion into template argument lists.
2171 (tsubst_decl): Expand function parameter packs into separate
2172 function parameters.
2173 (tsubst_arg_types): Expand a type pack expansion into separate
2175 (tsubst_exception_specification): Handle pack expansions in
2176 exception specifiers.
2177 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2178 replacing a template parameter with its argument. If we encounter
2179 a substitution for an argument pack, just return the parameter
2181 (tsubst_copy): sizeof(X...) returns the number of elements in
2182 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2183 PARM_DECL is a parameter pack.
2184 (tsubst_expr): Expression pack expansions and argument packs
2185 cannot show up here; they will all be handled through function
2186 calls, sizeof, and template argument lists.
2187 (tsubst_copy_and_build): sizeof(X...) returns the number of
2188 elements in parameter pack X. Handle pack expansions in TREE_LIST
2189 and CONSTRUCTOR nodes.
2190 (fn_type_unification): Handle "incomplete" explicit template
2191 argument lists that specify some of the arguments for a template
2193 (type_unification_real): Unify arguments against pack expansions.
2194 (template_parm_level_and_index): New, helper function.
2195 (unify_pack_expansion): New.
2196 (unify): Unify argument packs on an argument-by-argument basis,
2197 handling variadic argument packs as well.
2198 (more_specialized_fn): Handle unification of function parameter
2199 packs. All things being equal, prefer non-variadic function
2200 templates to variadic function templates.
2201 (more_specialized_class): Prefer the variadic class template
2202 partial specialization that binds fewer arguments to a parameter
2204 (regenerate_decl_from_template): Expand function parameter packs
2205 into separate parameters.
2206 (instantiate_decl): Ditto.
2207 (tsubst_initializer_list): Handle pack expansions for base-class
2209 (dependent_type_p_r): Determine dependent types in argument packs
2210 and pack expansions.
2211 (value_dependent_expression_p): Determine value-dependence of
2212 non-type argument packs.
2213 (dependent_template_arg_p): Handle argument packs.
2214 * semantics.c (finish_cond): Check for bare parameter packs.
2215 (finish_expr_stmt): Ditto.
2216 (finish_for_expr): Ditto.
2217 (finish_switch_cond): Ditto.
2218 (finish_mem_initializers): Ditto.
2219 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2221 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2222 * parser.c (make_declarator): Declarator is not an expansion.
2223 (make_pointer_declarator): Transfer parameter pack flag to outer
2225 (make_reference_declarator): Ditto.
2226 (make_ptrmem_declarator): Ditto.
2227 (make_call_declarator): Ditto.
2228 (make_array_declarator): Ditto.
2229 (cp_parser_postfix_expression): Allow pack expansion expressions
2230 in the argument list for a call expression.
2231 (cp_parser_parenthesized_expression_list): Add new parameter
2232 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2233 into separate arguments."
2234 (cp_parser_new_placement): Allow pack expansion expressions.
2235 (cp_parser_new_initializer): Ditto.
2236 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2237 base-class initializer expansion.
2238 (cp_parser_mem_initializer): Ditto.
2239 (cp_parser_template_parameter_list): Keep track of whether the
2240 template parameter is a template parameter pack.
2241 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2242 template parameter pack.
2243 (cp_parser_type_parameter): Ditto.
2244 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2246 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2247 this declarator is a parameter pack.
2248 (cp_parser_parameter_declaration): The ellipsis does not end the
2249 parameter declaration, because it might be a parameter pack. Parse
2250 the ellipsis to indicate a parameter pack.
2251 (cp_parser_initializer): Allow pack expansions.
2252 (cp_parser_initializer_list): Allow ellipsis to create an
2253 initializer expansion.
2254 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2256 (cp_parser_type_id_list): Allow ellipsis to create an exception
2257 specifier expansion.
2258 (cp_parser_attribute_list): Don't allow pack expansions.
2259 (cp_parser_functional_cast): Allow pack expansions.
2260 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2261 compute the length of a parameter pack.
2262 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2263 end a template argument.
2264 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2265 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2268 2007-03-09 Dirk Mueller <dmueller@suse.de>
2270 * cp/call.c (build_new_op): Call warn_logical_operator.
2272 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2275 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2278 * pt.c (any_template_arguments_need_structural_equality_p):
2281 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2283 * decl.c (grokdeclarator): Disable warnings for anonymous
2286 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2288 * typeck2.c (readonly_error): Always emit a hard error.
2289 Remove last argument.
2290 * cp-tree.h (readonly_error): Adjust prototype.
2291 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2292 * typeck.c (build_unary_op): Likewise.
2293 (build_modify_expr): Likewise.
2295 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2298 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2300 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2303 * parser.c (struct cp_parser): New IN_IF_STMT.
2304 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2305 returning if parsing the body of an 'if' statement or issuing an
2306 error and continuing.
2307 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2309 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2311 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2314 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2317 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2319 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2320 Objective-C++. Don't exit early if -shared-libgcc needs to be
2323 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2325 * typeck.c (common_base_type): Delete unused function.
2327 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2329 * Make-lang.in: Add dummy lang.install-pdf target.
2331 2007-03-01 Simon Baldwin <simonb@google.com>
2334 * decl.c (check_tag_decl): Added new warning for typedef ignored
2335 when it precedes an otherwise valid non-typedef declaration.
2337 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2339 * typeck.c (build_function_call): Store converted arguments
2340 in a stack-allocated array instead of building a list.
2341 (convert_arguments): Store arguments in the array passed in as an
2342 argument, and return the actual number of arguments.
2343 * call.c (build_call): Delete, and replace with...
2344 (build_call_n, build_call_a): New.
2345 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2346 (build_over_call): Store converted arguments in a stack-allocated
2347 array instead of building a list.
2348 (build_cxx_call): Pass arguments in an array instead of as a list.
2349 (build_java_interface_fn_ref): Rewrite to avoid constructing
2351 * tree.h: Update declarations to reflect above changes.
2352 * method.c (use_thunk): Use a stack-allocated array to hold
2353 the arguments instead of a list.
2354 * rtti.c (throw_bad_cast): Update call to cxx_call.
2355 (throw_bad_typeid): Likewise.
2356 (build_dynamic_cast_1): Likewise.
2357 * init.c (build_builtin_delete_call): Use build_call_n.
2358 * decl.c (expand_static_init): Likewise.
2359 * except.c (cp_protect_cleanup_actions): Likewise.
2360 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2361 (gimplify_must_not_throw_expr): Likewise.
2362 (cxx_omp_apply_fn): Use build_call_a.
2364 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2366 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2367 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2369 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2371 * cp-tree.h (static_ctors): Remove.
2372 * cp-tree.h (static_dtors): Likewise.
2373 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2374 refactoring of tree_map hierarchy.
2375 (decl_shadowed_for_var_insert): Likewise.
2376 * semantics.c (expand_body): Use c_expand_body.
2377 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2378 * decl2.c (static_ctors): Remove.
2379 (static_dtors): Likewise.
2380 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2381 objc_generate_static_init_call. Do not call static_[cd]tors.
2382 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2384 (cp_write_global_declarations): Likewise.
2386 2007-02-23 Richard Guenther <rguenther@suse.de>
2388 * class.c (note_name_declared_in_class): Make declaration
2389 changes meaning a pedwarn.
2391 2007-02-22 Michael Matz <matz@suse.de>
2394 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2395 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2396 dump_function_decl): Guard emitting outer scopes by new flag.
2397 * cp-lang.c (cxx_dwarf_name): New function.
2398 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2399 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2401 (push_template_decl_real, lookup_template_class): Remove calls
2404 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2406 * call.c (build_new_method_call): Ensure that explicit calls of
2407 destructors have type "void".
2409 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2411 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2412 and -Walways-true with -Waddress.
2413 * cvt.c (convert_to_void): Replace unconditional warning with
2416 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2418 * decl.c, tree.c: Fix comment typos.
2420 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2423 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2424 statement expression if we had an error mark node.
2426 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2427 Brooks Moses <brooks.moses@codesourcery.com>
2428 Lee Millward <lee.millward@codesourcery.com>
2430 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2431 Change class to tcc_vl_exp.
2433 * call.c (build_call): Use build_call_list instead
2435 (build_over_call): Likewise.
2436 (build_new_method_call): Use build_min_non_dep_call_list
2437 instead of build_min_non_dep.
2439 * error.c (dump_call_expr_args): New function.
2440 (dump_aggr_init_expr_args): New function.
2441 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2442 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2444 * cvt.c (convert_to_void): Use build_call_array instead
2445 of build3; use new AGGR_INIT_EXPR accessor macros.
2447 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2448 instead of TREE_CODE_LENGTH.
2450 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2451 AGGR_INIT_EXPR accessor macros.
2453 * cp-gimplify.c (cp_gimplify_init_expr): Use
2454 AGGR_INIT_EXPR_SLOT to set the slot operand.
2456 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2457 (AGGR_INIT_EXPR_SLOT): New macro.
2458 (AGGR_INIT_EXPR_ARG): New macro.
2459 (aggr_init_expr_nargs): New macro.
2460 (AGGR_INIT_EXPR_ARGP): New macro.
2461 (aggr_init_expr_arg_iterator): New.
2462 (init_aggr_init_expr_arg_iterator): New.
2463 (next_aggr_init_expr_arg): New.
2464 (first_aggr_init_expr_arg): New.
2465 (more_aggr_init_expr_args_p): New.
2466 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2467 (stabilize_aggr_init): New declaration.
2468 (build_min_non_dep_call_list): Likewise.
2470 * tree.c (process_aggr_init_operands): New function.
2471 (build_aggr_init_array) New function.
2472 (build_cplus_new): Update to use new CALL_EXPR and
2473 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2474 build_aggr_init_array.
2475 (build_min_non_dep_call_list) New function.
2476 (build_min_nt): Assert input code parameter is not a variable
2477 length expression class.
2478 (build_min, build_min_non_dep): Likewise.
2479 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2480 to check for equality instead of recursing. Handle tcc_vl_exp
2482 (stabilize_call): Update to only handle CALL_EXPRs, not
2483 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2484 (stabilize_aggr_init): New function.
2485 (stabilize_init): Use it.
2487 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2488 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2489 AGGR_INIT_EXPR accessor macros and argument iterators.
2491 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2492 build_vl_exp. Iterate through the operands, recursively
2493 processing each one.
2494 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2495 CALL_EXPR accessor macros.
2496 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2497 tree code classes. Use TREE_OPERAND_LENGTH instead of
2500 * semantics.c (finish_call_expr): Use build_nt_call_list
2501 instead of build_nt.
2502 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2503 accessor macros. Use build_call_array to construct the
2504 CALL_EXPR node instead of build3
2506 * decl2.c (build_offset_ref_call_from_tree): Use
2507 build_nt_call_list and build_min_non_dep_call_list instead
2508 of build_min_nt and build_min_non_dep.
2510 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2511 Use build_nt_call_list instead of build_min_nt.
2513 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2516 * call.c (build_conditional_expr): Improve error message.
2518 2007-02-13 Dirk Mueller <dmueller@suse.de>
2520 * friend.c (do_friend): Annotate warning about friend
2521 declarations in templates with OPT_Wnon_template_friend.
2522 Convert informal message from warning() to inform().
2524 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2525 Mark Mitchell <mark@codesourcery.com>
2528 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2529 instantiations for variables.
2531 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2534 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2535 Check warn_unused_value just once.
2537 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2540 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2541 (fn_type_unificiation): Likewise.
2542 (get_bindings): Likewise.
2544 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2547 * decl.c (finish_function): Use DECL_REPLACEABLE.
2548 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2550 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2552 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2554 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2556 * decl.c (grokvardecl): Don't error if !have_tls.
2557 (grokdeclarator): Likewise.
2558 * parser.c (cp_parser_omp_threadprivate): Likewise.
2560 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2563 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2564 parameters and result decls in omp clauses.
2565 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2568 2007-02-05 Dirk Mueller <dmueller@suse.de>
2571 * parser.c (cp_parser_class_specifier): Always initialize bases.
2573 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2575 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2576 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2577 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2579 * semantics.c (finish_omp_atomic): Store a whole expression node
2580 in operand 1, and integer_zero_node in operand 0, for dependent
2581 OMP_ATOMIC. Rewrite to make flow easier to understand.
2583 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2585 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2587 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2589 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2590 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2592 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2594 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2595 keyword warning to -Wc++0x-compat.
2597 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2599 * decl.c (grokdeclarator): Update documentation.
2601 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2604 * decl.c (grokdeclarator): If __thread is used together with
2605 a storage class other than extern and static, clear thread_p
2606 after issuing diagnostics and fall through to checking the
2609 2007-01-30 Roger Sayle <roger@eyesopen.com>
2611 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2612 calculating the size of an array (to avoid recursive errors).
2614 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2617 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2619 * call.c (convert_like_real): Don't warn when converting to
2622 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2624 * decl.c (pop_label): Replace warning with call to
2625 warn_for_unused_label.
2627 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2630 * semantics.c (finish_pseudo_destructor_expr): Check the
2631 destrutor name by calling check_dtor_name.
2633 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2635 * lex.c (D_CPP0X): Rename.
2637 (reswords): D_CPP0X -> D_CXX0X.
2638 (init_reswords): Ditto.
2639 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2640 of C++0x keywords as identifiers.
2642 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2645 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2648 2007-01-23 Ian Lance Taylor <iant@google.com>
2650 * typeck.c (convert_for_assignment): Only warn about a = b = c
2651 when converting to bool.
2653 2007-01-23 Roger Sayle <roger@eyesopen.com>
2655 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2657 * typeck.c (ignore_overflows): Remove the remaining uses of
2658 TREE_CONSTANT_OVERFLOW.
2660 2007-01-20 Jan Hubicka <jh@suse.cz>
2662 * decl2.c (start_objects, start_static_storage_duration_function):
2663 Do not make the functions uninlinable.
2665 2007-01-17 Ian Lance Taylor <iant@google.com>
2667 * class.c (add_method): Call VEC_reserve_exact rather than passing
2668 a negative size to VEC_reserve.
2670 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2673 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2675 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2678 * decl.c (make_typename_type): If the qualified name is not a
2679 type, issue an error.
2680 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2683 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2685 * rtti.c: Include target.h.
2686 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2687 don't emit typeinfo for fundamental types as weak.
2688 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2690 2007-01-08 Richard Guenther <rguenther@suse.de>
2692 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2694 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2696 * call.c (standard_conversion): Pass flag to
2697 vector_types_convertible_p to disallow emission of note.
2698 * typeck.c (convert_for_assignment): Pass flag to
2699 vector_types_convertible_p to allow emission of note.
2700 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2701 to disallow emission of note.
2703 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2706 * typeck.c (build_binary_op): Call overflow_warning if
2707 TREE_OVERFLOW_P is true for the result and not for any of the
2710 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2713 * class.c (add_method): Don't wait until template
2714 instantiation time to complain about duplicate methods.
2716 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2719 * semantics.c (finish_unary_op_expr): Warn only if result
2720 overflowed and operands did not.
2722 2007-01-05 Ian Lance Taylor <iant@google.com>
2724 * typeck.c (build_binary_op): Warn about comparing a non-weak
2727 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2729 * pt.c (tsubst): Propagate the need for structural equality checks
2730 when reducing the level of template parameters.
2732 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2734 * pt.c: Fix a comment typo.
2736 2007-01-02 Ian Lance Taylor <iant@google.com>
2738 * semantics.c (maybe_convert_cond): Optionally warn when using an
2739 assignment as a condition.
2740 * typeck.c (convert_for_assignment): Optionally warn about
2741 assigning the result of an assignment to a bool.
2743 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2745 * pt.c (canonical_template_parms): Correct typo in comment.
2747 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2749 * typeck.c (structural_comptypes): Renamed from "comptypes".
2750 (comptypes): Use canonical type information to perform fast type
2751 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2752 canonical type comparison returns the same results as we would see
2753 from the current, structural check. Support COMPARE_STRUCTURAL
2754 when we need structural checks.
2755 * decl.c (typename_compare): Fix comment.
2756 (build_typename_type): TYPENAME_TYPE nodes require structural
2757 equality checks, because they resolve different based on the
2759 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2760 require structural equality checks (for now).
2761 (build_ptrmemfunc_type): Build the canonical pointer to member
2763 (compute_array_index_type): Whenever we build a new index type
2764 to represent the size of an array in a template, we need to mark
2765 this index type as requiring structural equality. This goes for
2766 arrays with value-dependent sizes with the current ABI, or all
2768 * tree.c (cplus_array_hash): New.
2769 (struct cplus_array_info): New.
2770 (cplus_array_compare): New.
2771 (cplus_array_htab): New.
2772 (build_cplus_array_type_1): Use a hash table to cache the array
2773 types we build. Build the canonical array type for each array
2775 (cp_build_qualified_type_real): When building a cv-qualified array
2776 type, use the hash table of array types and build canonical array
2778 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2779 use structural equality (for now).
2780 * cp-tree.h (COMPARE_STRUCTURAL): New.
2781 * pt.c (canonical_template_parms): New.
2782 (canonical_type_parameter): New.
2783 (process_template_parm): Find the canonical type parameter.
2784 (lookup_template_class): When we have named the primary template
2785 type, set the canonical type for our template class to the primary
2786 template type. If any of the template arguments need structural
2787 equality checks, the template class needs structural equality
2789 (tsubst): When reducing the level of a template template
2790 parameter, we require structural equality tests for the resulting
2791 parameter because its template parameters have not had their types
2792 canonicalized. When reducing a template type parameter, find the
2793 canonical reduced type parameter.
2794 (any_template_arguments_need_structural_equality_p): New.