1 2007-11-05 Jakub Jelinek <jakub@redhat.com>
4 * decl.c (grokdeclarator): Don't call build_memfn_type if type
5 is neither FUNCTION_TYPE nor METHOD_TYPE.
7 2007-11-02 Jakub Jelinek <jakub@redhat.com>
10 * parser.c (cp_parser_nested_name_specifier_opt): Use
11 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
12 typedef of currently open class.
14 2007-11-02 Paolo Carlini <pcarlini@suse.de>
17 * error.c (dump_expr): Deal specially with statements.
19 2007-11-01 Jason Merrill <jason@redhat.com>
22 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
24 (lookup_template_class): Use it to get the outer template args
25 for instantiating one.
28 * pt.c (reduce_template_parm_level): tsubst the parameters
29 of a template template parm.
31 2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
34 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
36 2007-11-01 Jakub Jelinek <jakub@redhat.com>
39 * parser.c (cp_parser_postfix_dot_deref_expression): If
40 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
41 first and if that succeeds and type is SCALAR_TYPE_P, create
45 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
46 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
47 as for std::type_info.
49 2007-10-31 Paolo Carlini <pcarlini@suse.de>
52 * cxx-pretty-print.c (pp_cxx_typeid_expression,
53 pp_cxx_delete_expression): Change to static linkage.
54 * cxx-pretty-print.h: Adjust declarations.
55 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
56 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
57 MODOP_EXPR): Forward to pp_expression.
59 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
62 2007-10-31 Christian Bruel <christian.bruel@st.com>
63 Mark Mitchell <mark@codesourcery.com>
66 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
67 if retval is volatile.
69 2007-10-30 Jakub Jelinek <jakub@redhat.com>
72 * decl2.c (build_offset_ref_call_from_tree): Call
73 build_non_dependent_expr on object prior to building ADDR_EXPR from it
74 if FN is DOTSTAR_EXPR.
76 2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
80 * pt.c (find_parameter_packs_r): Fix typo in comment.
81 (convert_template_argument): Look at the pattern of a pack
82 expansion to determine what kind of entity we're converting.
83 (coerce_template_parameter_pack): When we have coerced a non-type
84 template parameter pack, substitute into the type of that pack.
85 (tsubst_pack_expansion): When our substitution of a parameter pack
86 is a "trivial" substitution of itself, just substitute into the
87 pack expansion rather than actually expanding.
89 2007-10-29 Jakub Jelinek <jakub@redhat.com>
92 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
93 for non-integral type bitfields. Return true if bitfield is correct, false
94 error has been diagnosed.
95 (check_field_decls): If check_bitfield_decl returned false, call also
98 2007-10-28 Paolo Carlini <pcarlini@suse.de>
99 Mark Mitchell <mark@codesourcery.com>
102 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
103 class member error out and return.
105 2007-10-27 Jakub Jelinek <jakub@redhat.com>
107 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
108 to current_function_decl rather than 0.
111 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
113 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
115 2007-10-27 Jason Merrill <jason@redhat.com>
118 * call.c (convert_default_arg): Detect recursion.
120 2007-10-27 Jakub Jelinek <jakub@redhat.com>
123 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
124 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
126 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
128 * error.c (dump_expr): Handle OFFSETOF_EXPR.
130 2007-10-26 Jason Merrill <jason@redhat.com>
133 * pt.c (get_template_info): New fn.
134 (template_class_depth): Use it.
135 (push_template_decl_real): Check that the template args of the
136 definition match the args of the previous declaration.
138 2007-10-26 Paolo Carlini <pcarlini@suse.de>
141 * decl2.c (coerce_new_type): Do not allow a default argument for
144 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
147 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
148 don't see the leading '('. Only lookup names if we get an
151 2007-10-26 Jakub Jelinek <jakub@redhat.com>
154 * parser.c (cp_parser_parenthesized_expression_list): Set
155 greater_than_is_operator_p to true in between the parens.
157 2007-10-26 Paolo Carlini <pcarlini@suse.de>
160 * decl.c (grokdeclarator): In case of conflicting specifiers
161 just return error_mark_node.
163 2007-10-26 Ollie Wild <aaw@google.com>
165 * expr.c (cxx_expand_expr): Removed.
166 * cp-tree.h (exx_expand_expr): Removed.
167 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
170 2007-10-25 Paolo Carlini <pcarlini@suse.de>
173 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
175 2007-10-23 Jason Merrill <jason@redhat.com>
177 PR c++/25950 (DR 391)
178 * call.c (struct conversion): Remove check_copy_constructor_p.
179 (reference_binding): Always bind a reference directly to a
180 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
182 (check_constructor_callable): Remove.
183 (convert_like_real): Don't call it.
184 (initialize_reference): Don't call check_constructor_callable.
185 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
186 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
187 conversions if LOOKUP_NO_TEMP_BIND.
188 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
189 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
191 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
193 2007-10-22 Jakub Jelinek <jakub@redhat.com>
196 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
197 before checking if its type is integral.
199 2007-10-22 Jason Merrill <jason@redhat.com>
202 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
203 * pt.c (apply_late_template_attributes): Splice out dependent
204 attributes from DECL_ATTRIBUTES.
206 * decl.c (cxx_maybe_build_cleanup): Use build_address.
208 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
210 * typeck.c (build_binary_op) : Use appropriate warning option
211 instead of unnamed warning.
213 2007-10-16 Paolo Carlini <pcarlini@suse.de>
216 * pt.c (current_template_args): Do not change TREE_LIST elements
217 with a TREE_VALUE of error_mark_node.
219 2007-10-16 Mark Mitchell <mark@codesourcery.com>
221 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
222 * decl.c (start_decl): Tidy.
223 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
225 (grokdeclarator): Clarify comment.
227 2007-10-14 Andrew Pinski <pinskia@gmail.com>
230 * decl.c (grokfndecl): Return NULL after the "definition of
231 implicitly-declared" error happened.
233 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
236 * call.c (build_user_type_conversion_1): Do not consider conversion
237 functions to convert a (possibly cv-qualified) object to the (possibly
238 cv-qualified) same object type (or a reference to it), to a (possibly
239 cv-qualified) base class of that type (or a reference to it).
241 2007-10-12 Paolo Carlini <pcarlini@suse.de>
243 * pt.c (tsubst): Use template_parm_level_and_index.
245 2007-10-12 Jakub Jelinek <jakub@redhat.com>
248 * parser.c (cp_parser_compound_statement): Handle label-declarations
249 at the beginning of the compound statement.
250 (cp_parser_block_declaration): Issue diagnostics about __label__
251 not at the beginning of a block.
253 2007-10-11 Paolo Carlini <pcarlini@suse.de>
256 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
257 to convert_template_argument.
258 (coerce_template_parms): Return error_mark_node after fixed-length
260 (tsubst_decl): Check for error_mark_node the return value of the
261 first tsubst in 'case VAR_DECL'.
263 2007-10-08 Ollie Wild <aaw@google.com>
265 * typeck2.c (digest_init): Call cplus_expand_constant after
266 convert_for_initialization.
267 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
268 * expr.c (cplus_expand_constant): Updated function description.
270 2007-10-04 Jason Merrill <jason@redhat.com>
273 * call.c (initialize_reference): Handle local static reference
276 2007-10-03 Jason Merrill <jason@redhat.com>
279 * name-lookup.c (push_namespace_with_attrs): Fold back into...
280 (push_namespace): Here.
281 (handle_namespace_attrs): New fn for the attr code.
282 (leave_scope): Don't pop_visibility.
283 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
284 * parser.c (cp_parser_namespace_definition): Call
285 handle_namespace_attrs and pop_visibility as appropriate.
288 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
290 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
292 * decl.c (duplicate_decls): Preserve linkage flags for mere
293 redeclarations of gnu_inline definitions.
295 2007-10-03 Jason Merrill <jason@redhat.com>
298 * decl.c (wrap_cleanups_r): New fn.
299 (wrap_temporary_cleanups): New fn.
300 (initialize_local_var): Call it.
302 2007-09-29 Jason Merrill <jason@redhat.com>
305 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
306 constant to not have DECL_EXTERNAL if it's file-local.
308 2007-09-28 Ollie Wild <aaw@google.com>
311 2007-09-27 Ollie Wild <aaw@google.com>
313 * typeck2.c (digest_init): Call cplus_expand_constant after
314 convert_for_initialization.
315 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
316 * expr.c (cplus_expand_constant): Updated function description.
318 2007-09-28 Jason Merrill <jason@redhat.com>
321 * class.c (layout_empty_base): Take rli parameter, update
322 rli->record_align if empty base has user-specified alignment.
323 (build_base_field): Pass rli to it.
325 2007-09-28 Paolo Carlini <pcarlini@suse.de>
328 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
330 2007-09-28 Paolo Carlini <pcarlini@suse.de>
333 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
334 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
335 (dump_parameters): Just call dump_type for argument packs too.
337 2007-09-28 Jakub Jelinek <jakub@redhat.com>
340 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
341 qualification by creating qualified PACK_EXPANSION_PATTERN and
342 then calling make_pack_expansion on it.
344 2007-09-27 Ollie Wild <aaw@google.com>
346 * typeck2.c (digest_init): Call cplus_expand_constant after
347 convert_for_initialization.
348 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
349 * expr.c (cplus_expand_constant): Updated function description.
351 2007-09-27 Jason Merrill <jason@redhat.com>
354 * decl2.c (is_late_template_attribute): Don't crash on unknown
357 2007-09-27 Paolo Carlini <pcarlini@suse.de>
360 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
361 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
362 spaces in the formatting.
363 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
365 2007-09-27 Jakub Jelinek <jakub@redhat.com>
367 * error.c (cxx_print_error_function): Add third argument, pass
368 it over to lhd_print_error_function.
369 (cp_print_error_function): If diagnostic->abstract_origin, print
371 * cp-tree.h (struct diagnostic_info): New forward decl.
372 (cxx_print_error_function): Add third argument.
374 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
377 * name-lookup.c (pushtag): Do not create an implicit typedef before
378 the associated type declaration is known to be valid.
380 2007-09-25 Jakub Jelinek <jakub@redhat.com>
382 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
383 rather than pointers.
385 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
388 * search.c (check_final_overrider): Fail if
389 targetm.comp_type_attributes returns 0.
391 2007-09-24 Jason Merrill <jason@redhat.com>
394 * pt.c (resolve_typename_type): Don't look things up in the original
395 template if it would mean losing template arguments.
397 2007-09-24 Jakub Jelinek <jakub@redhat.com>
400 * cp-tree.h (cxx_type_hash_eq): New prototype.
401 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
402 * tree.c (cxx_type_hash_eq): New function.
404 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
407 * tree.c (cp_build_qualified_type_real): Build a canonical
408 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
410 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
414 * tree.c (cplus_array_compare): Compare pointers, not types.
415 (build_cplus_array_type_1): Store new array type into the hash
416 table before building the canonical type; build the canonical type
418 (cp_build_qualified_type_real): Put all of the array types with
419 cv-qualified element types into the C++ array hash table, built as
420 variants of the unqualified versions.
422 2007-09-23 Jason Merrill <jason@redhat.com>
425 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
426 for deprecation warnings.
428 2007-09-22 Jason Merrill <jason@redhat.com>
431 * call.c (build_over_call): Warn about deprecated virtuals.
434 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
435 (MAYBE_TAGGED_TYPE_P): Remove.
436 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
437 instead of calling is_late_template_attribute again.
438 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
439 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
440 Don't crash on typedefs from non-template classes.
441 * decl2.c (grokfield): Don't sorry about attrs on template parms.
442 (is_late_template_attribute): All attributes applied to template
443 parms or typename types are dependent. Static.
444 (splice_template_attributes): Pass decl through.
445 (save_template_attributes): Likewise.
447 2007-09-20 Jakub Jelinek <jakub@redhat.com>
450 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
451 returned from tsubst_pack_expansion.
452 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
453 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
455 2007-09-20 Paolo Carlini <pcarlini@suse.de>
458 * semantics.c (finish_id_expression): Use consistently
459 context_for_name_lookup.
460 * decl.c (fixup_anonymous_aggr): Fix error message for
461 anonymous struct (vs union).
463 2007-09-19 Jason Merrill <jason@redhat.com>
466 * pt.c (tsubst): Handle typedefs by looking for the specialization.
467 (retrieve_specialization): Only tagged types use
468 DECL_TEMPLATE_INSTANTIATIONS.
469 (instantiate_class_template): Push nested classes too.
470 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
472 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
473 * init.c (is_aggr_type): Remove redundant tests.
474 * class.c (push_nested_class): Use CLASS_TYPE_P.
476 2007-09-20 Paolo Carlini <pcarlini@suse.de>
479 * init.c (build_zero_init): If, recursively, build_zero_init
480 returns a NULL_TREE, do not append it to the VEC of constructors.
482 2007-09-18 Jason Merrill <jason@redhat.com>
485 * pt.c (apply_late_template_attributes): Set processing_template_decl.
486 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
487 ATTR_FLAG_TYPE_IN_PLACE.
488 (tsubst): Do unqualified lookup to find typedefs from current class.
489 [ARRAY_TYPE]: Propagate alignment info.
490 * decl2.c (is_late_template_attribute): Only defer handling of
491 attribute aligned if the expression is dependent.
492 (save_template_attributes): If we're deferring any attributes,
493 make this a naming typedef.
495 2007-09-18 Paolo Carlini <pcarlini@suse.de>
498 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
499 va_arg instead of __builtin_va_arg.
501 2007-09-18 Paolo Carlini <pcarlini@suse.de>
504 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
505 (pp_cxx_primary_expression): Use it.
506 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
507 * error.c (dump_expr): Use it.
509 2007-09-18 Paolo Carlini <pcarlini@suse.de>
512 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
513 out case TYPEID_EXPR to...
514 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
515 and pp_cxx_right_paren.
516 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
517 * error.c (dump_expr): Use it.
519 2007-09-18 Paolo Carlini <pcarlini@suse.de>
522 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
523 (pp_cxx_primary_expression): Use it.
524 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
525 * error.c (dump_expr): Use it.
527 2007-09-16 Paolo Carlini <pcarlini@suse.de>
530 * init.c (build_new): Remove warning for zero-element
533 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
536 * call.c (maybe_handle_implicit_object): Set this_p, clear
537 rvaluedness_matches_p.
538 (compare_ics): Do not compare rvaluedness matching when one of the
539 operands is an implicit object.
541 2007-09-14 Jason Merrill <jason@redhat.com>
543 PR c++/17743, c++/19163
544 * decl2.c (is_late_template_attribute): New fn.
545 (splice_template_attributes, save_template_attributes): New fns.
546 (cplus_decl_attributes): Call save_template_attributes.
547 * pt.c (apply_late_template_attributes): New fn.
548 (instantiate_class_template, tsubst_decl): Use it.
549 * cp-tree.h: Declare is_late_template_attribute.
551 2007-09-13 Tom Tromey <tromey@redhat.com>
553 * parser.c (cp_lexer_new_main): Don't use
554 c_lex_return_raw_strings.
555 (cp_lexer_get_preprocessor_token): Update. Add special case when
558 2007-09-11 Jan Hubicka <jh@suse.cz>
560 * method.c (use_thunk): Use tree_rest_of_compilation
561 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
562 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
563 * cp-tree.h (expand_body): Kill.
564 (emit_associated_thunks): Declare.
565 * semantics.c (emit_associated_thunks): Export.
568 2007-09-09 David Daney <ddaney@avtrex.com>
571 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
572 to calculate cookie_ptr.
574 2007-09-08 Jason Merrill <jason@redhat.com>
577 * pt.c (most_specialized_class): Set processing_template_decl
578 while tsubsting partial spec args.
580 2007-09-06 Jason Merrill <jason@redhat.com>
582 * decl2.c (get_guard): Copy visibility from the guarded variable.
584 2007-09-06 Jan Hubicka <jh@suse.cz>
586 * semantics.c (expand_body): Do not mark arguments of clones used.
588 2007-09-06 Paolo Carlini <pcarlini@suse.de>
591 * decl.c (cp_finish_decl): When processing_template_decl,
592 deal correctly with init as TREE_LIST.
594 2007-09-06 Tom Tromey <tromey@redhat.com>
596 * decl.c (finish_function): Put return's location on line zero of
599 2007-09-05 Jason Merrill <jason@redhat.com>
602 * except.c (prepare_eh_type): Use type_decays_to.
605 * init.c (build_delete): Use build_headof to get the address of the
606 complete object if we aren't using the deleting destructor.
607 * rtti.c (build_headof): No longer static.
608 * cp-tree.h: Declare it.
610 2007-09-06 Jakub Jelinek <jakub@redhat.com>
612 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
613 decl if a prototype for XX is provided with throw().
616 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
617 on __*_chk non-__builtin_* decls.
619 2007-09-05 Paolo Carlini <pcarlini@suse.de>
622 * semantics.c (finish_id_expression): Use context_for_name_lookup
623 insted of DECL_CONTEXT, to see through anonymous structs and unions.
624 * class.c (finish_struct_anon): Deal correctly with anonymous
625 structs (vs unions, as GNU extension) in error messages.
627 2007-09-05 Jan Hubicka <jh@suse.cz>
629 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
630 call, DECL_EXTERNAL checks and current_function_decl saving.
632 2007-09-05 Paolo Carlini <pcarlini@suse.de>
635 * parser.c (cp_parser_primary_expression): Return error_mark_node
636 when a statement-expression is found in a template-argument list.
638 2007-09-04 Jason Merrill <jason@redhat.com>
640 * except.c (initialize_handler_parm): Use
641 fold_build_cleanup_point_expr.
644 * call.c (reference_binding): Don't look for user-defined conversions
648 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
649 the MUST_NOT_THROW_EXPR.
651 2007-09-04 Richard Sandiford <richard@codesourcery.com>
653 * decl.c (cp_finish_decl): Call determine_visibility before
654 make_rtl_for_nonlocal_decl.
656 2007-09-04 Jason Merrill <jason@redhat.com>
659 * pt.c (most_specialized_class): Substitute outer template
660 arguments into the arguments of a member template partial
662 (strip_innermost_template_args): New fn.
664 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
666 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
668 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
670 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
671 * decl.c (cp_make_fname_decl): Likewise,
672 * parser.c (cp_parser_string_literal): Likewise,
673 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
674 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
677 2007-09-02 Paolo Carlini <pcarlini@suse.de>
680 * typeck.c (build_unary_op): Fix error message for
681 Boolean expression as operand to operator--.
683 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
685 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
686 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
689 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
692 * init.c (build_default_init): Make extern.
693 * cp-tree.h (build_default_init): Declare here.
694 * pt.c (tsubst_expr): When the instantiation of the initializer of
695 a variable results in an empty list, default-initialize the
697 (tsubst_copy_and_build): When the instantiation of the initializer
698 in a new expression results in an empty initializer list,
699 default-initialize it.
701 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
703 * mangle.c (write_type): Change mangling of rvalue reference from
706 2007-08-31 Jakub Jelinek <jakub@redhat.com>
708 * decl.c (duplicate_decls): Remove duplicated line.
710 2007-08-31 Paolo Carlini <pcarlini@suse.de>
713 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
714 BOUND_TEMPLATE_TEMPLATE_PARM.
716 2007-08-31 Paolo Carlini <pcarlini@suse.de>
719 * search.c (lookup_member): Check the name argument for
722 2007-08-31 Paolo Carlini <pcarlini@suse.de>
725 * parser.c (cp_parser_trait_expr): Check rerurn value of
728 2007-08-30 Ollie Wild <aaw@google.com>
730 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
731 convert_ptrmem for pointer to member conversions.
732 (convert_to_pointer_force): Update cp_convert_to_pointer call.
733 (ocp_convert): Update cp_convert_to_pointer call.
734 * typeck.c (convert_ptrmem): Add conditional for null pointers to
736 (build_static_cast_1): Check can_convert for conversions in either
738 (get_delta_difference_1): New function.
739 (get_delta_difference): Refactor to call get_delta_difference_1.
741 2007-08-30 Jakub Jelinek <jakub@redhat.com>
743 * decl.c (start_preparsed_function): Set
744 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
746 2007-08-28 Paolo Carlini <pcarlini@suse.de>
749 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
750 BOUND_TEMPLATE_TEMPLATE_PARM.
752 2007-08-28 Jakub Jelinek <jakub@redhat.com>
756 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
757 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
759 2007-08-27 Jason Merrill <jason@redhat.com>
762 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
763 Look inside STMT_EXPR.
764 * semantics.c (stmt_expr_value_expr): New fn.
765 * cp-tree.h: Declare it.
768 * decl.c (groktypename): Ignore attributes applied to class type.
770 2007-08-28 Richard Guenther <rguenther@suse.de>
772 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
774 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
776 * error.c (dump_expr): Handle COMPLEX_CST.
777 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
778 (pp_cxx_expression): Likewise.
780 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
782 * decl.c (GNU_INLINE_P): New.
783 (duplicate_decls): Handle gnu_inline. Merge attributes and
784 some flags in overriding definitions.
785 (redeclaration_error_message): Handle gnu_inline.
786 (start_preparsed_function): Likewise.
788 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
790 * call.c (sufficient_parms_p): Constify.
791 * class.c (same_signature_p): Likewise.
792 * cp-gimplify.c (is_invisiref_parm,
793 cxx_omp_privatize_by_reference): Likewise.
794 * cp-objcp-common.c (has_c_linkage): Likewise.
795 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
796 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
797 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
798 num_artificial_parms_for, comp_template_parms,
799 template_parameter_pack_p, any_dependent_template_arguments_p,
800 any_type_dependent_arguments_p, any_value_dependent_elements_p,
801 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
802 zero_init_p, member_p, cp_lvalue_kind,
803 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
804 varargs_function_p, is_dummy_object, special_function_kind,
805 string_conv_p, type_unknown_p, comp_except_specs, compparms,
806 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
807 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
808 cp_has_mutable_p, at_least_as_qualified_p,
809 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
810 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
811 * except.c (nothrow_libfn_p): Likewise.
812 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
814 * pt.c (comp_template_parms, template_parameter_pack_p,
815 any_type_dependent_arguments_p, any_value_dependent_elements_p,
816 any_dependent_template_arguments_p): Likewise.
817 * repo.c (repo_export_class_p): Likewise.
818 * semantics.c (anon_aggr_type_p): Likewise.
819 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
820 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
821 varargs_function_p, member_p, is_dummy_object, pod_type_p,
822 zero_init_p, special_function_p): Likewise.
823 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
824 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
825 compparms, invalid_nonstatic_memfn_p,
826 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
827 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
828 cp_has_mutable_p, lvalue_or_else): Likewise.
830 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
832 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
833 * cp-objcp-common.c (cp_tree_size): Ditto.
834 * tree.c (cp_walk_subtrees): Ditto
835 * cp-tree.def (TINST_LEVEL): Go away.
836 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
837 move together with other non-tree structs.
838 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
839 (union lang_tree_node): Eliminate tinst_level field.
840 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
841 (current_instantiation, outermost_tinst_level): Return
842 a "struct tinst_level *".
844 * error.c (print_instantiation_partial_context): Change second
845 parameter to a "struct tinst_level *". Replace accessor macros
847 (print_instantiation_full_context): Likewise.
848 * lex.c (in_main_input_context): Likewise.
850 * pt.c (struct pending_templates): New.
851 (pending_templates, last_pending_template): Use it as a type.
852 (current_tinst_level): Change typo to "struct tinst_level *"
853 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
854 (add_pending_template): Construct a "struct pending_template".
855 Replace TINST_LEVEL accessor macros with field access.
856 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
857 (pop_tinst_level): Likewise.
858 (instantiate_pending_templates): Likewise. Factor common code used
859 when an instantiation has been done.
860 (outermost_tinst_level): Replace tree_last with loop.
861 (current_instantiation): Return a "struct tinst_level *".
863 2007-08-24 Ollie Wild <aaw@google.com>
865 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
866 * name-lookup.h (cp_binding_level): Remove vtables member.
868 2007-08-24 Richard Guenther <rguenther@suse.de>
870 * tree.c (cp_cannot_inline_tree_fn): Remove.
871 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
872 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
875 2007-08-24 Jakub Jelinek <jakub@redhat.com>
878 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
879 error_mark_node right away if build_expr_type_conversion
883 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
884 is error_mark_node rather than NULL_TREE.
885 * pt.c (check_explicit_specialization): Likewise.
888 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
889 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
891 2007-08-22 Jason Merrill <jason@redhat.com>
894 * pt.c (outermost_tinst_level): New function.
895 * lex.c (in_main_input_context): New function.
896 * cp-tree.h: Declare it.
897 * decl2.c (constrain_class_visibility): Use it to avoid warning
898 about uses of the anonymous namespace in the main input file.
900 2007-08-21 Jakub Jelinek <jakub@redhat.com>
902 * init.c (build_new_1): Use get_target_expr instead of save_expr.
904 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
907 * class.c (finish_struct_1): Warn when a class has virtual
908 functions and accessible non-virtual destructor.
910 2007-08-20 Richard Guenther <rguenther@suse.de>
914 * call.c (build_new_method_call): Convert initializer to
916 * init.c (build_aggr_init): Do not fiddle with types.
917 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
918 * except.c (build_throw): Do not drop qualifiers for the
920 * typeck.c (get_member_function_from_ptrfunc): Do not
921 fiddle with types, instead convert.
922 (build_ptrmemfunc1): Convert to the target type for
924 (gfc_trans_allocate): Convert result to target type.
925 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
926 pointer-to-member structures shall have alias set zero as well.
928 2007-08-20 Richard Guenther <rguenther@suse.de>
930 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
932 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
933 (nonstatic_local_decl_p): Likewise.
934 * tree.c (cp_auto_var_in_fn_p): Remove.
935 * decl.c (nonstatic_local_decl_p): Remove.
937 2007-08-20 Richard Guenther <rguenther@suse.de>
939 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
941 * tree.h (cp_walk_tree): New define to walk_tree_1 with
942 cp_walk_subtrees lh parameter.
943 (cp_walk_tree_without_duplicates): New define to
944 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
945 * tree.c (count_trees): Call
946 cp_walk_tree_without_duplicates.
947 (verify_stmt_tree): Call cp_walk_tree.
948 (break_out_target_exprs): Likewise.
949 (WALK_SUBTREE): Likewise.
950 * cp-gimplify.c (cp_genericize): Likewise.
951 * cp-pt.c (find_parameter_packs_r): Likewise.
952 (uses_parameter_packs): Likewise.
953 (make_pack_expansion): Likewise.
954 (check_for_bare_parameter_packs): Likewise.
955 (for_each_template_parm): Likewise.
956 * decl.c (check_default_argument): Call
957 cp_walk_tree_without_duplicates.
958 * except.c (build_throw): Likewise.
959 * decl2.c (type_visibility): Likewise.
960 * semantics.c (expand_or_defer_fn): Likewise.
961 (finalize_nrv): Call cp_walk_tree.
963 2007-08-20 Jakub Jelinek <jakub@redhat.com>
966 * init.c (build_new_1): Rename placement_var variable to placement_expr.
967 Initialize it with save_expr rather than get_temp_regvar.
969 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
972 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
975 2007-08-17 Ollie Wild <aaw@google.com>
978 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
979 declarations into appropriate slots for comparison. Fix type
982 2007-08-17 Paolo Carlini <pcarlini@suse.de>
985 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
986 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
988 2007-08-17 Paolo Carlini <pcarlini@suse.de>
991 * parser.c (cp_parser_class_head): Improve error message.
993 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
995 * pt.c (instantiate_decl): Set input_location
996 for the function end.
998 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1000 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
1002 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
1003 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
1004 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
1005 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1006 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
1007 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
1008 * typeck.c (cp_type_quals): Likewise.
1009 * typeck2.c (cxx_incomplete_type_diagnostic,
1010 cxx_incomplete_type_error): Likewise.
1012 2007-08-16 Paolo Carlini <pcarlini@suse.de>
1015 * pt.c (tsubst_friend_function): When check_classfn
1016 returns error_mark_node likewise return it.
1018 2007-08-15 Jakub Jelinek <jakub@redhat.com>
1021 * typeck.c (check_return_expr): Don't NRV optimize vars in
1023 * decl.c (finish_function): Comment fix.
1025 2007-08-15 Paolo Carlini <pcarlini@suse.de>
1028 * pt.c (push_template_decl_real): Depending on TYPE_P
1029 use either TYPE_CONTEXT or DECL_CONTEXT.
1031 2007-08-14 Mark Mitchell <mark@codesourcery.com>
1033 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
1034 constructors and destructors return this.
1036 2007-08-14 Paolo Carlini <pcarlini@suse.de>
1039 * decl2.c (check_classfn): Return error_mark_node in case of error;
1040 in that case, do not call add_method.
1041 * decl.c (start_decl): Deal with check_classfn returning
1043 (grokfndecl): Likewise.
1044 * pt.c (tsubst_friend_function): Likewise.
1046 2007-08-14 Andrew Pinski <pinskia@gmail.com>
1049 * typeck.c (build_binary_op): Disallow vector float types with
1050 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
1052 2007-08-11 Ian Lance Taylor <iant@google.com>
1054 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
1056 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
1058 2007-08-10 Ollie Wild <aaw@google.com>
1060 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
1062 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
1064 (unqualified_namespace_lookup): Fix ambiguous_decl call.
1065 (lookup_using_namespace): Fix ambiguous_decl call.
1066 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
1068 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1070 * call.c (name_as_c_string): Use CONST_CAST.
1071 * decl.c (build_decl): Likewise.
1072 * parser.c (cp_parser_string_literal): Likewise.
1074 2007-08-10 Paolo Carlini <pcarlini@suse.de>
1077 * error.c (dump_expr): Consistently use the *_cxx_*
1078 variants of the pretty-print functions.
1080 2007-08-10 Paolo Carlini <pcarlini@suse.de>
1083 * decl.c (check_special_function_return_type): Just error
1084 on return type specified for conversion operator.
1086 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
1088 * typeck2.c (readonly_error): Handle general expressions.
1089 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
1091 2007-08-06 Dan Hipschman <dsh@google.com>
1093 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
1094 access function name.
1096 2007-08-04 Alfred Minarik <a.minarik@aon.at>
1099 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
1100 * g++spec.c (lang_specific_driver): Check them.
1102 2007-08-06 Paolo Carlini <pcarlini@suse.de>
1105 * pt.c (inline_needs_template_parms): Fix comment; change return type
1108 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
1111 2007-03-26 Dirk Mueller <dmueller@suse.de>
1113 * parser.c (cp_parser_member_declaration): Pedwarn
1114 about stray semicolons after member declarations.
1116 2007-08-02 Lee Millward <lee.millward@gmail.com>
1121 * parser.c (cp_parser_asm_definition): Detect and discard asm
1122 statements with invalid inputs or outputs.
1123 (cp_parser_asm_operand_list): Return error mark node if any
1124 of the operands are invalid. Adjust documentation.
1126 2007-08-02 Nick Clifton <nickc@redhat.com>
1128 * typeck.c: Change copyright header to refer to version 3 of the
1129 GNU General Public License and to point readers at the COPYING3
1130 file and the FSF's license web page.
1131 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1132 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1133 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1134 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1135 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1136 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1137 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1138 name-lookup.h, parser.c: Likewise.
1140 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1143 * call.c (magic_varargs_p): Honor the "type generic" attribute.
1145 2007-07-30 Paolo Carlini <pcarlini@suse.de>
1148 * semantics.c (finish_label_stmt): Reject the __label__
1149 extension outside function scopes.
1151 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1153 * parser.c (eof_token): Un-constify.
1154 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1155 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1158 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
1160 * pt.c, tree.c, typeck2.c: Fix comment typos.
1162 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
1163 Mark Mitchell <mark@codesourcery.com>
1166 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1167 hidden due to friend declarations in local classes.
1169 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
1171 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1172 * cp-tree.def (DECLTYPE_TYPE): New.
1173 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1174 (dump_type_prefix): Ditto.
1175 (dump_type_suffix): Ditto.
1176 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1177 * mangle.c (write_type): Handle DECLTYPE_TYPE.
1178 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1180 (DECLTYPE_TYPE_EXPR): New.
1181 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1182 (finish_declared_type): Declare.
1183 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1184 DECLTYPE_TYPE nodes.
1185 (pp_cxx_type_id): Ditto.
1186 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1187 (tsubst): Substitute into a DECLTYPE_TYPE node.
1188 (tsubst_copy): Ditto.
1189 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1191 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1192 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1193 structural equality (because we can't hash the expressions).
1194 (finish_declared_type): New.
1195 * lex.c (reswords): Add "decltype" keyword.
1196 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1197 (cp_parser_postfix_expression): Add member_access_only_p to
1198 restrict postfix expression to member access expressions.
1199 (cp_parser_unary_expression): Update call to
1200 cp_parser_postfix_expression to reflect new parameter.
1201 (cp_parser_declared_type): New.
1202 (cp_parser_simple_type_specifier): Parse decltype types.
1204 2007-07-27 Mark Mitchell <mark@codesourcery.com>
1207 * call.c (convert_for_arg_passing): Only widen bitfields to their
1208 declared types if necessary.
1210 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1212 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1215 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1217 * decl.c (typename_hash, typename_compare): Constify.
1218 * mangle.c (hash_type, compare_type): Likewise.
1219 * pt.c (eq_local_specializations, hash_local_specialization):
1221 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1222 list_hash): Likewise.
1223 * typeck2.c (pat_compare): Likewise.
1225 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
1227 * method.c (implicitly_declare_fn): Increase alignment if member
1228 function pointer format requires it.
1230 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1233 * typeck.c (check_return_expr): Do not pass a null argument
1236 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1239 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1242 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1245 * typeck.c (convert_arguments): Only use default args if we have
1249 * typeck.c (structural_comptypes): No need to check
1250 resolve_typename_type return value here.
1251 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1252 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1253 original type rather than error_mark_node in case of failure.
1254 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1255 resolve_typename_type result check.
1256 (cp_parser_direct_declarator, cp_parser_head,
1257 cp_parser_constructor_declarator_p): Likewise.
1259 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1261 * pt.c (template_parms_variadic_p): Remove.
1262 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1264 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1267 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1268 argument to dump_aggr_init_expr_args instead of false.
1270 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1272 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1273 canonical types; otherwise, fall back to structural type
1274 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1275 internal compiler error if the canonical types are wrong.
1277 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1280 * parser.c (cp_parser_make_indirect_declarator): When the
1281 the code argument is ERROR_MARK return cp_error_declarator.
1283 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1286 * decl.c (cxx_init_decl_processing): Don't set
1287 force_align_functions_log.
1288 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1289 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1290 FUNCTION_DECL, return its alignment.
1292 2007-07-09 Richard Guenther <rguenther@suse.de>
1294 * decl.c (start_preparsed_function): Do not promote return type.
1296 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1299 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1301 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1304 * pt.c (resolve_overloaded_unification): Robustify. Return a
1306 (type_unification_real): Adjust accordingly.
1308 2007-07-06 Richard Guenther <rguenther@suse.de>
1310 * init.c (build_new_1): Use the correct pointer type.
1311 * typeck2.c (build_m_component_ref): Likewise.
1313 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1316 * init.c (build_zero_init): Always build an initializer for
1318 * typeck2.c (build_functional_cast): Use build_zero_init.
1321 * init.c (build_new_1): Always pass the allocation function to
1322 build_op_delete_call.
1323 * call.c (build_op_delete_call): Handle operator delete with a
1324 variable-argument list. Do not issue an error when no matching
1325 deallocation function is available for a new operator.
1328 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1329 * decl.c (value_dependent_init_p): New function.
1330 (cp_finish_decl): Use it.
1331 * pt.c (value_dependent_expression_p): Use
1332 any_value_dependent_elements_p.
1333 * parser.c (cp_parser_primary_expression): Add comment about
1334 treating dependent qualified names as integral
1335 constant-expressions.
1337 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1339 * decl.c (build_ptrmemfunc_type): Always use structural equality
1340 tests when comparing pointer-to-member-function types, because the
1341 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1344 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1346 * init.c (build_new): Tweak comment.
1348 2007-06-29 Dave Brolley <brolley@redhat.com>
1351 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1352 type to its base type and number of elements here.
1353 * init.c (build_new): Call complete_type_or_else to ensure that the
1354 type is complete and to issue a diagnostic if it is not.
1355 (build_new_1): Don't call complete_type_or_else here.
1357 2007-07-03 Richard Guenther <rguenther@suse.de>
1360 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1363 2007-07-02 Simon Baldwin <simonb@google.com>
1365 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1366 for inner-style nested forward declarations that don't declare
1369 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1372 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1373 DECL_P in not a variable and appears more than once error messages.
1375 2007-07-01 Ollie Wild <aaw@google.com>
1377 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1378 (select_decl): Remove function.
1379 (unqualified_namespace_lookup): Populate binding by calling
1380 ambiguous_decl. Remove select_decl call.
1381 (lookup_qualified_name): Remove select_decl call.
1382 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1383 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1384 generation when name lookup is ambiguous.
1386 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1389 * init.c (build_new_1): Use structural equality on the copy of the
1392 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1394 * decl2.c (determine_visibility): Implement
1395 flag_visibility_ms_compat effect on type info.
1396 * decl.c (cxx_init_decl_processing): Implement
1397 global effect of flag_visibility_ms_compat.
1399 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1401 * decl2.c (start_objects): Mark constructor-running function
1404 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1407 * decl.c (grokdeclarator): Reset friendp for member functions declared
1408 friend of their own class.
1410 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1412 * decl2.c (determine_visibility): Don't look for dllexport here.
1413 (determine_visibility_from_class): Tidy.
1415 2007-06-18 Simon Baldwin <simonb@google.com>
1418 * parser.c (cp_parser_single_declaration): Added check for storage
1419 class other than sc_none in parsed declaration, and a flag to indicate
1420 if the call is part of an explicit template specialization parse.
1421 * (cp_parser_explicit_specialization): Specialization check flag added
1422 to call to cp_parser_single_declaration(), set true.
1423 * (cp_parser_template_declaration_after_export): Specialization check
1424 flag added to call to cp_parser_single_declaration(), set false.
1425 * pt.c (check_explicit_specialization): Added code to copy visiblity
1426 and linkage from the templated function to the explicit specialization.
1428 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1430 * typeck.c (build_binary_op): For templates build the
1431 expression in pieces to avoid the assert in build2_stat.
1432 (get_member_function_from_ptrfunc):
1433 Change over to using POINTER_PLUS_EXPR and convert
1434 the second operand to sizetype.
1435 * typeck2.c (build_m_component_ref): Likewise.
1436 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1437 instead of PLUS_EXPR for pointers.
1438 (build_new_1): Likewise.
1439 (build_vec_delete_1): Likewise.
1440 (build_vec_delete): Likewise.
1441 * class.c (build_base_path): Likewise.
1442 (build_base_path): Likewise.
1443 (convert_to_base_statically): Likewise.
1444 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1445 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1446 instead of PLUS_EXPR.
1447 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1448 instead of PLUS_EXPR for pointers.
1449 * call.c (build_special_member_call): Likewise.
1450 * rtti.c (build_headof): Likewise.
1451 Use sizetype instead of ptrdiff_type_node.
1452 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1453 instead of PLUS_EXPR for pointers.
1454 * except.c (expand_start_catch_block): Do a
1455 NEGATIVE and then a POINTER_PLUS_EXPR instead
1457 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1458 PLUS_EXPR on pointer types over to use
1459 POINTER_PLUS_EXPR and remove the conversion
1460 to the pointer types.
1461 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1462 adding to a pointer type. Use size_int instead of
1463 ssize_int. Convert the index to sizetype before
1464 adding it to the pointer.
1466 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1468 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1469 (DECL_ANON_UNION_VAR_P): New macro.
1470 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1471 than DECL_VAR_MARKED_P, to keep track of which variables we have
1473 * decl.c (redeclaration_error_message): Complain about redeclaring
1474 anonymous union members at namespace scope.
1475 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1477 2007-06-14 Geoff Keating <geoffk@apple.com>
1479 * decl2.c (determine_visibility): Ensure that functions with
1480 hidden types as parameters are hidden.
1483 * decl2.c (determine_visibility): Remove duplicate code for
1486 2007-06-12 Ian Lance Taylor <iant@google.com>
1489 * init.c (avoid_placement_new_aliasing): New static function.
1490 (build_new_1): Call it.
1492 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1494 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1495 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1497 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1500 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1501 on init, the non-decl cond operand and increment value.
1503 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1506 * decl.c (check_initializer): Report an error when a brace enclosed
1507 initializer is used for a non-aggregate type in C++98.
1508 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1510 (grokdeclarator): Likewise.
1511 (move_fn_p): Likewise.
1512 * typeck.c (check_return_expr): Likewise.
1513 * call.c (reference_binding): Likewise.
1514 * error.c (cp_cpp_error): Likewise.
1515 * pt.c (check_default_tmpl_args): Likewise.
1517 * lex.c (init_reswords): Likewise.
1518 * parser.c (p_parser_primary_expression): Likewise.
1519 (TOKEN_PRECEDENCE): Likewise.
1520 (cp_parser_init_declarator): Likewise.
1521 (cp_parser_ptr_operator): Likewise.
1522 (cp_parser_parameter_declaration): Likewise.
1523 (cp_parser_enclosed_template_argument_list): Likewise.
1524 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1525 (cp_parser_next_token_ends_template_argument_p): Likewise.
1527 2007-06-04 Simon Baldwin <simonb@google.com>
1529 * decl.c (grokdeclarator): Readability change. Moved case labels
1530 into direct switch statement scope.
1532 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1534 * call.c (convert_like_real): Remove pointless code.
1536 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1538 * decl.c (get_atexit_fn_ptr_type): New function.
1539 (get_atexit_node): Use it.
1540 (start_cleanup_fn): Likewise.
1541 (register_dtor_fn): Use the object's destructor, instead of a
1542 separate cleanup function, where possible.
1543 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1544 (atexit_fn_ptr_type_node): New macro.
1545 * decl2.c (build_cleanup): Use build_address.
1547 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1549 * typeck.c (build_binary_op): Include types in error.
1551 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1554 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1555 needs runtime initialization.
1557 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1560 * semantics.c (finish_trait_expr): Complete the types.
1562 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1563 Douglas Gregor <doug.gregor@gmail.com>
1564 Pedro Lamarao <pedro.lamarao@mndfck.org>
1565 Howard Hinnant <howard.hinnant@gmail.com>
1569 * typeck.c (comptypes): Don't consider rvalue and lvalue
1570 reference types to be equivalent.
1571 (check_return_expr): Move from certain lvalues when returning
1573 * decl.c (grokdeclarator): Implement reference collapsing.
1574 (copy_fn_p): Don't consider constructors taking rvalue references
1575 to be copy constructors.
1577 * call.c (conversion): New "rvaluedness_matches_p" member.
1578 (convert_class_to_reference): Require reference type as first
1579 parameter instead of base type.
1580 (reference_binding): Add logic to handle rvalue references.
1581 (implicit_conversion): Update inaccurate comment.
1582 (convert_like_real): Disable creation of temporaries that are
1583 impossible to initialize for types with move constructors.
1584 (build_over_call): Elide move constructors when possible.
1585 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1586 (maybe_handle_ref_bind): Return conversion instead of type node.
1587 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1588 determine preferred conversion sequences.
1589 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1590 (LOOKUP_PREFER_RVALUE): New.
1591 (DECL_MOVE_CONSTRUCTOR_P): New.
1592 (struct cp_declarator): Add "reference" member for reference
1593 types, with new "rvalue_ref" flag.
1594 (cp_build_reference_type): Declare.
1595 (move_fn_p): Declare.
1596 * error.c (dump_type_prefix): Format rvalue reference types
1597 correctly in error messages.
1598 * except.c (build_throw): Move from certain lvalues when
1600 * mangle.c (write_type): Mangle rvalue references differently
1601 than regular references.
1602 * parser.c (make_reference_declarator): Add boolean parameter for
1604 (cp_parser_make_indirect_declarator): New.
1605 (cp_parser_new_declarator_opt): Call
1606 cp_parser_make_indirect_declarator.
1607 (cp_parser_conversion_declarator_opt): Ditto.
1608 (cp_parser_declarator): Ditto.
1609 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1611 * pt.c (tsubst): Implement reference collapsing.
1612 (maybe_adjust_types_for_deduction): Implement special template
1613 parameter deduction rule for rvalue references.
1614 (type_unification_real): Update calls to
1615 maybe_adjust_types_for_deduction.
1616 (try_one_overload): Ditto.
1617 (unify_pack_expansion): Ditto.
1618 * tree.c (lvalue_p_1): Handle rvalue reference types.
1619 (cp_build_reference_type): New.
1621 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1624 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1625 variables that need runtime initialization.
1627 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1630 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1631 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1632 case POSTDECREMENT_EXPR>): Return the error_mark_node
1633 if either the real or imaginary parts would an
1636 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1637 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1640 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1641 token is a closing brace, false if there are no tokens left.
1642 (cp_parser_namespace_alias_definition): Only consume the next token if
1643 it is a closing brace.
1645 * parser.c (cp_parser_class_specifier): Likewise.
1647 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1649 * semantics.c (finish_member_declaration): Fix a typo in the
1652 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1664 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1665 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1666 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1667 whether everything was okay. Fix indentation.
1668 (push_template_decl_real): Check for bare parameter packs in
1669 function parameters; where errors occur, mark the parameter types
1670 with ERROR_MARK_NODEs to avert ICEs.
1671 (coerce_template_parameter_pack): New.
1672 (coerce_template_parms): Moved parameter pack coercion into
1673 coerce_template_parameter_pack, and permit it anywhere in the
1674 template parameter list (not just at the end). Parameter and
1675 argument indices can vary (somewhat) separately now, so add
1676 PARM_IDX and ARG_IDX.
1677 (fn_type_unification): Don't set an argument pack as incomplete if
1678 no argument pack was deduced.
1679 (type_unification_real): If a type parameter is a parameter pack
1680 and has not otherwise been deduced, it will be deduced to an empty
1682 (more_specialized_fn): Use the actual lengths of the argument
1683 lists when comparing against expansions.
1684 * semantics.c (finish_member_declaration): If a field's type has
1685 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1687 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1690 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1692 2007-05-22 Ollie Wild <aaw@google.com>
1694 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1695 (unqualified_namespace_lookup): Adds check for hidden types.
1697 2007-05-22 Ollie Wild <aaw@google.com>
1699 * decl.c (duplicate_decls): Verify namespace names are unique.
1701 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1703 * decl.c (cxx_maybe_build_cleanup): Handle
1704 __attribute__((cleanup)).
1706 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1708 * cvt.c (cp_convert_and_check): Don't check warnings if the
1711 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1713 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1715 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1718 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1719 type only if is a class type (5.2.8/4).
1721 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1723 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1724 * decl.c (grokdeclarator): Use unsigned_type_for instead of
1725 c_common_unsigned_type.
1727 2007-05-11 Silvius Rus <rus@google.com>
1729 * cp/typeck.c (build_indirect_ref): Add call to
1730 strict_aliasing_warning.
1731 (build_reinterpret_cast_1): Condition call to
1732 strict_aliasing_warning.
1734 2007-05-11 Jan Hubicka <jh@suse.cz>
1736 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
1737 * decl2.c (start_objects): ctors and dtors are no longer public.
1738 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
1740 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
1742 * typeck.c (build_unary_op): Remove code that used to
1743 handle non lvalue increments/decrements.
1745 2007-05-07 Mike Stump <mrs@apple.com>
1747 * parser.c (check_empty_body): Add.
1748 (cp_parser_iteration_statement): Add call to check_empty_body.
1750 2007-05-05 Geoffrey Keating <geoffk@apple.com>
1753 * mangle.c (write_mangled_name): Mangle static variable names.
1754 (write_unqualified_name): Use local-source-name for
1755 namespace-scope static variables.
1757 2007-05-04 Dirk Mueller <dmueller@suse.de>
1759 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
1762 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
1765 * decl2.c (constrain_class_visibility):
1766 Use strip_pointer_or_array_types instead of strip_array_types.
1768 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1771 * decl.c (reshape_init_r): Don't reshape the first element if it
1772 is a pointer to member function.
1774 2007-04-27 Simon Baldwin <simonb@google.com>
1776 * decl.c (grokparms): Changed message format from %qD to %qE.
1778 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
1780 * error.c (maybe_warn_variadic_templates): Variadic templates are
1781 now in C++0x, so only warn about them in C++98 mode.
1783 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
1786 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
1787 integeral types from vectors types.
1789 2007-04-26 Jakub Jelinek <jakub@redhat.com>
1792 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
1793 for type dependent OMP_CLAUSE_DECLs.
1795 2007-04-24 Mark Mitchell <mark@codesourcery.com>
1798 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
1799 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
1800 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
1801 * init.c (build_zero_init): Adjust, as
1802 COMPLEX_TYPE is now a SCALAR_TYPE.
1803 * typeck2.c (digest_init): Allow brace-enclosed initializers for
1804 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
1806 2007-04-25 Paolo Carlini <pcarlini@suse.de>
1808 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
1809 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
1810 (trait_expr_value): Adjust.
1812 2007-04-23 Simon Baldwin <simonb@google.com>
1814 * decl.c (grokparms): Added new error for duplicate function
1815 parameters names in function prototypes, to match gcc behavior.
1817 2007-04-23 Jan Hubicka <jh@suse.cz>
1819 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
1822 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
1824 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
1825 instead of checking GIMPLE_STMT_P in chain_next.
1827 2007-04-17 Mark Mitchell <mark@codesourcery.com>
1830 * call.c (convert_for_arg_passing): Convert bitfields to their
1833 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
1836 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
1838 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
1841 * cp/decl2.c (constrain_class_visibility):
1842 Do not warn about the use of anonymous namespace in the main input file.
1844 2007-04-15 Mark Mitchell <mark@codesourcery.com>
1846 * cp-tree.h (current_template_parms): Fix typo in comment.
1848 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
1850 * cp-tree.h, error.c: Fix comment typos.
1852 2007-04-13 Jason Merrill <jason@redhat.com>
1855 * call.c (reference_binding): Add c_cast_p parm. If true,
1856 add quals to TO as needed to make it reference-compatible.
1858 2007-04-11 Jan Hubicka <jh@suse.cz>
1860 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
1861 that we are not processing template_decl.
1863 2007-04-09 Mark Mitchell <mark@codesourcery.com>
1866 * class.c (build_base_path): Ensure that the converted pointer has
1867 the same cv-qualification as the input.
1869 2007-04-09 Paolo Carlini <pcarlini@suse.de>
1871 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
1873 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
1875 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
1877 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
1878 * tree.c (cp_add_pending_fn_decls): Remove.
1879 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
1881 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
1883 Revert change removing staticp.
1885 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
1887 * cp-objcp-common.c (cxx_staticp): Remove.
1888 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1889 * cp-tree.h (cxx_staticp):
1891 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
1893 * class.c (check_for_override): Don't remove dllmport attribute
1896 2007-04-03 Jakub Jelinek <jakub@redhat.com>
1899 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1900 type issue error and return early.
1902 2007-03-30 Jason Merrill <jason@redhat.com>
1905 * typeck.c (cp_type_readonly): New fn.
1906 * cp-tree.h: Declare it.
1907 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1908 (cp_finish_decl): Not here.
1910 2007-03-31 Richard Guenther <rguenther@suse.de>
1912 * optimize.c (maybe_clone_body): Replace splay-tree usage by
1915 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
1920 * parser.c (declarator_can_be_parameter_pack): New.
1921 (cp_parser_template_parameter): Only parse the `...' if the
1922 declarator can be a parameter pack.
1923 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1925 * pt.c (find_parameter_packs_r): Look into the bounds on integer
1926 types (they could be used as array bounds).
1927 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1928 (tsubst_pack_expansion): Handle failure to expand parameter
1931 2007-03-30 Paolo Carlini <pcarlini@suse.de>
1934 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1935 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1936 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1937 (CLASS_TYPE_NON_UNION_P): Add.
1938 (struct lang_type_class): Add has_complex_dflt.
1939 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1940 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1941 * cp-tree.def: Add TRAIT_EXPR.
1942 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1943 * lex.c (struct resword): Add __has_nothrow_assign,
1944 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1945 __has_trivial_constructor, __has_trivial_copy,
1946 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1947 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1948 __is_pod, __is_polymorphic, __is_union.
1949 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1950 (cp_parser_trait_expr): New.
1951 * semantics.c (finish_trait_expr, trait_expr_value
1952 classtype_has_nothrow_copy_or_assign_p): New.
1953 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1955 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1956 * class.c (check_bases, check_field_decl, check_bases_and_members):
1957 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1958 * pt.c (uses_template_parms, tsubst_copy_and_build,
1959 value_dependent_expression_p, type_dependent_expression_p): Deal with
1961 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1963 2007-03-29 Richard Guenther <rguenther@suse.de>
1965 * tree.c (cp_walk_subtrees): Do not set input_location.
1967 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
1970 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1973 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1975 * parser.c (struct cp_parser): Update comment for
1976 greater_than_is_operator_p.
1977 (cp_parser_primary_expression): In C++0x mode, a cast operator can
1978 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1979 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1980 !GREATER_THAN_IS_OPERATOR_P.
1981 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1982 `>>' operators that will become two `>' tokens in C++0x.
1983 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1984 mode, allowing it to terminate default arguments.
1985 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1986 `>>' like two consecutive `>' tokens.
1987 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1988 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1989 ends a template argument.
1991 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1993 * decl.c (redeclaration_error_message): Complain when redeclaring
1994 a friend function with default template arguments (C++0x mode only).
1995 * cp-tree.h (check_default_tmpl_args): Declare.
1996 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1997 template arguments in function templates. Add support for checking
1998 the default template arguments of friend templates.
1999 (push_template_decl_real): Fix call to check_default_tmpl_args.
2000 (type_unification_real): If a template parameter has not been
2001 deduced but provides a default template argument, substitute into
2002 that default template argument.
2003 * parser.c (cp_parser_init_declarator): When declaring (but not
2004 defining!) a function template in C++0x mode, check for default
2007 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2010 * decl.c (grokdeclarator): Deal with cv-qualified function type
2011 typedefs in the same way for member and non-member functions.
2013 2007-03-26 Dirk Mueller <dmueller@suse.de>
2015 * parser.c (cp_parser_member_declaration): Pedwarn
2016 about stray semicolons after member declarations.
2018 2007-03-26 Paolo Carlini <pcarlini@suse.de>
2021 * pt.c (instantiate_decl): Set in_system_header.
2023 2007-03-22 Mark Mitchell <mark@codesourcery.com>
2025 * cp-tree.h (current_tempalte_parms): Improve documentation.
2026 * pt.c (current_template_args): Likewise.
2029 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
2030 not consume tokens when failing.
2032 2007-03-22 Jim Wilson <wilson@specifix.com>
2033 Mark Mitchell <mark@codesourcery.com>
2036 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
2037 consistent with FROM.
2039 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
2041 * error.c (dump_expr): Handle dependent names that designate types.
2042 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
2044 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
2046 * cp-tree.def, parser.c, pt.c: Fix comment typos.
2048 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2050 * cvt.c (cp_convert_and_check) : Define.
2051 * cp-tree.h (cp_convert_and_check): Declare.
2052 * call.c (convert_conversion_warnings): Rename to
2053 conversion_null_warnings. The warning for floating-point to
2054 integer is handled by convert_and_check in convert_like_real.
2055 (convert_like_real): convert_conversion_warnings was renamed as
2056 conversion_null_warnings.
2057 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
2058 overflow and changes of value during conversion.
2060 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2063 * parser.c (cp_parser_statement): If 'namespace' is found, this
2064 only can be a namespace alias definition, so parse it now.
2065 (cp_parser_namespace_alias_definition): if we find an open brace
2066 instead of '=', then this is actually a misplaced namespace
2069 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2072 * decl.c (cxx_init_decl_processing): Move command-line options
2073 processing to c-opts.c.
2075 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
2077 * ptree.c (cxx_print_type): Use formatting markup for integers
2078 when printing template parameter index/level/orig level.
2079 (cxx_print_xnode): Ditto.
2080 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
2081 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
2082 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
2084 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
2085 rather than a HOST_WIDE_INT.
2086 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
2087 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
2089 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
2090 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
2091 IN_BASE_INITIALIZER bool bitfields.
2092 (struct cp_declarator): Make KIND a 4-bit field. Make
2093 PARAMETER_PACK_P a bool bitfield just after KIND.
2094 * pt.c (uses_parameter_packs): Destroy the pointer set.
2095 (make_pack_expansion): Ditto.
2096 (check_for_bare_parameter_packs): Ditto.
2097 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
2099 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
2102 * call.c (convert_default_arg): Instead of copying the node,
2105 2007-03-15 Dirk Mueller <dmueller@suse.de>
2108 * call.c (convert_conversion_warnings): New..
2109 (convert_like_real): .. factored out from here.
2110 (convert_conversion_warnings): Add warning about
2111 false being converted to NULL in argument passing.
2113 2007-03-14 Dirk Mueller <dmueller@suse.de>
2115 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
2116 (finish_do_body): Warn about empty body in do/while statement.
2118 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2120 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2122 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2125 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2128 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
2130 * cp/repo.c (init_repo): Initialize random_seed saved options.
2131 (finish_repo): Adjust.
2133 2007-03-13 Mark Mitchell <mark@codesourcery.com>
2136 * Make-lang.in (doc/g++.1): Use $< to specify the location from
2139 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
2141 * decl.c (compute_array_index_type): New warning flag warn_vla.
2143 2007-03-12 Mark Mitchell <mark@codesourcery.com>
2146 * call.c (convert_default_arg): Copy non-constant arguments.
2148 2007-03-11 Mark Mitchell <mark@codesourcery.com>
2151 * parser.c (cp_parser_postfix_expression): Disallow compound
2152 literals in constant expressions.
2155 * semantics.c (finish_typeof): Use unlowered_expr_type.
2157 2007-03-10 Mark Mitchell <mark@codesourcery.com>
2160 * cp-tree.h (unlowered_expr_type): New function.
2161 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2162 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2163 (unlowered_expr_type): New function.
2164 (build_unary_op): Disallow predecrements of bool bitfields.
2165 * call.c (build_conditional_expr): Use unlowered_expr_type.
2166 * pt.c (type_unification_real): Likewise.
2168 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
2171 * typeck.c (check_return_expr): Check for bare parameter packs.
2172 (comptypes): Compare template parameter packs and
2173 type pack expansions.
2174 * decl.c (grokdeclarator): Deal with the declaration of function
2176 (grokparms): Verify that the (optional) function parameter pack is
2177 at the end of the parameter list.
2178 (xref_basetypes): Handle pack expansions in the base class.
2179 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2180 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2181 (NONTYPE_ARGUMENT_PACK): New.
2182 (TYPE_PACK_EXPANSION): New.
2183 (EXPR_PACK_EXPANSION): New.
2184 (ARGUMENT_PACK_SELECT): New.
2185 * cp-objcp-common.c (cp_tree_size): Compute size of
2186 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2187 ARGUMENT_PACK_SELECT.
2188 * error.c (dump_template_argument): Print template argument packs.
2189 (dump_template_argument_list): Ditto.
2190 (dump_template_parameter): Dump `...' for template type parameter
2192 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2193 (dump_parameters): Print function parameter packs.
2194 (dump_template_parms): Print template argument packs.
2195 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2196 (maybe_warn_variadic_templates): New.
2197 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2198 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2199 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2201 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2202 (write_template_arg): Write argument packs as separate arguments.
2203 * cp-tree.h (struct template_parm_index_s): Add flag that
2204 indicates that the template parameter is actually a parameter
2206 (struct tree_argument_pack_select): New.
2207 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2208 (union lang_tree_node): Add argument_pack_select.
2209 (FUNCTION_PARAMETER_PACK_P): New.
2210 (PACK_EXPANSION_P): New.
2211 (PACK_EXPANSION_PATTERN): New.
2212 (SET_PACK_EXPANSION_PATTERN): New.
2213 (PACK_EXPANSION_PARAMETER_PACKS): New.
2214 (ARGUMENT_PACK_P): New.
2215 (ARGUMENT_PACK_ARGS): New.
2216 (SET_ARGUMENT_PACK_ARGS): New.
2217 (ARGUMENT_PACK_INCOMPLETE_P): New.
2218 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2219 (TEMPLATE_PARM_PARAMETER_PACK): New.
2220 (TEMPLATE_TYPE_PARAMETER_PACK): New.
2221 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2222 (ARGUMENT_PACK_SELECT_INDEX): New.
2223 (ARGUMENT_PACK_SELECT_ARG): New.
2224 (struct cp_declarator): Add parameter_pack_p flag.
2225 (maybe_warn_variadic_templates): Declare.
2226 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2227 indicate a template parameter pack.
2228 (uses_parameter_packs): Declare.
2229 (template_parameter_pack_p): Declare.
2230 (template_parms_variadic_p): Declare.
2231 (make_pack_expansion): Declare.
2232 (check_for_bare_parameter_packs): Declare.
2233 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2234 sizeof... expressions.
2235 (pp_cxx_expression): Print pack expansions and non-type argument
2237 (pp_cxx_exception_specification): Print pack expansions.
2238 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2239 (pp_cxx_ctor_initializer): Print pack expansions.
2240 (pp_cxx_type_id): Print pack expansions.
2241 (pp_cxx_template_argument_list): Print argument packs.
2242 (pp_cxx_template_parameter): Print ellipsis for template parameter
2244 * pt.c (comp_template_parms): Compare template parameter packs.
2245 (template_parameter_pack_p): New.
2246 (template_parms_variadic_p): New.
2247 (template_args_variadic_p): New.
2248 (make_ith_pack_parameter_name): New.
2249 (struct find_parameter_pack_data): New.
2250 (find_parameter_packs_r): New.
2251 (uses_parameter_packs): New.
2252 (make_pack_expansion): New.
2253 (check_for_bare_parameter_packs): New.
2254 (expand_template_argument_pack): New.
2255 (reduce_template_parm_level): Propagate parameter pack flag.
2256 (process_template_parm): Add is_parameter_pack parameter to state
2257 when the parameter is actually a parameter pack. Create template
2258 parameter packs when is_parameter_pack is true.
2259 (current_template_args): The argument for a template parameter
2260 pack is an argument pack containing a single pack expansion.
2261 (process_partial_specialization): When checking that non-type
2262 argument expressions do not involve template parameters, loop over
2263 the arguments in argument packs separately.
2264 (push_template_decl_real): Check that the type of the declaration
2265 does not have any bare parameter packs. Check that primary
2266 templates have no more than one parameter pack, and that it comes
2267 at the end of the template parameter list.
2268 (convert_template_argument): Handle coercions for pack expansion
2269 expressions by coercing the pattern then rebuilding the expansion.
2270 (coerce_template_parms): When coercing the arguments for a
2271 variadic template, pack "extra" arguments into an argument pack.
2272 (coerce_template_template_parms): Cannot coerce between parameter
2273 packs and non-pack parameters.
2274 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2275 (comp_template_args): Expand all template arguments packs before
2276 comparing template argument lists.
2277 (mangle_class_name_for_template): Make argument packs as separate
2279 (for_each_template_parm_r): No need to handle BASELINK.
2280 (instantiate_class_template): Handle pack expansions in the base
2282 (tsubst_pack_expansion): New.
2283 (tsubst_template_args): Handle substitutions of argument packs and
2284 pack expansion into template argument lists.
2285 (tsubst_decl): Expand function parameter packs into separate
2286 function parameters.
2287 (tsubst_arg_types): Expand a type pack expansion into separate
2289 (tsubst_exception_specification): Handle pack expansions in
2290 exception specifiers.
2291 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2292 replacing a template parameter with its argument. If we encounter
2293 a substitution for an argument pack, just return the parameter
2295 (tsubst_copy): sizeof(X...) returns the number of elements in
2296 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2297 PARM_DECL is a parameter pack.
2298 (tsubst_expr): Expression pack expansions and argument packs
2299 cannot show up here; they will all be handled through function
2300 calls, sizeof, and template argument lists.
2301 (tsubst_copy_and_build): sizeof(X...) returns the number of
2302 elements in parameter pack X. Handle pack expansions in TREE_LIST
2303 and CONSTRUCTOR nodes.
2304 (fn_type_unification): Handle "incomplete" explicit template
2305 argument lists that specify some of the arguments for a template
2307 (type_unification_real): Unify arguments against pack expansions.
2308 (template_parm_level_and_index): New, helper function.
2309 (unify_pack_expansion): New.
2310 (unify): Unify argument packs on an argument-by-argument basis,
2311 handling variadic argument packs as well.
2312 (more_specialized_fn): Handle unification of function parameter
2313 packs. All things being equal, prefer non-variadic function
2314 templates to variadic function templates.
2315 (more_specialized_class): Prefer the variadic class template
2316 partial specialization that binds fewer arguments to a parameter
2318 (regenerate_decl_from_template): Expand function parameter packs
2319 into separate parameters.
2320 (instantiate_decl): Ditto.
2321 (tsubst_initializer_list): Handle pack expansions for base-class
2323 (dependent_type_p_r): Determine dependent types in argument packs
2324 and pack expansions.
2325 (value_dependent_expression_p): Determine value-dependence of
2326 non-type argument packs.
2327 (dependent_template_arg_p): Handle argument packs.
2328 * semantics.c (finish_cond): Check for bare parameter packs.
2329 (finish_expr_stmt): Ditto.
2330 (finish_for_expr): Ditto.
2331 (finish_switch_cond): Ditto.
2332 (finish_mem_initializers): Ditto.
2333 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2335 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2336 * parser.c (make_declarator): Declarator is not an expansion.
2337 (make_pointer_declarator): Transfer parameter pack flag to outer
2339 (make_reference_declarator): Ditto.
2340 (make_ptrmem_declarator): Ditto.
2341 (make_call_declarator): Ditto.
2342 (make_array_declarator): Ditto.
2343 (cp_parser_postfix_expression): Allow pack expansion expressions
2344 in the argument list for a call expression.
2345 (cp_parser_parenthesized_expression_list): Add new parameter
2346 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2347 into separate arguments."
2348 (cp_parser_new_placement): Allow pack expansion expressions.
2349 (cp_parser_new_initializer): Ditto.
2350 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2351 base-class initializer expansion.
2352 (cp_parser_mem_initializer): Ditto.
2353 (cp_parser_template_parameter_list): Keep track of whether the
2354 template parameter is a template parameter pack.
2355 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2356 template parameter pack.
2357 (cp_parser_type_parameter): Ditto.
2358 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2360 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2361 this declarator is a parameter pack.
2362 (cp_parser_parameter_declaration): The ellipsis does not end the
2363 parameter declaration, because it might be a parameter pack. Parse
2364 the ellipsis to indicate a parameter pack.
2365 (cp_parser_initializer): Allow pack expansions.
2366 (cp_parser_initializer_list): Allow ellipsis to create an
2367 initializer expansion.
2368 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2370 (cp_parser_type_id_list): Allow ellipsis to create an exception
2371 specifier expansion.
2372 (cp_parser_attribute_list): Don't allow pack expansions.
2373 (cp_parser_functional_cast): Allow pack expansions.
2374 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2375 compute the length of a parameter pack.
2376 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2377 end a template argument.
2378 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2379 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2382 2007-03-09 Dirk Mueller <dmueller@suse.de>
2384 * cp/call.c (build_new_op): Call warn_logical_operator.
2386 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2389 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2392 * pt.c (any_template_arguments_need_structural_equality_p):
2395 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2397 * decl.c (grokdeclarator): Disable warnings for anonymous
2400 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2402 * typeck2.c (readonly_error): Always emit a hard error.
2403 Remove last argument.
2404 * cp-tree.h (readonly_error): Adjust prototype.
2405 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2406 * typeck.c (build_unary_op): Likewise.
2407 (build_modify_expr): Likewise.
2409 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2412 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2414 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2417 * parser.c (struct cp_parser): New IN_IF_STMT.
2418 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2419 returning if parsing the body of an 'if' statement or issuing an
2420 error and continuing.
2421 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2423 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2425 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2428 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2431 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2433 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2434 Objective-C++. Don't exit early if -shared-libgcc needs to be
2437 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2439 * typeck.c (common_base_type): Delete unused function.
2441 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2443 * Make-lang.in: Add dummy lang.install-pdf target.
2445 2007-03-01 Simon Baldwin <simonb@google.com>
2448 * decl.c (check_tag_decl): Added new warning for typedef ignored
2449 when it precedes an otherwise valid non-typedef declaration.
2451 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2453 * typeck.c (build_function_call): Store converted arguments
2454 in a stack-allocated array instead of building a list.
2455 (convert_arguments): Store arguments in the array passed in as an
2456 argument, and return the actual number of arguments.
2457 * call.c (build_call): Delete, and replace with...
2458 (build_call_n, build_call_a): New.
2459 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2460 (build_over_call): Store converted arguments in a stack-allocated
2461 array instead of building a list.
2462 (build_cxx_call): Pass arguments in an array instead of as a list.
2463 (build_java_interface_fn_ref): Rewrite to avoid constructing
2465 * tree.h: Update declarations to reflect above changes.
2466 * method.c (use_thunk): Use a stack-allocated array to hold
2467 the arguments instead of a list.
2468 * rtti.c (throw_bad_cast): Update call to cxx_call.
2469 (throw_bad_typeid): Likewise.
2470 (build_dynamic_cast_1): Likewise.
2471 * init.c (build_builtin_delete_call): Use build_call_n.
2472 * decl.c (expand_static_init): Likewise.
2473 * except.c (cp_protect_cleanup_actions): Likewise.
2474 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2475 (gimplify_must_not_throw_expr): Likewise.
2476 (cxx_omp_apply_fn): Use build_call_a.
2478 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2480 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2481 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2483 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2485 * cp-tree.h (static_ctors): Remove.
2486 * cp-tree.h (static_dtors): Likewise.
2487 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2488 refactoring of tree_map hierarchy.
2489 (decl_shadowed_for_var_insert): Likewise.
2490 * semantics.c (expand_body): Use c_expand_body.
2491 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2492 * decl2.c (static_ctors): Remove.
2493 (static_dtors): Likewise.
2494 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2495 objc_generate_static_init_call. Do not call static_[cd]tors.
2496 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2498 (cp_write_global_declarations): Likewise.
2500 2007-02-23 Richard Guenther <rguenther@suse.de>
2502 * class.c (note_name_declared_in_class): Make declaration
2503 changes meaning a pedwarn.
2505 2007-02-22 Michael Matz <matz@suse.de>
2508 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2509 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2510 dump_function_decl): Guard emitting outer scopes by new flag.
2511 * cp-lang.c (cxx_dwarf_name): New function.
2512 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2513 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2515 (push_template_decl_real, lookup_template_class): Remove calls
2518 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2520 * call.c (build_new_method_call): Ensure that explicit calls of
2521 destructors have type "void".
2523 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2525 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2526 and -Walways-true with -Waddress.
2527 * cvt.c (convert_to_void): Replace unconditional warning with
2530 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2532 * decl.c, tree.c: Fix comment typos.
2534 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2537 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2538 statement expression if we had an error mark node.
2540 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2541 Brooks Moses <brooks.moses@codesourcery.com>
2542 Lee Millward <lee.millward@codesourcery.com>
2544 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2545 Change class to tcc_vl_exp.
2547 * call.c (build_call): Use build_call_list instead
2549 (build_over_call): Likewise.
2550 (build_new_method_call): Use build_min_non_dep_call_list
2551 instead of build_min_non_dep.
2553 * error.c (dump_call_expr_args): New function.
2554 (dump_aggr_init_expr_args): New function.
2555 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2556 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2558 * cvt.c (convert_to_void): Use build_call_array instead
2559 of build3; use new AGGR_INIT_EXPR accessor macros.
2561 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2562 instead of TREE_CODE_LENGTH.
2564 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2565 AGGR_INIT_EXPR accessor macros.
2567 * cp-gimplify.c (cp_gimplify_init_expr): Use
2568 AGGR_INIT_EXPR_SLOT to set the slot operand.
2570 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2571 (AGGR_INIT_EXPR_SLOT): New macro.
2572 (AGGR_INIT_EXPR_ARG): New macro.
2573 (aggr_init_expr_nargs): New macro.
2574 (AGGR_INIT_EXPR_ARGP): New macro.
2575 (aggr_init_expr_arg_iterator): New.
2576 (init_aggr_init_expr_arg_iterator): New.
2577 (next_aggr_init_expr_arg): New.
2578 (first_aggr_init_expr_arg): New.
2579 (more_aggr_init_expr_args_p): New.
2580 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2581 (stabilize_aggr_init): New declaration.
2582 (build_min_non_dep_call_list): Likewise.
2584 * tree.c (process_aggr_init_operands): New function.
2585 (build_aggr_init_array) New function.
2586 (build_cplus_new): Update to use new CALL_EXPR and
2587 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2588 build_aggr_init_array.
2589 (build_min_non_dep_call_list) New function.
2590 (build_min_nt): Assert input code parameter is not a variable
2591 length expression class.
2592 (build_min, build_min_non_dep): Likewise.
2593 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2594 to check for equality instead of recursing. Handle tcc_vl_exp
2596 (stabilize_call): Update to only handle CALL_EXPRs, not
2597 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2598 (stabilize_aggr_init): New function.
2599 (stabilize_init): Use it.
2601 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2602 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2603 AGGR_INIT_EXPR accessor macros and argument iterators.
2605 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2606 build_vl_exp. Iterate through the operands, recursively
2607 processing each one.
2608 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2609 CALL_EXPR accessor macros.
2610 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2611 tree code classes. Use TREE_OPERAND_LENGTH instead of
2614 * semantics.c (finish_call_expr): Use build_nt_call_list
2615 instead of build_nt.
2616 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2617 accessor macros. Use build_call_array to construct the
2618 CALL_EXPR node instead of build3
2620 * decl2.c (build_offset_ref_call_from_tree): Use
2621 build_nt_call_list and build_min_non_dep_call_list instead
2622 of build_min_nt and build_min_non_dep.
2624 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2625 Use build_nt_call_list instead of build_min_nt.
2627 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2630 * call.c (build_conditional_expr): Improve error message.
2632 2007-02-13 Dirk Mueller <dmueller@suse.de>
2634 * friend.c (do_friend): Annotate warning about friend
2635 declarations in templates with OPT_Wnon_template_friend.
2636 Convert informal message from warning() to inform().
2638 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2639 Mark Mitchell <mark@codesourcery.com>
2642 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2643 instantiations for variables.
2645 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2648 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2649 Check warn_unused_value just once.
2651 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2654 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2655 (fn_type_unificiation): Likewise.
2656 (get_bindings): Likewise.
2658 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2661 * decl.c (finish_function): Use DECL_REPLACEABLE.
2662 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2664 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2666 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2668 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2670 * decl.c (grokvardecl): Don't error if !have_tls.
2671 (grokdeclarator): Likewise.
2672 * parser.c (cp_parser_omp_threadprivate): Likewise.
2674 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2677 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2678 parameters and result decls in omp clauses.
2679 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2682 2007-02-05 Dirk Mueller <dmueller@suse.de>
2685 * parser.c (cp_parser_class_specifier): Always initialize bases.
2687 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2689 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2690 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2691 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2693 * semantics.c (finish_omp_atomic): Store a whole expression node
2694 in operand 1, and integer_zero_node in operand 0, for dependent
2695 OMP_ATOMIC. Rewrite to make flow easier to understand.
2697 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2699 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2701 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2703 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2704 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2706 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2708 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2709 keyword warning to -Wc++0x-compat.
2711 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2713 * decl.c (grokdeclarator): Update documentation.
2715 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2718 * decl.c (grokdeclarator): If __thread is used together with
2719 a storage class other than extern and static, clear thread_p
2720 after issuing diagnostics and fall through to checking the
2723 2007-01-30 Roger Sayle <roger@eyesopen.com>
2725 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
2726 calculating the size of an array (to avoid recursive errors).
2728 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2731 * typeck.c (build_binary_op): Fix logic for warning. Move warning
2733 * call.c (convert_like_real): Don't warn when converting to
2736 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2738 * decl.c (pop_label): Replace warning with call to
2739 warn_for_unused_label.
2741 2007-01-28 Andrew Pinski <pinskia@gmail.com>
2744 * semantics.c (finish_pseudo_destructor_expr): Check the
2745 destrutor name by calling check_dtor_name.
2747 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
2749 * lex.c (D_CPP0X): Rename.
2751 (reswords): D_CPP0X -> D_CXX0X.
2752 (init_reswords): Ditto.
2753 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
2754 of C++0x keywords as identifiers.
2756 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
2759 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
2762 2007-01-23 Ian Lance Taylor <iant@google.com>
2764 * typeck.c (convert_for_assignment): Only warn about a = b = c
2765 when converting to bool.
2767 2007-01-23 Roger Sayle <roger@eyesopen.com>
2769 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
2771 * typeck.c (ignore_overflows): Remove the remaining uses of
2772 TREE_CONSTANT_OVERFLOW.
2774 2007-01-20 Jan Hubicka <jh@suse.cz>
2776 * decl2.c (start_objects, start_static_storage_duration_function):
2777 Do not make the functions uninlinable.
2779 2007-01-17 Ian Lance Taylor <iant@google.com>
2781 * class.c (add_method): Call VEC_reserve_exact rather than passing
2782 a negative size to VEC_reserve.
2784 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
2787 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
2789 2007-01-10 Mark Mitchell <mark@codesourcery.com>
2792 * decl.c (make_typename_type): If the qualified name is not a
2793 type, issue an error.
2794 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
2797 2007-01-08 Geoffrey Keating <geoffk@apple.com>
2799 * rtti.c: Include target.h.
2800 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
2801 don't emit typeinfo for fundamental types as weak.
2802 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
2804 2007-01-08 Richard Guenther <rguenther@suse.de>
2806 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
2808 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
2810 * call.c (standard_conversion): Pass flag to
2811 vector_types_convertible_p to disallow emission of note.
2812 * typeck.c (convert_for_assignment): Pass flag to
2813 vector_types_convertible_p to allow emission of note.
2814 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
2815 to disallow emission of note.
2817 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2820 * typeck.c (build_binary_op): Call overflow_warning if
2821 TREE_OVERFLOW_P is true for the result and not for any of the
2824 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
2827 * class.c (add_method): Don't wait until template
2828 instantiation time to complain about duplicate methods.
2830 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2833 * semantics.c (finish_unary_op_expr): Warn only if result
2834 overflowed and operands did not.
2836 2007-01-05 Ian Lance Taylor <iant@google.com>
2838 * typeck.c (build_binary_op): Warn about comparing a non-weak
2841 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
2843 * pt.c (tsubst): Propagate the need for structural equality checks
2844 when reducing the level of template parameters.
2846 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
2848 * pt.c: Fix a comment typo.
2850 2007-01-02 Ian Lance Taylor <iant@google.com>
2852 * semantics.c (maybe_convert_cond): Optionally warn when using an
2853 assignment as a condition.
2854 * typeck.c (convert_for_assignment): Optionally warn about
2855 assigning the result of an assignment to a bool.
2857 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2859 * pt.c (canonical_template_parms): Correct typo in comment.
2861 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
2863 * typeck.c (structural_comptypes): Renamed from "comptypes".
2864 (comptypes): Use canonical type information to perform fast type
2865 comparison. When VERIFY_CANONICAL_TYPES, verify that the
2866 canonical type comparison returns the same results as we would see
2867 from the current, structural check. Support COMPARE_STRUCTURAL
2868 when we need structural checks.
2869 * decl.c (typename_compare): Fix comment.
2870 (build_typename_type): TYPENAME_TYPE nodes require structural
2871 equality checks, because they resolve different based on the
2873 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
2874 require structural equality checks (for now).
2875 (build_ptrmemfunc_type): Build the canonical pointer to member
2877 (compute_array_index_type): Whenever we build a new index type
2878 to represent the size of an array in a template, we need to mark
2879 this index type as requiring structural equality. This goes for
2880 arrays with value-dependent sizes with the current ABI, or all
2882 * tree.c (cplus_array_hash): New.
2883 (struct cplus_array_info): New.
2884 (cplus_array_compare): New.
2885 (cplus_array_htab): New.
2886 (build_cplus_array_type_1): Use a hash table to cache the array
2887 types we build. Build the canonical array type for each array
2889 (cp_build_qualified_type_real): When building a cv-qualified array
2890 type, use the hash table of array types and build canonical array
2892 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2893 use structural equality (for now).
2894 * cp-tree.h (COMPARE_STRUCTURAL): New.
2895 * pt.c (canonical_template_parms): New.
2896 (canonical_type_parameter): New.
2897 (process_template_parm): Find the canonical type parameter.
2898 (lookup_template_class): When we have named the primary template
2899 type, set the canonical type for our template class to the primary
2900 template type. If any of the template arguments need structural
2901 equality checks, the template class needs structural equality
2903 (tsubst): When reducing the level of a template template
2904 parameter, we require structural equality tests for the resulting
2905 parameter because its template parameters have not had their types
2906 canonicalized. When reducing a template type parameter, find the
2907 canonical reduced type parameter.
2908 (any_template_arguments_need_structural_equality_p): New.