1 2008-10-31 Jakub Jelinek <jakub@redhat.com>
4 * decl.c (grokdeclarator): Diagnose auto function decl without
5 late return type and late return type function decl where type
9 * decl.c (cp_finish_decl): Diagnose type_uses_auto type with
12 2008-10-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
15 * class.c (check_bitfield_decl): Rename min_precision to
16 tree_int_cst_min_precision.
17 * decl.c (finish_enum): Likewise.
19 2008-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
22 * parser.c (cp_parser_token_starts_cast_expression): New.
23 (cp_parser_cast_expression): Peek the next token to decide whether
24 this could be a parenthesized constructor or is definitely an
27 2008-10-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
30 * typeck.c (build_x_binary_op): Update call to
31 warn_about_parentheses.
32 * parser.c (cp_parser_binary_expression): Add note about passing
33 the correct code for unary expressions.
35 2008-10-24 Jakub Jelinek <jakub@redhat.com>
37 * Make-lang.in (check-c++-subtargets): New alias for
39 (lang_checks_parallelized): Add check-g++.
40 (check_g++_parallelize): New variable.
42 2008-10-21 Richard Guenther <rguenther@suse.de>
44 * semantics.c (simplify_aggr_init_exprs_r): Remove.
45 (expand_or_defer_fn): Do not walk the function body to
46 simplify aggr_init_exprs.
48 2008-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
51 * typeck.c (cp_common_type): New. The same as
52 type_after_usual_arithmetic_conversions but without promotions.
53 (type_after_usual_arithmetic_conversions): Do the promotions and
55 (common_type): Make it behave like the C version of this
56 function. Do not handle pointer types.
57 (common_pointer_type): Move handling of pointer types from
59 (cp_build_binary_op): Use common_pointer_type instead of
60 common_type in call to pointer_diff.
61 Use cp_common_type instead of common_type.
62 * cp-tree.h (common_pointer_type): Declare.
64 2008-10-14 Jakub Jelinek <jakub@redhat.com>
67 * cp-gimplify.c (cp_genericize_r): Only fold_convert COND_EXPR
68 arguments if they don't already have COND_EXPR's type.
70 2008-10-14 Paolo Carlini <paolo.carlini@oracle.com>
73 * pt.c (push_template_decl_real): Check that current_template_parms
75 (process_partial_specialization): Assert current_template_parms not
78 2008-10-13 Doug Evans <dje@google.com>
80 * cp-tree.h (DECL_MAIN_P): Fix parentheses around expression.
82 2008-10-10 Jakub Jelinek <jakub@redhat.com>
85 * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of
88 2008-10-09 Jakub Jelinek <jakub@redhat.com>
91 * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
92 setting it to error_mark_node.
94 2008-10-07 Steve Ellcey <sje@cup.hp.com>
96 * decl.c (start_cleanup_fn): Declare as inline.
98 2008-10-06 Jason Merrill <jason@redhat.com>
100 PR c++/37376, other mangling issues
101 * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling.
102 (write_member_name): Break out from...
103 (write_expression): ...here. Handle dependent COMPONENT_REF.
104 (write_template_arg): Wrap an argument pack in 'I'/'E'.
105 (write_builtin_type): Update char16/32_t mangling.
106 (write_nested_name, write_prefix): Don't forget template args
108 * operators.def: Add ARROW_EXPR, update COMPONENT_REF and
111 2008-10-06 Aldy Hernandez <aldyh@redhat.com>
113 * typeck.c (build_x_indirect_ref): Add location argument.
114 (cp_build_binary_op): Pass location to warn_for_div_by_zero.
115 (cp_build_unary_op): Add location argument.
116 (cp_build_modify_expr): Same.
117 * class.c (build_base_path): Pass location to build_indirect_ref.
118 * semantics.c (handle_omp_for_class_iterator): Pass elocus to
121 2008-10-05 Dodji Seketeli <dodji@redhat.com>
124 * cp-gimplify.c (cp_gimplify_expr): For each USING_STMT
125 make sure an IMPORTED_DECL node is added to the BLOCK_VARS list
126 of the innermost containing BLOCK.
128 2008-10-03 Paolo Carlini <paolo.carlini@oracle.com>
131 * error.c (dump_function_decl): Save the exceptions in case of
132 error about incompatible specifications in a specialization.
134 2008-10-01 Andrew Pinski <andrew_pinski@playstation.sony.com>
136 * tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue.
138 2008-09-30 H.J. Lu <hongjiu.lu@intel.com>
141 * parser.c (cp_parser_selection_statement): Fix uninitialized
144 2008-09-30 Simon Martin <simartin@users.sourceforge.net>
148 * decl.c (grokdeclarator): Set the type for typedefs to a
149 nested-name-specifier to error_mark_node.
151 2008-09-30 Paolo Bonzini <bonzini@gnu.org>
153 * parser.c (cp_parser_selection_statement): Implement here the
154 -Wempty-body warning for `if' and `else' statements.
155 * semantics.c (finish_if_stmt): Do not call empty_body_warning.
157 2008-09-25 Paolo Carlini <paolo.carlini@oracle.com>
160 * name-lookup.c (maybe_process_template_type_declaration): Check
161 return value of push_template_decl_real for error_mark_node.
163 2008-09-24 Aldy Hernandez <aldyh@redhat.com>
165 * semantics.c (finish_fname): Pass location to fname_decl.
167 2008-09-23 Jakub Jelinek <jakub@redhat.com>
170 * semantics.c (finish_omp_for): If processing_template_decl, just build
171 MODIFY_EXPR for init instead of calling cp_build_modify_expr.
173 2008-09-23 Aldy Hernandez <aldyh@redhat.com>
175 * typeck.c (build_array_ref): Pass location to cp_build_binary_op.
176 (get_member_function_from_ptrfunc): Same.
177 (build_x_binary_op): Same.
178 (build_binary_op): Same.
179 (cp_build_binary_op): New location argument.
180 (pointer_diff): Pass location to cp_build_binary_op.
181 (cp_truthvalue_conversion): Pass location to build_binary_op.
182 (convert_ptrmem): Pass location to cp_build_binary_op.
183 (cp_build_modify_expr): Same.
184 (build_ptrmemfunc): Same.
185 * init.c (expand_cleanup_for_base): Pass location to
186 c_common_truthvalue_conversion.
187 (build_new_1): Pass location to cp_build_binary_op.
188 (build_vec_delete_1): Pass location to *build_binary_op,
189 c_common_truthvalue_conversion.
190 (build_vec_init): Same.
191 (build_delete): Same.
192 * decl.c (compute_array_index_type): Same.
193 * call.c (build_new_op): Same.
194 * rtti.c (build_dynamic_cast_1): Same.
195 * cp-tree.h: Add argument to cp_build_binary_op.
196 * semantics.c (handle_omp_for_class_iterator): Pass location to
197 *build_binary_op, c_common_truthvalue_conversion.
198 * decl2.c (get_guard_cond): Same.
200 2008-09-17 Richard Guenther <rguenther@suse.de>
203 * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
204 result to the correct type.
206 2008-09-17 H.J. Lu <hongjiu.lu@intel.com>
209 * name-lookup.c (pushdecl_maybe_friend): Don't return the old
210 parameter for duplicate.
212 2008-09-17 Jason Merrill <jason@redhat.com>
215 * name-lookup.c (lookup_type_scope): Look through sk_function_parms.
217 2008-09-17 Jakub Jelinek <jakub@redhat.com>
220 * typeck.c (build_array_ref): Use protected_set_expr_location instead
221 of SET_EXPR_LOCATION when ret might not be an expression.
223 2008-09-17 Jan Hubicka <jh@suse.cz>
226 * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.
228 2008-09-16 Jakub Jelinek <jakub@redhat.com>
231 * semantics.c (finish_compound_literal): Return error_mark_node if
235 * lex.c (init_reswords): Don't populate ridpointers for D_CONLY
238 2008-09-15 Aldy Hernandez <aldyh@redhat.com>
240 * decl.c (duplicate_decls): Call error_at.
241 (grokfndecl): New location argument. Use location if available.
242 (grokdeclarator): Pass declarator location to grokfndecl.
243 * cp-tree.h (struct cp_declarator): Update comment for id_loc.
244 * decl2.c (check_classfn): Use error_at.
245 * parser.c (cp_parser_init_declarator): Set function_start_locus
247 (cp_parser_member_declaration): Set id_loc for function declarators.
249 2008-09-09 Jan Hubicka <jh@suse.cz>
252 * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer.
254 2008-09-09 Jakub Jelinek <jakub@redhat.com>
257 * tree.c (array_type_nelts_top): Add size_one_node instead of
260 2008-09-09 Jason Merrill <jason@redhat.com>
263 * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has
266 2008-09-09 Jakub Jelinek <jakub@redhat.com>
269 * decl.c (build_enumerator): Handle previous value's DECL_INITIAL
270 being error_operand_p. Don't clear value if it was error_mark_node.
272 2008-09-09 Paolo Bonzini <bonzini@gnu.org>
274 * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
275 * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
276 * semantics.c (anon_aggr_type_p): Remove.
278 2008-09-06 Jason Merrill <jason@redhat.com>
281 * parser.c (cp_parser_parameter_declaration_list): Process the
282 PARM_DECLs as we go and push them. Return a TREE_LIST.
283 (cp_parser_parameter_declaration_clause): Return a TREE_LIST.
284 (cp_parser_direct_declarator): Create a binding level and
285 suppress deprecated warnings in the parameter list.
286 (make_call_declarator): PARMS is now a tree.
287 * cp-tree.h (struct cp_declarator): Function parms are now a tree.
288 * decl.h (enum deprecated_states, deprecated_state): Move here.
290 (type_is_deprecated): New fn.
291 (grokparms): PARMLIST is a tree now. Warn about parms that
292 use deprecated types.
293 * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and
295 * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation.
296 (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a
298 * name-lookup.c (pushtag): Look through function parameter scopes.
299 (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL
300 when we're parsing a function declarator.
302 2008-09-05 Douglas Gregor <doug.gregor@gmail.com>
305 * tree.c (cp_build_qualified_type_real): Deal with sharing of
306 TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method
309 2008-09-04 Ian Lance Taylor <iant@google.com>
311 * parser.c (check_no_duplicate_clause): Change code parameter to
312 enum omp_clause_code.
314 2008-09-03 Jakub Jelinek <jakub@redhat.com>
317 * decl.c (cp_finish_decl): Only set
318 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.
321 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New
323 * decl2.c (mark_used): If defer_mark_used_calls, push decl into
324 deferred_mark_used_calls vector and exit early.
325 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New
327 (finish_function): Set defer_mark_used_calls for the duration of the
328 function. Call mark_used on any queued decls.
330 2008-09-02 Jason Merrill <jason@redhat.com>
333 * call.c (build_over_call): Make =delete work with SFINAE.
334 * class.c (resolve_address_of_overloaded_function): Likewise.
336 * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to
337 threadprivate_or_deleted_p.
338 (CP_DECL_THREADPRIVATE_P): Adjust.
339 (DECL_DELETED_FN): Likewise.
340 (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros.
341 (SD_DELETED): New macro.
342 * parser.c (cp_parser_init_declarator): Use them.
343 * decl.c (start_decl): Use them.
345 * decl2.c (mark_used): Give =deleted error even in sizeof.
347 * typeck2.c (check_narrowing): Downgrade narrowing error to
350 2008-09-02 Aldy Hernandez <aldyh@redhat.com>
352 * typeck.c (build_array_ref): Use new location argument.
353 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
354 * call.c (build_new_op): Same.
355 * decl2.c (grok_array_decl): Same.
356 * cp-tree.h (build_array_ref): Add location argument to prototype.
358 2008-09-01 Aldy Hernandez <aldyh@redhat.com>
360 * typeck.c (build_x_indirect_ref): Add location argument.
361 * class.c (build_base_path): Pass location to build_indirect_ref.
362 * pt.c (tsubst_copy_and_build): Pass location to
363 finish_label_address_expr.
364 * parser.c (cp_parser_unary_expression): Same.
366 2008-08-31 Jason Merrill <jason@redhat.com>
368 Implement late-specified return type using 'auto'.
369 * cp-tree.h (struct cp_declarator): Add late_return_type field to
371 * parser.c (cp_parser_late_return_type_opt): New fn.
372 (cp_parser_direct_declarator): Use it.
373 (make_call_declarator): Put it in the declarator.
374 * decl.c (grokdeclarator): Splice in late-specified return type.
375 * pt.c (splice_late_return_type): New fn.
377 2008-08-29 Michael Meissner <gnu@the-meissners.org>
379 * decl.c (builtin_function_1): Take a bool argument to decide
380 whether to use pushdecl or pushdecl_top_level.
381 (duplicate_decls): Copy function specific target and optimization
382 options on duplicate declarations.
383 (cxx_builtin_function): Update builtin_function_1 call.
384 (cxx_builtin_function_ext_scope): New function, guarantee that the
385 declaration is done at global scope.
387 * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
388 macro, define builtin function hook for delayed machine specific
391 * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration.
393 2008-08-30 Jason Merrill <jason@redhat.com>
396 * pt.c (dependent_type_p): Don't abort on auto outside of a template.
398 2008-08-29 Jason Merrill <jason@redhat.com>
400 Implement C++0x 'auto' semantics.
401 * decl.c (start_decl_1): Don't complain about auto being incomplete.
402 (cp_finish_decl): Deduce auto.
403 * init.c (build_new): Handle 'new auto'.
404 * typeck2.c (cxx_incomplete_type_diagnostic): Give a different
405 message for auto than for normal template type parms.
406 * pt.c (type_dependent_expression_p): Handle { }.
407 (make_auto): New function.
408 (listify_autos): New function.
409 (do_auto_deduction): New function.
410 (is_auto): New function.
411 (type_uses_auto): New function.
412 * cp-tree.h: Declare them.
413 * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
414 treat auto as a declspec.
415 (cp_parser_simple_type_specifier): It's a type-specifier.
417 2008-08-29 Mark Mitchell <mark@codesourcery.com>
419 * mangle.c (write_type): Add target-specific manglings for
420 non-fundamental types to the substitution table.
423 2008-08-29 Jakub Jelinek <jakub@redhat.com>
427 * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
428 Adjust debug_hooks->imported_module_or_decl callers.
430 2008-08-29 Jan Hubicka <jh@suse.cz>
432 * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic.
434 2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
437 * decl.c (reshape_init_r): Check init for error_mark_node.
439 2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
442 * semantics.c (maybe_convert_cond): Call verify_sequence_points.
443 (finish_return_stmt): Likewise.
444 (finish_switch_condition): Likewise.
446 2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
448 * cp-tree.h: Fix #error directive.
450 2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
452 * typeck.c (type_after_usual_arithmetic_conversions): Don't do the
453 usual arithmetic conversions on scoped enumeration types.
454 (common_type): Ditto.
455 (default_conversion): Don't perform integral promotions on scoped
457 (build_array_ref): Scoped enumeration types can't be used as
459 * decl.c (start_enum): If building a C++0x scoped enumeration,
460 enter its scope. If provided with an underlying type, check that
461 underlying type and set up the enumeration type accordingly.
462 (finish_enum): Only compute an underlying type if the underlying
463 type isn't already fixed, and only convert the enumerator values
464 now if we've just computed the underlying type. Finish the scope
465 of C++0x scoped enumerations.
466 (build_enumerator): For enumerations with a fixed underlying type,
467 check the enumerator values when the enumerator is defined.
468 (lookup_enumerator): New.
469 * call.c (standard_conversion): Don't allow assignment from
470 integers to scoped enumeration types, even with -fpermissive.
471 Don't convert from scoped enumerations to bool or any arithmetic
473 (build_conditional_expr): Don't per the usual arithmetic
474 conversions for scoped enumeration types.
475 (convert_like_real): Check complain to see if we should
477 * error.c (class_key_or_enum_as_string): Print scoped enums.
478 * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
480 (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
481 (SCOPED_ENUM_P): New.
482 (UNSCOPED_ENUM_P): New.
483 (SET_SCOPED_ENUM_P): New.
484 (ENUM_UNDERLYING_TYPE): New.
485 * pt.c (lookup_template_class): Update the instantiation of enum
486 types to deal with C++0x scoped enumerations and underlying
488 * name-lookup.c (begin_scope): Deal with scoped enumeration
490 (lookup_qualified_name): Deal with lookup into enumeration types.
491 * name-lookup.h (enum scope_kind): Add sk_scoped_enum.
492 * parser.c (cp_parser_class_or_namespace_name): Rename to...
493 (cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
494 parse a type-name that can be an enumeration type.
495 (cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
496 (cp_parser_elaborated_type_specifier): Parse the
497 optional `struct' or `class' following enum (in C++0x).
498 (cp_parser_enum_specifier): Parse C++0x scoped enumerations and
501 2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
503 * typeck.c: Update all calls to pedwarn.
508 * name-lookup.c: Likewise.
509 * parser.c: Likewise.
511 2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
514 * parser.c (cp_parser_omp_for_loop): Handle parenthesized
517 2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
519 * parser.c: Update all calls to inform.
520 * typeck.c: Likewise.
524 * method.c: Likewise.
525 * friend.c: Likewise.
526 * typeck2.c: Likewise.
528 * name-lookup.c: Likewise.
531 2008-08-19 Jakub Jelinek <jakub@redhat.com>
534 * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
536 2008-08-18 Tomas Bily <tbily@suse.cz>
538 * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
540 2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
542 * typeck.c: Update all callers of permerror.
547 * except.c: Likewise.
549 * typeck2.c: Likewise.
551 * semantics.c: Likewise.
552 * name-lookup.c: Likewise.
555 * parser.c: Likewise.
557 2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
560 * pt.c (check_template_shadow): Change to return a bool.
561 * name-lookup.c (push_class_level_binding): Early return if
562 check_template_shadow returns false.
563 * cp-tree.h (check_template_shadow): Adjust declaration.
565 2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
568 * decl.c (grokdeclarator): In case of extern and initializer, return
569 error_mark_node after the error.
571 2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
574 * decl.c (grokfndecl): Call check_main_parameters_type only if
577 2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
580 * parser.c (cp_parser_class_head): Early return error_mark_node in
581 case of global qualification of class name or qualified name that
582 does not name a class.
584 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
587 * cvt.c (ocp_convert): Warn for out-of-range conversions to enum.
589 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
592 * cp-tree.h (struct diagnostic_context, struct diagnostic_info):
593 Delete forward declarations. Check that toplev.h has not been
594 included before this file. Include toplev.h and diagnostic.h.
595 * error.c (cp_cpp_error): Use DK_PEDWARN.
596 (cxx_incomplete_type_diagnostic): Update declaration.
597 (cxx_incomplete_type_error): Use DK_ERROR.
598 * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
599 as argument. Use emit_diagnostic.
600 (cxx_incomplete_type_error): Use DK_ERROR.
601 (add_exception_specifier): Use diagnostic_t instead of custom
603 * typeck.c (complete_type_or_else): Update call to
604 cxx_incomplete_type_diagnostic.
605 * init.c (build_delete): Likewise.
606 * call.c (diagnostic_fn_t): Remove unused typedef.
607 (build_temp): Pass a pointer to diagnostic_t.
608 (convert_like_real): Use emit_diagnostic.
609 (joust): Check return value of warning before giving informative
611 * friend.c (do_friend): Check return value of warning
612 before giving informative note.
613 * parser.c (cp_parser_template_id): Likewise.
615 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
618 * class.c (check_bases_and_members): Warn with -Wuninitialized
621 2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
624 * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
625 and make sure it is not a union.
627 2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
629 * semantics.c (finish_decltype_type): Initialize type.
631 2008-08-07 Douglas Gregor <doug.gregor@gmail.com>
633 * semantics.c (finish_decltype_type): Handle calls to function
634 pointers and references to functions properly.
636 2008-08-06 Douglas Gregor <doug.gregor@gmail.com>
639 * parser.c (cp_parser_template_argument): Don't assume that '>>'
640 following a type-id is an error when in C++0x mode.
642 2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
645 * decl.c (grokdeclarator): Use explicit location with permerror_at.
647 2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
650 * typeck.c (cp_build_binary_op): Move code to c-common.c.
652 2008-08-05 Jason Merrill <jason@redhat.com>
655 * decl.c (build_ptrmemfunc_type): Don't require structural
656 comparison of PMF types.
657 * tree.c (cp_build_qualified_type_real): Don't clear
658 a valid TYPE_PTRMEMFUNC_TYPE.
659 * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
662 2008-08-04 Jason Merrill <jason@redhat.com>
665 * typeck2.c (check_narrowing): Allow narrowing conversion
666 from an explicit floating-point constant.
669 * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
672 2008-08-04 Simon Baldwin <simonb@google.com>
675 * parser.c (cp_parser_elaborated_type_specifier): Warn only when
676 the declaration's id is followed by a semicolon.
678 2008-07-31 Jakub Jelinek <jakub@redhat.com>
681 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
682 complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
684 2008-07-31 Jason Merrill <jason@redhat.com>
687 * init.c (build_new_1): Don't convert pointer to the data type
688 until we're actually going to treat it as that type.
691 * tree.c (build_aggr_init_expr): Split out...
692 (build_cplus_new): ...from here.
693 (stabilize_init): Don't mess with AGGR_INIT_EXPR either.
694 * init.c (build_new_1): new T() means value-initialization,
695 not default-initialization.
696 (build_vec_init): Likewise.
697 (build_value_init_1): Use build_aggr_init_expr.
699 2008-07-30 Dodji Seketeli <dseketel@redhat.com>
702 * decl2.c (fix_temporary_vars_context_r): New function.
703 (one_static_initialization_or_destruction): Make sure temporary
704 variables part of the initialiser have their DECL_CONTEXT()
707 2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
710 * typeck.c (build_binary_op): Encapsulate code into
713 2008-07-29 Jakub Jelinek <jakub@redhat.com>
716 * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
717 TYPE_UID instead of pointers.
719 2008-07-29 Jan Hubicka <jh@suse.cz>
721 * optimize.c (maybe_clone_body): Remove DECL_INLINE.
722 * decl.c (duplicate_decls): Likewise.
723 (grokfndecl): Likewise.
724 (start_method): Likewise.
725 * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
727 * pt.c (register_specialization, regenerate_decl_from_template):
729 * decl2.c (grokfield): Likewise.
731 2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
734 * decl.c (duplicate_decls): Merge USED flags.
736 2008-07-27 Jason Merrill <jason@redhat.com>
739 * decl.c (reshape_init_r): Allow C++0x initializer lists.
741 2008-07-28 Richard Guenther <rguenther@suse.de>
743 Merge from gimple-tuples-branch.
745 2008-07-22 Aldy Hernandez <aldyh@redhat.com>
747 * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
750 2008-07-18 Jakub Jelinek <jakub@redhat.com>
752 * decl.c (finish_function): Call gimple_body after cp_genericize.
754 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
756 * optimize.c: Include gimple.h instead of tree-gimple.h.
757 * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
758 * cp-gimplify.c: Rename tree-gimple.h to gimple.h. Include
761 2008-07-16 Jakub Jelinek <jakub@redhat.com>
763 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
765 2008-07-14 Jakub Jelinek <jakub@redhat.com>
767 * cp-gimplify.c (cp_gimplify_expr): Update comment.
769 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
771 * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
773 * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
774 GIMPLE_MODIFY_STMT to MODIFY_EXPR.
775 (cxx_omp_clause_copy_ctor): Same.
776 (cxx_omp_clause_assign_op): Same.
778 2008-05-28 Jakub Jelinek <jakub@redhat.com>
780 * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument. Tuplify.
781 (cp_gimplify_expr): Adjust caller.
783 2008-05-11 Doug Kwan <dougkwan@google.com>
785 * init.c (build_vec_delete): Add type conversion for argument
786 0 of POINTER_PLUS_EXPR.
788 2008-04-29 Doug Kwan <dougkwan@google.com>
790 * decl2 (File): Include "gimple.h"
791 (cp_write_global_declarations): Use gimple_body instead of
793 * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
795 2008-04-10 Diego Novillo <dnovillo@google.com>
797 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
799 * optimize.c (maybe_clone_body): Re-enable call to
801 * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
802 code with call to gimple_unreachable.
803 (cp_genericize): Fix handling of clone bodies.
805 2008-04-04 Diego Novillo <dnovillo@google.com>
807 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
809 * optimize.c (maybe_clone_body): Re-enable.
811 2008-02-19 Diego Novillo <dnovillo@google.com>
812 Oleg Ryjkov <olegr@google.com>
814 http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
816 * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
817 argument to gimple_seq *. Update all users.
818 (gimplify_must_not_throw_expr): Likewise.
820 2008-02-04 Oleg Ryjkov <olegr@google.com>
822 * except.c: Include gimple.h
823 (cp_protect_cleanup_actions): Convert to tuples.
824 * Make-lang.in (cp/except.o): Add dependency on gimple.h
826 2007-11-10 Aldy Hernandez <aldyh@redhat.com>
828 * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
829 instead of annotating each block manually.
831 2007-10-30 Aldy Hernandez <aldyh@redhat.com>
833 * cp-gimplify.c (gimplify_cp_loop): Tuplify.
834 (gimplify_for_stmt): Same.
835 (gimplify_switch_stmt): Same.
836 (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt. Return
838 [WHILE_STMT]: Return GS_OK.
840 [CONTINUE_STMT]: Same.
842 (cp_genericize): Set gimple_body() of cloned functions when needed.
844 2007-10-29 Aldy Hernandez <aldy@quesejoda.com>
846 * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
847 (cp_gimplify_init_expr): Convert to tuples.
848 (gimplify_must_not_throw_expr): Make function return a
849 gimplify_status and convert to tuples.
851 2007-10-18 Aldy Hernandez <aldy@quesejoda.com>
853 * cp-gimplify.c (genericize_try_block): Enable and do not call
855 (genericize_catch_block): Same.
856 (genericize_eh_spec_block): Same.
857 Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
858 (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
860 2007-10-16 Aldy Hernandez <aldy@quesejoda.com>
862 * optimize.c (maybe_clone_body): Comment out call to clone_body.
863 * decl.c (finish_function): Use gimple_body instead of
865 * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
866 * cp-gimplify.c (genericize_try_block): Comment out.
867 (genericize_catch_block): Same.
868 (genericize_eh_spec_block): Same.
869 (gimplify_cp_loop): Comment out calls to gimplify_stmt.
870 (gimplify_for_stmt): Comment out.
871 (gimplify_switch_stmt): Comment out call to gimplify_stmt.
872 (cp_gimplify_omp_for): Same.
873 (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
874 Comment out call to gimplify_stmt and append_to_statement_list.
875 Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
876 (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
877 (cp_gimplify_expr): Same.
878 Comment out calls to genericize_*_block. Comment out call to
881 2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
884 * class.c (type_has_user_provided_default_constructor): Handle
887 2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
889 * decl.c (push_library_fn): Add a parameter for the exceptions that
890 the function may throw.
891 (push_void_library_fn, push_throw_library_fn, expand_static_init):
893 (build_library_fn): Change to static.
894 * cp-tree.h: Adjust declarations.
895 * except.c (declare_nothrow_library_fn): New.
896 (do_get_exception_ptr, do_begin_catch, do_free_exception,
897 do_allocate_exception): Use the latter, adjust the declarations
898 (ie, add empty exception-specification), consistently with the
899 actual implementation in libsupc++.
901 2008-07-25 Jan Hubicka <jh@suse.cz>
903 * typeck.c (inline_conversion): Remove.
904 (cp_build_function_call): Do not use inline_conversion.
905 * decl.c (duplicate_decls): Do not insist on inline being declared
907 (start_cleanup_fn): Do not assume that INLINE flags prevent function
908 from being output. We now remove static functions always.
909 (finish_function): Do return warning on all static functions.
910 * call.c (build_over_call): Do not use inline_conversion.
911 * cp-tree.h (possibly_inlined_p): Declare.
912 (inline_conversion): Remove.
913 * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
914 * decl2.c (cp_write_global_declarations): Likewise.
915 (mark_used): Likewise.
916 (possibly_inlined_p): New functions.
918 2008-07-25 Jason Merrill <jason@redhat.com>
920 * class.c (type_has_user_provided_default_constructor): Handle
923 2008-07-23 Jan Hubicka <jh@suse.cz>
925 * decl.c (duplicate_decls): Update comment and unit-at-a-time.
926 (grogfndecl): Drop flag_inline_trees code.
927 * pt.c (instantiate_decl): Drop flag_iline_trees code.
928 * lex.c (cxx_init): Do not set unit-at-a-time.
930 2008-07-23 Jason Merrill <jason@redhat.com>
932 * mangle.c (write_unqualified_name): Avoid infinite recursion when
933 trying to mangle a decl with no name.
935 Implement defaulted/deleted functions as per N2346
936 * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
937 (DECL_DELETED_FN): New macro.
938 (DECL_DEFAULTED_FN): New macro.
939 * class.c (user_provided_p): New fn.
940 (defaultable_fn_p): New fn.
941 (type_has_user_provided_constructor): New fn.
942 (type_has_user_provided_default_constructor): New fn.
943 (check_methods): A defaulted fn is still trivial.
944 (check_bases_and_members): Likewise.
945 * decl.c (grok_special_member_properties): Likewise.
946 (duplicate_decls): Complain about redeclaring a function as deleted.
947 (start_decl): initialized==2 means deleted.
948 (cp_finish_decl): Handle deleted/defaulted semantics.
949 * decl2.c (grokfield): Likewise.
950 (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
951 Complain about using a deleted fn.
952 * init.c (build_value_init_1): Use type_has_user_provided_constructor.
953 (perform_member_init): Check for a user-provided default constructor
954 even if TYPE_NEEDS_CONSTRUCTING.
955 (build_new_1): Likewise.
956 * call.c (build_over_call): Don't call mark_used twice.
957 * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
958 * search.c (check_final_overrider): Check for deleted mismatch.
959 * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
960 (cp_parser_pure_specifier): Handle =default and =delete.
962 * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
964 2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
967 * typeck.c: All calls to pedwarn changed.
968 * decl.c: All calls to pedwarn changed.
969 * call.c: All calls to pedwarn changed.
970 * error.c: All calls to pedwarn changed.
971 * typeck2.c: All calls to pedwarn changed.
972 * pt.c: All calls to pedwarn changed.
973 * name-lookup.c: All calls to pedwarn changed.
974 * parser.c: All calls to pedwarn changed.
976 2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
978 * call.c: Fix comment typos.
980 * cp-tree.h: Likewise.
981 * cxx-pretty-print.c: Likewise.
984 * name-lookup.c: Likewise.
985 * operators.def: Likewise.
986 * parser.c: Likewise.
989 * typeck.c: Likewise.
991 2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
995 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
996 copy constructors and copy assignment operators proper.
998 2008-07-21 Rafael Ávila de Espíndola <espindola@google.com>
1000 * parser.c (cp_token): Remove in_system_header.
1001 (eof_token): Remove in_system_header.
1002 (cp_lexer_get_preprocessor_token): Don't set in_system_header.
1003 (cp_lexer_set_source_position_from_token): Don't set in_system_header.
1004 (cp_parser_member_declaration): Use in_system_header_at.
1005 * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
1006 (pop_tinst_level): Don't set in_system_header.
1007 (instantiate_class_template): Don't set in_system_header.
1008 (instantiate_decl): Don't set in_system_header.
1009 (instantiate_pending_templates): Don't set in_system_header.
1011 2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
1014 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1015 TYPE_NOTHROW_P, not TREE_NOTHROW.
1016 (trait_expr_value): Likewise.
1018 2008-07-18 Dodji Seketeli <dseketel@redhat.com>
1021 * call.c (convert_like_real): Don't take the error code path
1022 when a rvalue or base conversion has the bad_p field set.
1024 2008-07-18 Kris Van Hees <kris.van.hees@oracle.com>
1026 * rtti.c (emit_support_tinfos): Add char16_type_node and
1028 * typeck2.c (digest_init): Support char16_t and char32_t.
1030 2008-07-18 Kavih R. Ghazi <ghazi@caip.rutgers.edu>
1032 * cvt.c (convert_to_void): Avoid C++ keywords.
1033 * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
1035 * friend.c (is_friend): Likewise.
1036 * init.c (perform_member_init): Likewise.
1037 * mangle.c (write_template_prefix, write_template_template_param):
1039 * name-lookup.c (do_namespace_alias, do_using_directive,
1040 parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
1041 * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
1042 cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
1044 * pt.c (is_specialization_of_friend, lookup_template_class,
1045 push_tinst_level, instantiate_class_template,
1046 tsubst_copy_and_build): Likewise.
1047 * tree.c (add_stmt_to_compound): Likewise.
1048 * typeck.c (finish_class_member_access_expr): Likewise.
1050 2008-07-17 Julian Brown <julian@codesourcery.com>
1051 Mark Mitchell <mark@codesourcery.com>
1053 * decl2.c (determine_visibility): Allow target to override
1054 visibility of class data.
1056 2008-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1059 * semantics.c (trait_expr_value): Update __has_trivial_destructor
1060 semantics to the current WP (N2691).
1062 2008-07-16 Dodji Seketeli <dseketel@redhat.com>
1065 * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
1066 (pushdecl_maybe_friend): Check if a redeclaration of extern C function
1067 complies with exception specification constraints.
1069 2008-07-14 Jason Merrill <jason@redhat.com>
1071 * lex.c (init_reswords): Always set D_OBJC.
1073 2008-07-11 Tom Tromey <tromey@redhat.com>
1074 Ian Lance Taylor <iant@google.com>
1076 * lex.c (struct resword, reswords): Don't define.
1077 (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
1078 (init_reswords): Clarify mask code. Use c_common_reswords rather
1081 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1084 * decl.c (grokdeclarator): Warn about initializing variables
1085 of storage class 'extern' only after the type of the declarator
1086 has been properly computed.
1088 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1091 * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
1092 carries the location of the primary type.
1093 * parser.c (cp_parser_check_type_definition): Update documentation.
1094 (cp_parser_check_for_definition_in_return_type,
1095 cp_parser_check_for_invalid_template_id,
1096 cp_parser_set_decl_spec_type,
1097 cp_parser_check_for_definition_in_return_type,
1098 cp_parser_diagnose_invalid_type_name,
1099 cp_parser_new_expression, cp_parser_explicit_instantiation,
1100 cp_parser_type_specifier, cp_parser_simple_type_specifier,
1101 cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
1104 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1108 * semantic.c (qualified_name_lookup_error, finish_id_expression):
1109 Add a location_t parameter so that
1110 error message can have a more accurate location.
1111 * cp-tree.h: Updated prototype
1112 * pt.c (tsubst_qualified_id): Use location in error messages.
1113 * parser.c (cp_parser_postfix_expression,
1114 cp_parser_objc_statement, cp_parser_trait_expr,
1115 cp_parser_token_is_class_key,
1116 cp_parser_uncommitted_to_tentative_parse_p,
1117 cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
1118 cp_parser_error, cp_parser_name_lookup_error,
1119 cp_parser_simulate_error, cp_parser_check_decl_spec,
1120 cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
1121 cp_parser_diagnose_invalid_type_name,
1122 cp_parser_parse_and_diagnose_invalid_type_name,
1123 cp_parser_require_pragma_eol, cp_parser_make_typename_type,
1124 cp_parser_string_literal, cp_parser_primary_expression,
1125 cp_parser_primary_expression, cp_parser_unqualified_id,
1126 cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
1127 cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
1128 cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
1129 cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
1130 cp_parser_jump_statement, cp_parser_block_declaration,
1131 cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
1132 cp_parser_function_specifier_opt, cp_parser_decltype,
1133 cp_parser_mem_initializer_list, cp_parser_mem_initializer,
1134 cp_parser_mem_initializer_id, cp_parser_template_parameter,
1135 cp_parser_type_parameter, cp_parser_template_id,
1136 cp_parser_template_name, cp_parser_template_argument): Likewise.
1138 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1141 * pt.c (tsubst_function_type): Remove warning for type qualifiers
1142 on function return type.
1144 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1147 * pt.c (tsubst_function_type): Don't warn for type qualifiers
1148 on function return type in case of system header.
1150 2008-07-09 Raksit Ashok <raksit@google.com>
1152 * parser.c (cp_parser_postfix_expression): New warning based on flag
1153 warn_disallowed_functions.
1155 2008-07-08 Simon Martin <simartin@users.sourceforge.net>
1158 * decl.c (grokdeclarator): Reset storage_class and staticp for friend
1159 functions declared with a storage class qualifier.
1161 2008-07-03 Richard Guenther <rguenther@suse.de>
1164 * typeck.c (cp_build_function_call): Move code to verify
1165 builtin function arguments ...
1166 * call.c (build_cxx_call): ... here.
1168 2008-07-02 Jason Merrill <jason@redhat.com>
1170 * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
1172 Implement WG21 N2672, Initializer List proposed wording
1173 * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
1174 (struct lang_type_class): Add has_list_ctor bitfield.
1175 (TYPE_HAS_LIST_CTOR): New macro.
1176 (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
1177 (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
1178 (LOOKUP_NO_NARROWING): New macro.
1179 (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
1180 * parser.c (cp_parse_braced_list): Split out from...
1181 (cp_parser_initializer_clause): ...here.
1182 (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
1184 (cp_lexer_next_token_is_not_keyword): New fn.
1185 (cp_parser_parenthesized_expression_list): Handle { }.
1186 (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
1187 (cp_parser_assignment_expression, cp_parser_condition): Likewise.
1188 (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
1189 (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
1190 (cp_parser_initializer, cp_parser_functional_cast): Likewise.
1191 (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
1192 (cp_parser_save_member_function_body): Likewise.
1193 * call.c (conversion_kind): Add ck_list, ck_aggr.
1194 (struct conversion): Add check_narrowing bitfield, conversion list.
1195 (build_list_conv): New fn.
1196 (build_aggr_conv): New fn.
1197 (implicit_conversion): Call them.
1198 (standard_conversion): Set check_narrowing if appropriate.
1199 (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
1200 (build_user_type_conversion_1): When converting from an init list,
1201 we allow additional conversions except when calling a copy ctor.
1202 (convert_like_real): Calling an explicit ctor for an init list is
1203 ill-formed. Handle ck_list and ck_addr. Check narrowing.
1204 (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
1205 class doesn't have a list ctor, break the {} into a TREE_LIST.
1206 (compare_ics): ck_list is better than other UDCs.
1207 (set_up_extended_ref_temp): Split out from initialize_reference.
1208 (is_std_init_list): New fn.
1209 (is_list_ctor): New fn.
1210 * decl.c (cxx_init_decl_processing): Create init_list_type_node.
1211 (reshape_init_array_1): Pass it to build_constructor.
1212 (reshape_init_class): Ditto.
1213 (initialize_artificial_var): Pass the appropriate type.
1214 (build_aggr_init_full_exprs): Split out from...
1215 (check_initializer): ...here. Handle new semantics.
1216 (build_init_list_var_init): New subroutine of check_initializer.
1217 (grokdeclarator): Converting constructors can have more than one parm.
1218 (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
1219 * init.c (expand_default_init): Only do digest_init for aggregates.
1220 * rtti.c (tinfo_base_init): Pass init_list_type_node to
1221 build_constructor_from_list.
1222 (generic_initializer, ptr_initializer): Ditto.
1223 (ptm_initializer, class_initializer): Ditto.
1224 (get_pseudo_ti_init): Ditto.
1225 * error.c (dump_type): Handle init_list_type_node.
1226 (maybe_warn_cpp0x): New fn.
1227 (maybe_varn_variadic_templates): Call it.
1228 * cvt.c (ocp_convert): Handle conversion from { }.
1229 * tree.c (build_array_of_n_type): New fn.
1230 * typeck2.c (store_init_value): Use init_list_type_node.
1231 (digest_init): Likewise.
1232 (check_narrowing): New fn.
1233 * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
1234 of vector of constructor elts. Handle non-aggregate types. Make
1235 constant literals static.
1236 * pt.c: (tsubst_copy_and_build): Adjust.
1237 (unify): Handle { }.
1238 * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
1240 2008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
1242 * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
1243 (comp_ptr_ttypes_const): Likewise.
1245 2008-07-01 Andrew Haley <aph@redhat.com>
1247 * decl.c (finish_constructor_body): Don't set the return value of
1248 the constructor if the constructor is that of a Java type.
1250 2008-06-30 Jakub Jelinek <jakub@redhat.com>
1253 * decl2.c (is_late_template_attribute): If the first attribute
1254 argument is IDENTIFIER_NODE, don't consider it when checking
1255 if arguments are value or type dependent.
1257 2008-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1260 * pt.c (do_type_instantiation): In c++0x mode do not warn for
1263 2008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1265 * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
1267 2008-06-28 Jakub Jelinek <jakub@redhat.com>
1270 * repo.c (repo_emit_p): Put const static data members initialized
1271 by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
1274 2008-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1277 * pt.c (do_decl_instantiation): In c++0x mode do not warn for
1280 2008-06-24 Jonathan Wakely <jwakely.gcc@gmail.com>
1283 * typeck.c (cp_build_function_call): Show example syntax in
1286 2008-06-21 Jonathan Wakely <jwakely.gcc@gmail.com>
1288 * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
1289 cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
1290 pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
1291 build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
1292 pedwarn to permerror.
1293 * init.c (perform_member_init, build_new_1, build_new): Likewise.
1294 * decl.c (warn_extern_redeclared_static, duplicate_decls,
1295 * identify_goto, check_previous_goto_1, check_goto, define_label,
1296 check_tag_decl, start_decl, check_class_member_definition_namespace,
1297 grokfndecl, grokdeclarator): Likewise.
1298 * except.c (check_handlers): Likewise.
1299 * typeck2.c (digest_init): Likewise.
1300 * pt.c (check_specialization_namespace,
1301 check_explicit_instantiation_namespace,
1302 maybe_process_partial_specialization, check_explicit_specialization,
1303 convert_template_argument, do_decl_instantiation,
1304 do_type_instantiation, instantiate_decl): Likewise.
1305 * semantics.c (finish_template_type_parm): Likewise.
1306 * name-lookup.c (pushdecl_maybe_friend,
1307 check_for_out_of_scope_variable): Likewise.
1308 * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
1309 coerce_new_type): Likewise.
1310 * parser.c (cp_parser_nested_name_specifier_opt,
1311 cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
1312 cp_parser_class_head, cp_parser_check_class_key): Likewise.
1313 (cp_parser_parameter_declaration): Check flag_permissive instead of
1314 flag_pedantic_errors.
1315 * call.c (joust): Change pedwarn to warning.
1316 * friend.c (make_friend_class): Likewise.
1318 2008-06-16 Jan Hubicka <jh@suse.cz>
1320 * method.c: Include cgraph.h.
1321 (use_thunk): Use cgraph_add_new_function instead of calling backend
1324 2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1326 * parser.c: Fix comment typo.
1328 2008-06-14 Simon Martin <simartin@users.sourceforge.net>
1331 * decl2.c (grokbitfield): Receive the list of attributes, pass it to
1332 grokdeclarator and apply it to the created declaration.
1333 * cp-tree.h (grokbitfield): Update prototype.
1334 * parser.c (cp_parser_member_declaration): Don't apply the attributes
1335 since they are now applied in grokbitfield. Adjusted the call to
1337 (cp_parser_objc_class_ivars): Likewise.
1339 2008-06-14 Simon Martin <simartin@users.sourceforge.net>
1342 * class.c (type_requires_array_cookie): Do not consider delete[]
1343 operators with an ellipsis as second argument.
1345 2008-06-09 Jakub Jelinek <jakub@redhat.com>
1348 * semantics.c (stmt_expr_value_expr): Don't crash on empty
1351 2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
1354 * pt.c (maybe_process_partial_specialization): Check the tree
1355 returned by push_template_decl for error_mark_node.
1356 * parser.c (cp_parser_class_head): Likewise, check the tree
1357 returned by the latter.
1359 2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
1362 * decl.c (grokdeclarator): In case of wrong return type return
1363 immediately error_mark_node.
1365 2008-06-06 Jakub Jelinek <jakub@redhat.com>
1367 * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
1368 dependent_omp_for_p, begin_omp_task, finish_omp_task,
1369 finish_omp_taskwait): New prototypes.
1370 (cxx_omp_clause_default_ctor): Add outer argument.
1371 (finish_omp_for): Add new clauses argument.
1372 * cp-gimplify.c (cxx_omp_finish_clause): New function.
1373 (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
1374 (cxx_omp_clause_default_ctor): Add outer argument.
1375 (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
1376 * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
1377 * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
1378 Add par_clauses argument. If decl is present in parallel's
1379 lastprivate clause, change that clause to shared and add
1380 a lastprivate clause for decl to OMP_FOR_CLAUSES.
1381 Fix wording of error messages. Adjust finish_omp_for caller.
1382 Add clauses argument. Parse loops with random access iterators.
1383 (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
1385 (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
1386 cp_parser_omp_for_loop callers.
1387 (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
1389 (cp_parser_omp_clause_name): Handle collapse and untied
1391 (cp_parser_omp_clause_schedule): Handle auto schedule.
1392 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
1393 and PRAGMA_OMP_CLAUSE_UNTIED.
1394 (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
1395 (OMP_TASK_CLAUSE_MASK): Define.
1396 (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
1397 (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
1398 (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
1399 PRAGMA_OMP_TASKWAIT.
1400 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
1401 OMP_CLAUSE_UNTIED. Handle OMP_CLAUSE_LASTPRIVATE_STMT.
1402 (tsubst_omp_for_iterator): New function.
1403 (dependent_omp_for_p): New function.
1404 (tsubst_expr) <case OMP_FOR>: Use it. Handle collapsed OMP_FOR
1405 loops. Adjust finish_omp_for caller. Handle loops with random
1406 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes.
1407 (tsubst_expr): Handle OMP_TASK.
1408 * semantics.c (cxx_omp_create_clause_info): New function.
1409 (finish_omp_clauses): Call it. Handle OMP_CLAUSE_UNTIED and
1410 OMP_CLAUSE_COLLAPSE.
1411 (cxx_omp_predetermined_sharing): Removed.
1412 * semantics.c (finish_omp_for): Allow pointer iterators. Use
1413 handle_omp_for_class_iterator and dependent_omp_for_p. Handle
1414 collapsed for loops. Adjust c_finish_omp_for caller. Add new
1415 clauses argument. Fix check for type dependent cond or incr.
1416 Set OMP_FOR_CLAUSES to clauses. Use cp_convert instead of
1417 fold_convert to convert incr amount to difference_type. Only
1418 fold if not in template. If decl is mentioned in lastprivate
1419 clause, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle loops with random
1420 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR}
1422 (finish_omp_threadprivate): Allow static class members of the
1424 (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
1425 finish_omp_taskwait): New functions.
1427 * parser.c (cp_parser_binary_expression): Add prec argument.
1428 (cp_parser_assignment_expression): Adjust caller.
1429 * cp-tree.h (outer_curly_brace_block): New prototype.
1430 * decl.c (outer_curly_brace_block): No longer static.
1432 2008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1435 * pt.c (push_template_decl_real): Consistently return error_mark_node
1438 2008-06-02 Tomas Bily <tbily@suse.cz>
1440 * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
1441 (cp_build_unary_op): Likewise.
1442 (cp_build_indirect_ref): Use CONVERT_EXPR_P.
1443 (maybe_warn_about_returning_address_of_local): Likewise.
1445 2008-05-29 Paolo Carlini <paolo.carlini@oracle.com>
1448 * pt.c (tsubst_initializer_list): Consistently check the tree
1449 returned by tsubst_pack_expansion for error_mark_node.
1451 2008-05-27 Michael Matz <matz@suse.de>
1454 * call.c (build_new_op): Make warning conditional on
1457 2008-05-27 Alexandre Oliva <aoliva@redhat.com>
1460 * call.c (convert_like_real): Convert bitfield to desired type
1461 before creating temporary.
1463 2008-05-26 Daniel Franke <franke.daniel@gmail.com>
1465 * Makefile.in: Adjusted dependencies on c-incpath.o.
1467 2008-05-23 Jakub Jelinek <jakub@redhat.com>
1470 * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
1471 fold_build_cleanup_point_expr on build_call_a results.
1474 * semantics.c (omp_clause_info_fndecl): New function.
1475 (finish_omp_clauses): Use it.
1477 2008-05-21 Jakub Jelinek <jakub@redhat.com>
1480 * cp-tree.h (check_array_initializer): New prototype.
1481 * decl.c (check_array_initializer): New function.
1482 (check_initializer): Call it.
1483 * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
1485 2008-05-21 Tom Tromey <tromey@redhat.com>
1487 * mangle.c (save_partially_mangled_name): Remove.
1488 (restore_partially_mangled_name): Likewise.
1489 (write_encoding): Update.
1490 (write_unqualified_name): Likewise.
1491 (start_mangling): Always use name_obstack. Remove 'ident_p'
1493 (get_identifier_nocopy): Remove.
1494 (finish_mangling_internal): Rename from finish_mangling.
1495 (finish_mangling): New function.
1496 (finish_mangling_get_identifier): Likewise.
1497 (partially_mangled_name, partially_mangled_name_len): Remove.
1498 (mangle_decl_string): Change return type. Update.
1499 (mangle_decl, mangle_type_string, mangle_special_for_type,
1500 mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
1501 mangle_ref_init_variable): Update.
1503 2008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1506 * semantics.c (begin_class_definition): Extend checks on the first
1509 2008-05-12 Tomas Bily <tbily@suse.cz>
1511 * typeck2.c (digest_init): Use CONVERT_EXPR_P.
1512 * call.c (build_over_call): Likewise.
1513 * error.c (dump_expr): Use CASE_CONVERT.
1514 * class.c (fixed_type_or_null): Likewise.
1516 2008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
1518 * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
1520 (cp_parser_omp_clause_schedule): Remove superfluous "expected"
1523 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
1525 * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
1526 DECL_LOOPING_CONST_OR_PURE_P attributes.
1527 * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
1530 2008-05-02 Simon Baldwin <simonb@google.com>
1533 * typeck.c (build_array_ref): Remove warn_array_subscript_range.
1535 2008-05-01 Simon Baldwin <simonb@google.com>
1537 * typeck.c (build_array_ref): Call warn_array_subscript_range.
1539 2008-04-30 Jakub Jelinek <jakub@redhat.com>
1542 * pt.c (more_specialized_fn): Stop the loop even if there are no
1543 arguments before ellipsis.
1545 2008-04-29 Jakub Jelinek <jakub@redhat.com>
1548 * parser.c (cp_parser_lookup_name): Look through single function
1552 * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
1553 COMPOUND_EXPR if the second argument would be error_mark_node.
1555 2008-04-28 Jason Merrill <jason@redhat.com>
1556 Liu Guanwei <liu_gw@163.com>
1559 * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
1560 in default arguments.
1562 2008-04-25 Jan Hubicka <jh@suse.cz>
1564 * typeck.c (check_return_expr): Update.
1565 * decl.c (start_preparsed_function): Update.
1566 * method.c (use_thunk): Update.
1568 2008-04-24 Jakub Jelinek <jakub@redhat.com>
1571 * cp-tree.h (cp_reconstruct_complex_type): New prototype.
1572 * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
1573 * decl2.c (is_late_template_attribute): Only make vector_size
1574 late tmpl attribute if argument is type or value dependent.
1575 (cp_reconstruct_complex_type): New function.
1577 2008-04-24 Richard Guenther <rguenther@suse.de>
1579 * typeck.c (cp_build_function_call): Call
1580 check_builtin_function_arguments.
1582 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
1584 * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
1585 (build_ptrmemfunc1): Don't set TREE_INVARIANT.
1586 * init.c (build_zero_init): Don't set TREE_INVARIANT.
1587 * class.c (build_base_path): Don't set TREE_INVARIANT.
1588 (build_vtbl_ref_1): Don't set TREE_INVARIANT.
1589 (build_vtbl_initializer): Don't set TREE_INVARIANT.
1590 * decl.c (build_enumerator): Don't set TREE_INVARIANT.
1591 * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
1592 (generic_initializer): Don't set TREE_INVARIANT.
1593 (ptr_initializer): Don't set TREE_INVARIANT.
1594 (ptm_initializer): Don't set TREE_INVARIANT.
1595 (class_initializer): Don't set TREE_INVARIANT.
1596 * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
1597 * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
1598 (build_template_parm_index): Don't set TREE_INVARIANT.
1599 (reduce_template_parm_level): Don't set TREE_INVARIANT.
1600 (process_template_parm): Don't set TREE_INVARIANT.
1602 2008-04-22 Jason Merrill <jason@redhat.com>
1605 * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
1606 to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
1607 * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
1609 2008-04-22 Jakub Jelinek <jakub@redhat.com>
1612 * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
1613 expression is errorneous.
1615 2008-04-21 Jason Merrill <jason@redhat.com>
1618 * tree.c (cp_tree_equal): Handle FIXED_CST.
1621 * pt.c (template_template_parm_bindings_ok_p): Set
1622 processing_template_decl while in this function.
1624 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1626 * cvt.c (type_promotes_to): Support char16_t and char32_t.
1627 * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
1628 char16_t and char32_t.
1629 * lex.c (reswords): Add char16_t and char32_t (for c++0x).
1630 * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
1631 extended builtin type "u8char{16,32}_t".
1632 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
1634 (cp_lexer_print_token): Support CPP_STRING{16,32}.
1635 (cp_parser_is_string_literal): Idem.
1636 (cp_parser_string_literal): Idem.
1637 (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
1639 (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
1640 * tree.c (char_type_p): Support char16_t and char32_t as char types.
1641 * typeck.c (string_conv_p): Support char16_t and char32_t.
1643 2008-04-17 Jason Merrill <jason@redhat.com>
1646 * call.c (build_user_type_conversion_1): Represent second step of
1647 copy-init with an rvalue conversion.
1648 (convert_like_real) [ck_user]: Don't implicitly add it here.
1650 2008-04-15 Jakub Jelinek <jakub@redhat.com>
1653 * decl.c (layout_var_decl): If extern or static var has variable
1654 size, set TREE_TYPE (decl) to error_mark_node.
1656 2008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
1659 * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
1662 2008-04-09 Jason Merrill <jason@redhat.com>
1665 * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
1666 not a pushed variable.
1668 2008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
1670 * call.c (build_op_delete_call): Fix quotation in warning message.
1671 * decl.c (grokdeclarator): Quote keyword in error message.
1672 * pt.c (check_for_bare_parameter_packs): Fix quotation in error
1675 * parser.c (cp_parser_check_type_definition): Print error string
1676 directly rather than using "%s".
1677 (cp_parser_postfix_expression): Fix quotation.
1678 (cp_parser_decltype): Likewise.
1679 (cp_parser_sizeof_operand): Fix quotation. Simplify.
1681 * parser.c (cp_parser_non_integral_constant_expression): Build error
1682 message with CONCAT rather than using "%s".
1683 (cp_parser_primary_expression): Fix quotation.
1684 (cp_parser_postfix_expression): Likewise.
1685 (cp_parser_postfix_dot_deref_expression): Likewise.
1686 (cp_parser_unary_expression): Likewise.
1687 (cp_parser_new_expression): Likewise.
1688 (cp_parser_delete_expression): Likewise.
1690 * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
1691 as `)', not as `('. Fix quotation.
1692 (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
1693 (cp_parser_primary_expression): Likewise.
1694 (cp_parser_nested_name_specifier_opt): Likewise.
1695 (cp_parser_postfix_expression): Likewise.
1696 (cp_parser_postfix_open_square_expression): Likewise.
1697 (cp_parser_parenthesized_expression_list): Likewise.
1698 (cp_parser_pseudo_destructor_name): Likewise.
1699 (cp_parser_new_expression): Likewise.
1700 (cp_parser_direct_new_declarator): Likewise.
1701 (cp_parser_delete_expression): Likewise.
1702 (cp_parser_cast_expression): Likewise.
1703 (cp_parser_question_colon_clause): Likewise.
1704 (cp_parser_builtin_offsetof): Likewise.
1705 (cp_parser_trait_expr): Likewise.
1706 (cp_parser_label_for_labeled_statement): Likewise.
1707 (cp_parser_compound_statement): Likewise.
1708 (cp_parser_selection_statement): Likewise.
1709 (cp_parser_condition): Likewise.
1710 (cp_parser_iteration_statement): Likewise.
1711 (cp_parser_already_scoped_statement): Likewise.
1712 (cp_parser_simple_declaration): Likewise.
1713 (cp_parser_linkage_specification): Likewise.
1714 (cp_parser_static_assert): Likewise.
1715 (cp_parser_decltype): Likewise.
1716 (cp_parser_conversion_function_id): Likewise.
1717 (cp_parser_operator_function_id): Likewise.
1718 (cp_parser_operator): Likewise.
1719 (cp_parser_type_parameter): Likewise.
1720 (cp_parser_template_id): Likewise.
1721 (cp_parser_explicit_instantiation): Likewise.
1722 (cp_parser_explicit_specialization): Likewise.
1723 (cp_parser_enum_specifier): Likewise.
1724 (cp_parser_namespace_definition): Likewise.
1725 (cp_parser_namespace_alias_definition): Likewise.
1726 (cp_parser_using_declaration): Likewise.
1727 (cp_parser_using_directive): Likewise.
1728 (cp_parser_asm_definition): Likewise.
1729 (cp_parser_direct_declarator): Likewise.
1730 (cp_parser_ptr_operator): Likewise.
1731 (cp_parser_parameter_declaration_clause): Likewise.
1732 (cp_parser_initializer_clause): Likewise.
1733 (cp_parser_class_specifier): Likewise.
1734 (cp_parser_member_specification_opt): Likewise.
1735 (cp_parser_member_declaration): Likewise.
1736 (cp_parser_pure_specifier): Likewise.
1737 (cp_parser_constant_initializer): Likewise.
1738 (cp_parser_base_clause): Likewise.
1739 (cp_parser_exception_specification_opt): Likewise.
1740 (cp_parser_try_block): Likewise.
1741 (cp_parser_function_try_block): Likewise.
1742 (cp_parser_handler): Likewise.
1743 (cp_parser_throw_expression): Likewise.
1744 (cp_parser_asm_operand_list): Likewise.
1745 (cp_parser_attributes_opt): Likewise.
1746 (cp_parser_label_declaration): Likewise.
1747 (cp_parser_constructor_declarator_p): Likewise.
1748 (cp_parser_template_declaration_after_export): Likewise.
1749 (cp_parser_single_declaration): Likewise.
1750 (cp_parser_objc_message_expression): Likewise.
1751 (cp_parser_objc_message_args): Likewise.
1752 (cp_parser_objc_encode_expression): Likewise.
1753 (cp_parser_objc_defs_expression): Likewise.
1754 (cp_parser_objc_protocol_expression): Likewise.
1755 (cp_parser_objc_selector_expression): Likewise.
1756 (cp_parser_objc_protocol_refs_opt): Likewise.
1757 (cp_parser_objc_typename): Likewise.
1758 (cp_parser_objc_method_keyword_params): Likewise.
1759 (cp_parser_objc_superclass_or_category): Likewise.
1760 (cp_parser_objc_try_catch_finally_statement): Likewise.
1761 (cp_parser_objc_synchronized_statement): Likewise.
1762 (cp_parser_objc_throw_statement): Likewise.
1763 (cp_parser_omp_var_list_no_open): Likewise.
1764 (cp_parser_omp_clause_default): Likewise.
1765 (cp_parser_omp_clause_if): Likewise.
1766 (cp_parser_omp_clause_num_threads): Likewise.
1767 (cp_parser_omp_clause_reduction): Likewise.
1768 (cp_parser_omp_clause_schedule): Likewise.
1769 (cp_parser_omp_critical): Likewise.
1770 (cp_parser_omp_for_loop): Likewise.
1771 (cp_parser_omp_sections_scope): Likewise.
1773 * parser.c (cp_parser_template_parameter_list): Simplify.
1775 2008-04-07 James E. Wilson <wilson@tuliptree.org>
1777 * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
1779 2008-04-07 Jason Merrill <jason@redhat.com>
1782 * class.c (type_has_user_nondefault_constructor): A template
1783 counts as a nondefault constructor.
1785 2008-04-04 Paolo Bonzini <bonzini@gnu.org>
1787 * decl.c (cxx_push_function_context): Delete.
1788 (cxx_pop_function_context): Delete.
1789 (start_preparsed_function): Merge cxx_push_function_context (!f->decl
1791 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
1792 LANG_HOOKS_FUNCTION_FINAL): Delete.
1793 (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
1794 LANG_HOOKS_MISSING_NORETURN_OK_P.
1795 * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
1797 * semantics.c (current_stmt_tree): Fix comment.
1799 2008-04-03 Jakub Jelinek <jakub@redhat.com>
1802 * semantics.c (finish_offsetof): Undo effect of convert_from_reference
1803 before calling fold_offsetof.
1805 2008-04-03 Tom Tromey <tromey@redhat.com>
1807 * Make-lang.in (c++_OBJS): New variable.
1809 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
1811 * optimize.c (clone_body): New, from tree-inline.c.
1813 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
1815 * method.c (synthesize_method): Use {push,pop}_function_context.
1816 * name-lookup.c (push_to_top_level): Likewise.
1817 * parser.c (cp_parser_late_parsing_for_member): Likewise.
1819 2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
1822 * parser.c (cp_parser_decl_specifier_seq): Add location to error
1825 2008-03-27 Tom Tromey <tromey@redhat.com>
1827 * Make-lang.in: Revert automatic dependency patch.
1829 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
1832 * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
1833 (build_compound_expr): New, for compatibility with C
1834 build_compound_expr.
1835 (cp_build_compound_expr): Renamed from build_compound_expr.
1836 (build_c_cast): New, for compatibility with C build_c_cast.
1837 (cp_build_c_cast): Renamed from build_c_cast.
1838 * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
1839 * decl.c (cxx_maybe_build_cleanup): Ditto.
1840 * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
1841 (cp_build_compound_expr): Renamed from build_compound_expr.
1842 (build_c_cast): Add C-compatible prototype.
1843 (cp_build_c_cast): Renamed from build_c_cast.
1844 * typeck2.c (build_functional_cast): Use cp_build_c_cast.
1845 * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
1847 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
1849 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
1850 tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
1851 ending in a pack expansion, both of which can occur when
1852 substituting into a nested template.
1853 (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
1854 instantiating the sizeof...(X) form, make tsubst_copy do the work.
1855 * parser.c (cp_parser_template_parameter): Deal with unnamed
1856 non-type template parameter packs identified by pack expansions in
1859 2008-03-26 Jakub Jelinek <jakub@redhat.com>
1862 * pt.c (apply_late_template_attributes): Don't call tsubst on
1863 first attribute argument if it is IDENTIFIER_NODE.
1866 * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
1867 and LTGT_EXPR to pp_expression.
1869 2008-03-26 Douglas Gregor <doug.gregor@gmail.com>
1871 * pt.c (coerce_template_template_parm): Moved the body of the loop
1872 of coerce_template_template_parms here, to make iteration over a
1873 template argument pack simpler.
1874 Also, allow matching of a template parameter pack in the template
1875 template parameter to a template parameter in the template
1877 (coerce_template_template_parms): Deal with variadic template
1878 template parameters. Use coerce_template_template_parm.
1879 (unify): Make sure we coerce the template template argument's
1880 template arguments to the template template parameter's template
1881 parameters, not the other way around.
1883 2008-03-25 Tom Tromey <tromey@redhat.com>
1885 * Make-lang.in: Remove .o targets.
1886 (cp/g++spec.o): Moved to cp/. Reduce to variable setting.
1888 (c++_OBJS): New variable.
1889 (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
1891 2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
1893 * typeck.c (composite_pointer_type_r): Add SFINAE support.
1894 (composite_pointer_type): Ditto.
1895 (common_type): Fix call to composite_pointer_type.
1896 (cxx_sizeof_nowarn): New; used to be a macro.
1897 (cxx_sizeof_expr): Add SFINAE support.
1898 (cxx_alignof_expr): Ditto.
1899 (decay_conversion): Fix calls for SFINAE support.
1900 (rationalize_conditional_expr): Add SFINAE support.
1901 (build_class_member_access_expr): Ditto.
1902 (finish_class_member_access_expr): Ditto.
1903 (build_x_indirect_ref): Ditto.
1904 (build_indirect_ref): Original version renamed to
1905 cp_build_indirect_ref; new version provides a bridge from
1907 (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
1909 (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
1910 (build_function_call): Original version renamed to
1911 cp_build_function_call; new version provides a bridge from
1913 (cp_build_function_call): Was build_function_call; added SFINAE
1915 (convert_arguments): Add SFINAE support.
1916 (build_x_binary_op): Ditto.
1917 (build_binary_op): Original version renamed to cp_build_binary_op;
1918 new version provides a bridge from c-common.
1919 (cp_build_binary_op): Was build_binary_op; added SFINAE support.
1920 (pointer_diff): Fix calls for SFINAE.
1921 (build_x_unary_op): Add SFINAE support.
1922 (condition_conversion): Fix calls for SFINAE.
1923 (build_unary_op): Original version renamed to cp_build_unary_op;
1924 new version provides a bridge from c-common.
1925 (cp_build_unary_op): Was build_unary_op; added SFINAE support.
1926 (unary_complex_lvalue): Fix calls for SFINAE.
1927 (build_x_conditional_expr): Add SFINAE support.
1928 (build_x_compound_expr_from_list): Fix calls for SFINAE.
1929 (build_x_compound_expr): Add SFINAE support.
1930 (convert_ptrmem): Fix calls for SFINAE.
1931 (build_static_cast_1): Add SFINAE support.
1932 (build_static_cast): Ditto.
1933 (build_reinterpret_cast_1): Ditto.
1934 (build_reinterpret_cast): Ditto.
1935 (build_const_cast_1): Ditto.
1936 (build_const_cast): Ditto.
1937 (build_c_cast): Ditto.
1938 (build_modify_expr): Original version renamed to
1939 cp_build_modify_expr; new version provides a bridge from c-common.
1940 (cp_build_modify_expr): Was build_modify_expr; added SFINAE
1942 (build_x_modify_expr): Add SFINAE support.
1943 (build_ptrmemfunc): Fix calls for SFINAE.
1944 (convert_for_assignment): Add SFINAE support.
1945 (convert_for_initialization): Ditto.
1946 (check_return_expr): Fix calls for SFINAE.
1947 (lvalue_or_else): Add SFINAE support.
1948 * init.c (perform_member_init): Fix calls for SFINAE.
1949 (emit_mem_initializers): Ditto.
1950 (expand_virtual_init): Ditto.
1951 (expand_cleanup_for_base): Ditto.
1952 (build_aggr_init): Add SFINAE support.
1953 (expand_default_init): Ditto.
1954 (expand_aggr_init_1): Fix calls for SFINAE.
1955 (build_offset_ref): Ditto.
1956 (build_new_1): Add SFINAE support.
1958 (build_vec_delete_1): Fix calls for SFINAE.
1959 (get_temp_regvar): Ditto.
1960 (build_vec_init): Add SFINAE support.
1961 (build_dtor_call): Fix calls for SFINAE.
1962 (build_delete): Ditto.
1963 (push_base_cleanups): Ditto.
1964 (build_vec_delete_1): Ditto.
1965 * class.c (build_base_path): Fix calls for SFINAE.
1966 (build_simple_base_path): Ditto.
1967 (convert_to_base_statically): Ditto.
1968 (build_vfn_ref): Ditto.
1969 (resolve_address_of_overloaded_function): Ditto.
1970 * decl.c (check_initializer): Fix calls for SFINAE.
1971 (register_dtor_fn): Ditto.
1972 (compute_array_index_type): Ditto.
1973 (finish_enum): Ditto.
1974 (start_preparsed_function): Ditto.
1975 (cxx_maybe_build_cleanup): Ditto.
1976 * call.c (convert_like): Add COMPLAIN argument.
1977 (convert_like_with_context): Ditto.
1978 (build_this): Fix calls for SFINAE.
1979 (build_user_type_conversion): Ditto.
1980 (resolve_args): Ditto.
1981 (build_new_function_call): Add SFINAE support.
1982 (build_operator_new_call): Fix calls for SFINAE.
1983 (build_object_call): Add SFINAE support.
1984 (build_conditional_expr): Ditto.
1985 (build_new_op): Ditto.
1986 (build_op_delete_call): Fix calls for SFINAE.
1987 (build_temp): Ditto.
1988 (convert_like_real): Add SFINAE support.
1989 (build_x_va_arg): Fix calls for SFINAE.
1990 (convert_default_arg): Ditto.
1991 (build_over_call): Add SFINAE support.
1992 (build_java_interface_fn_ref): Fix calls for SFINAE.
1993 (build_special_member_call): Add SFINAE support.
1994 (build_new_method_call): Ditto.
1995 (perform_implicit_conversion): Ditto.
1996 (perform_direct_initialization_if_possible): Ditto.
1997 (initialize_reference): Fix calls for SFINAE.
1998 * method.c (do_build_assign_ref): Fix calls for SFINAE.
1999 * rtti.c (build_headof): Fix calls for SFINAE.
2000 (get_tinfo_decl_dynamic): Ditto.
2001 (get_typeid): Ditto.
2002 (build_dynamic_cast_1): Add SFINAE support.
2003 (build_dynamic_cast): Ditto.
2004 (tinfo_base_init): Fix calls for SFINAE.
2005 * except.c (do_get_exception_ptr): Fix calls for SFINAE.
2006 (do_end_catch): Ditto.
2007 (initialize_handler_parm): Ditto.
2008 (expand_start_catch_block): Ditto.
2009 (do_allocate_exception): Ditto.
2010 (do_free_exception): Ditto.
2011 (build_throw): Ditto.
2012 * cvt.c (build_up_reference): Fix calls for SFINAE.
2013 (convert_to_reference): Ditto.
2014 (ocp_convert): Ditto.
2015 (convert_to_void): Add SFINAE support.
2016 * tree.c (build_dummy_object): Fix calls for SFINAE.
2017 (stabilize_expr): Ditto.
2018 * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
2020 (build_new_method_call): Ditto.
2021 (build_special_member_call): Ditto.
2022 (build_new_op): Ditto.
2023 (perform_implicit_conversion): Ditto.
2024 (perform_direct_initialization_if_possible): Ditto.
2025 (convert_to_void): Ditto.
2026 (build_aggr_init): Ditto.
2028 (build_vec_init): Ditto.
2029 (build_dynamic_cast): Ditto.
2030 (finish_call_expr): Ditto
2031 (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
2032 (cxx_sizeof_nowarn): Remove macro; add function declaration.
2033 (build_class_member_access_expr): Add tsubst_flags_t parameter.
2034 (finish_class_member_access_expr): Ditto.
2035 (build_x_indirect_ref): Ditto.
2036 (cp_build_indirect_ref): New.
2037 (cp_build_function_call): Add tsubst_flags_t parameter.
2038 (build_x_unary_op): Ditto.
2039 (cp_build_unary_op): New.
2040 (build_x_conditional_expr): Add tsubst_flags_t parameter.
2041 (build_x_compound_expr): Ditto.
2042 (build_compound_expr): Ditto.
2043 (build_static_cast): Ditto.
2044 (build_reinterpret_cast): Ditto.
2045 (build_const_cast): Ditto.
2046 (build_c_cast): Ditto.
2047 (build_x_modify_expr): Ditto.
2048 (cp_build_modify_expr): New.
2049 (convert_for_initialization): Add tsubst_flags_t parameter.
2050 (cp_build_binary_op): Remove macro; add function declaration.
2051 (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
2052 (lvalue_or_else): Ditto.
2053 (build_functional_cast): Ditto.
2054 * typeck2.c (digest_init): Fix calls for SFINAE.
2055 (process_init_constructor_array): Ditto.
2056 (process_init_constructor_record): Ditto.
2057 (build_x_arrow): Ditto.
2058 (build_m_component_ref): Ditto.
2059 (build_functional_cast): Add SFINAE support.
2060 * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
2061 * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
2062 (finish_expr_stmt): Ditto.
2063 (finish_for_expr): Ditto.
2064 (finish_asm_stmt): Ditto.
2065 (finish_non_static_data_member): Ditto.
2066 (finish_qualified_id_expr): Ditto.
2067 (finish_call_expr): Add SFINAE support.
2068 (finish_increment_expr): Fix calls for SFINAE.
2069 (finish_unary_op_expr): Ditto.
2070 (simplify_aggr_init_expr): Ditto.
2071 (finish_omp_clauses): Ditto.
2072 (finish_omp_for): Ditto.
2073 (finish_omp_barrier): Ditto.
2074 (finish_omo_flush): Ditto.
2075 * decl2.c (grok_array_decl): Fix calls or SFINAE.
2076 (build_anon_union_vars): Ditto.
2077 (get_guard_cond): Ditto.
2079 (one_static_initialization_or_destruction): Ditto.
2080 (do_static_initialization_or_destruction): Ditto.
2081 (generate_ctor_or_dtor_function): Ditto.
2082 (build_offset_ref_call_from_tree): Ditto.
2083 * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
2084 (cp_parser_postfix_dot_deref_expression): Ditto.
2085 (cp_parser_unary_expression): Ditto.
2086 (cp_parser_new_expression): Ditto.
2087 (cp_parser_cast_expression): Ditto.
2088 (cp_parser_binary_expression): Ditto.
2089 (cp_parser_question_colon_clause): Ditto.
2090 (cp_parser_assignment_expression): Ditto.
2091 (cp_parser_expression): Ditto.
2092 (cp_parser_builtin_offsetof): Ditto.
2093 (cp_parser_template_argument): Ditto.
2094 (cp_parser_functional_cast): Ditto.
2096 2008-03-24 Tom Tromey <tromey@redhat.com>
2098 * lex.c (handle_pragma_interface): Don't copy the filename.
2099 (handle_pragma_implementation): Copy filename using xstrdup.
2101 2008-03-21 Paolo Carlini <pcarlini@suse.de>
2103 * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2104 (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
2105 (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
2106 (PROMOTES_TO_AGGR_TYPE): Remove.
2107 (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
2108 * typeck.c (unary_complex_lvalue, build_modify_expr,
2109 convert_for_initialization): Adjust.
2110 * init.c (is_aggr_type): Remove.
2111 (is_class_type): Add.
2112 (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
2113 build_delete): Adjust.
2114 * lex.c (make_aggr_type): Remove.
2115 (make_class_type): Add.
2116 (cxx_make_type): Adjust.
2117 * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
2119 * decl.c (build_typename_type, make_typename_type,
2120 make_unbound_class_template, cxx_init_decl_processing,
2121 check_tag_decl, groktypename, start_decl_1, layout_var_decl,
2122 check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
2123 grok_op_properties, xref_tag, check_function_type): Adjust.
2124 * call.c (check_dtor_name, standard_conversion, implicit_conversion,
2125 add_builtin_candidate, add_builtin_candidates,
2126 build_user_type_conversion_1, convert_like_real, build_cxx_call,
2127 is_subseq, compare_ics): Adjust.
2128 * method.c (use_thunk): Adjust.
2129 * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
2130 create_tinfo_types): Adjust.
2131 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2132 build_up_reference, convert_to_reference, convert_from_reference,
2133 ocp_convert, build_expr_type_conversion): Adjust.
2134 * tree.c (bind_template_template_parm, error_type): Adjust.
2135 * dump.c (cp_dump_tree): Adjust.
2136 * search.c (lookup_member): Adjust.
2137 * friend.c (make_friend_class, do_friend): Adjust.
2138 * typeck2.c (store_init_value, process_init_constructor_array,
2139 process_init_constructor_record, build_x_arrow, build_m_component_ref,
2140 build_functional_cast): Adjust.
2141 * pt.c (finish_member_template_decl, process_template_parm,
2142 lookup_template_class, tsubst_function_type, tsubst,
2143 tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
2145 * semantics.c (begin_class_definition, finish_base_specifier,
2146 finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
2148 * name-lookup.c (constructor_name_p, push_overloaded_decl,
2149 do_class_using_decl, lookup_qualified_name,
2150 maybe_process_template_type_declaration): Adjust.
2151 * decl2.c (grok_array_decl, check_member_template,
2152 constrain_class_visibility): Adjust.
2153 * parser.c (cp_parser_class_name): Adjust.
2155 2008-03-18 Paolo Bonzini <bonzini@gnu.org>
2157 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
2159 2008-03-17 Jason Merrill <jason@redhat.com>
2162 * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
2163 a temp directly to a reference as per DR391.
2165 2008-03-12 Richard Guenther <rguenther@suse.de>
2169 2008-02-04 Richard Guenther <rguenther@suse.de>
2172 * decl.c (record_builtin_java_type): Make jboolean a
2173 integer type again where its mode doesn't match that of bool.
2175 2008-01-25 Richard Guenther <rguenther@suse.de>
2178 * decl.c (record_builtin_java_type): Make __java_boolean
2180 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2181 after TYPE_MAIN_VARIANT check.
2183 2008-03-10 Jakub Jelinek <jakub@redhat.com>
2186 * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
2190 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2191 DECL_P in not a variable and appears more than once error messages.
2193 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
2197 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
2201 * typeck.c (structural_comptypes): Call cp_comptypes.
2202 (comptypes): New; called from the C/C++ common bits to perform
2204 (cp_comptypes): Renamed from comptypes, which is already used,
2205 with a different signature, by the C++ front end.
2206 (build_reinterpret_cast_1): Call cp_comptypes.
2207 (ptr_reasonably_similar): Ditto.
2208 * decl.c (decls_match): Ditto.
2209 * cvt.c (convert_to_reference): Ditto.
2210 * cp-tree.h (same_type_p): Ditto.
2211 (same_or_base_type_p): Ditto.
2212 (comptypes): Rename to cp_comptypes.
2213 * pt.c (canonical_type_parameter): Call cp_comptypes.
2215 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
2217 * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
2218 test for equivalence between pointer and references.
2220 2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2223 * class.c (finish_struct_anon): Use permerror instead of pedwarn.
2224 (check_field_decls): Likewise.
2225 (note_name_declared_in_class): Likewise.
2226 * call.c (build_new_op): Likewise.
2227 (convert_like_real): Likewise.
2228 (build_over_call): Likewise.
2229 * lex.c (unqualified_fn_lookup_error): Likewise.
2230 * parser.c (cp_parser_template_id): Likewise.
2231 * cvt.c (warn_ref_binding): Likewise.
2232 (convert_to_reference): Likewise.
2233 (ocp_convert): Likewise.
2234 (convert_to_void): Use error instead of pedwarn.
2235 * error.c (cp_cpp_error): Use pedantic_warning_kind.
2236 * decl.c (compute_array_index_type): Use constant_expression_error.
2238 2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
2240 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
2241 that auto is either a storage class or a simple type specifier,
2242 depending on the dialect.
2243 (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
2244 specifier in C++98 mode, error in C++0x mode (since we don't
2245 support auto as a type specifier, yet).
2246 (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
2247 storage specifier in C++0x mode.
2248 (cp_parser_simple_type_specifier): Parse `auto' as a
2249 simple-type-specifier, but error because we don't support it yet.
2251 2008-02-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2253 * parser.c (cp_parser_nonclass_name): New.
2254 (cp_parser_pseudo_destructor_name): Use it instead of
2255 cp_parser_type_name.
2256 (cp_parser_type_name): Move code to cp_parser_nonclass_name.
2258 2008-02-29 Tom Tromey <tromey@redhat.com>
2260 * parser.c (struct cp_token) <input_file_stack_index>: Remove.
2261 (cp_lexer_get_preprocessor_token): Update.
2262 (cp_lexer_set_source_position_from_token): Don't call
2263 restore_input_file_stack.
2264 * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
2266 2008-02-28 Richard Guenther <rguenther@suse.de>
2269 2008-02-26 Richard Guenther <rguenther@suse.de>
2271 * decl.c (duplicate_decls): Remove decl from global mapping
2272 before ggc_freeing it.
2274 2008-02-27 Jakub Jelinek <jakub@redhat.com>
2277 * rtti.c: Include c-pragma.h.
2278 (push_abi_namespace, pop_abi_namespace): New functions.
2279 (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
2280 create_tinfo_types, emit_support_tinfos): Use them.
2281 * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
2283 2008-02-26 Jason Merrill <jason@redhat.com>
2286 * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
2287 to name the struct for linkage purposes even if it has attributes.
2288 (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
2290 2008-02-26 Tom Tromey <tromey@redhat.com>
2292 * parser.c (eof_token): Remove old location code.
2293 (check_empty_body): Remove test of USE_MAPPED_LOCATION.
2294 * decl2.c (generate_ctor_or_dtor_function): Remove old location
2296 (cp_write_global_declarations): Likewise.
2297 * lex.c (cxx_init): Remove old location code.
2298 (handle_pragma_implementation): Remove test of
2299 USE_MAPPED_LOCATION.
2300 * pt.c (tsubst): Remove old location code.
2301 * error.c (cp_print_error_function): Remove test of
2302 USE_MAPPED_LOCATION.
2303 * decl.c (pop_label): Remove old location code.
2304 (finish_function): Likewise.
2306 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2309 * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
2311 2008-02-26 Richard Guenther <rguenther@suse.de>
2313 * decl.c (duplicate_decls): Remove decl from global mapping
2314 before ggc_freeing it.
2316 2008-02-26 Paolo Carlini <pcarlini@suse.de>
2319 * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
2321 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2323 * typeck.c (build_class_member_access_expr): Add appropriate
2324 OPT_W* parameter to warning.
2325 (build_reinterpret_cast_1): Likewise.
2326 * name-lookup.c (push_overloaded_decl): Likewise.
2328 2008-02-25 Paolo Carlini <pcarlini@suse.de>
2331 * error.c (dump_expr): Handle CONJ_EXPR.
2333 2008-02-25 Paolo Carlini <pcarlini@suse.de>
2336 * error.c (dump_type): Handle FIXED_POINT_TYPE.
2337 (dump_expr): Handle FIXED_CST.
2339 2008-02-24 Jason Merrill <jason@redhat.com>
2341 * parser.c (cp_parser_declaration): Handle "inline namespace".
2342 (cp_parser_namespace_definition): Likewise.
2345 * name-lookup.c (arg_assoc_namespace): Look down into inline
2348 2008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2350 * typeck.c (check_for_casting_away_constness): Use 1 single
2351 argument, the type of cast, to decide what diagnostics generate.
2352 (build_static_cast_1): Remove unused code. Update call to
2353 check_for_casting_away_constness.
2354 (build_reinterpret_cast_1): Update call to
2355 check_for_casting_away_constness.
2356 (build_const_cast_1): Likewise.
2358 2008-02-24 Paolo Carlini <pcarlini@suse.de>
2360 * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
2361 VEC_NEW_EXPR), forward to pp_expression.
2362 * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
2364 2008-02-24 Danny Smith <dannysmith@users.sourceforge.net>
2367 * friend.c (do_friend): Call cplus_decl_attributes earlier.
2369 2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
2372 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
2373 template decls' function decl.
2375 2008-02-22 Paolo Carlini <pcarlini@suse.de>
2379 2008-02-14 Paolo Carlini <pcarlini@suse.de>
2382 * pt.c (determine_specialization): In case of function templates,
2383 when the type of DECL does not match FN there is no match.
2385 2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2388 * typeck.c (build_binary_op): Warn about floating point
2389 comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
2391 2008-02-19 Jason Merrill <jason@redhat.com>
2394 * pt.c (resolve_overloaded_unification): Set processing_template_decl
2395 while we look for possible bindings.
2397 2008-02-19 Jakub Jelinek <jakub@redhat.com>
2400 * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
2404 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
2405 vars. Afterwards ensure v is VAR_DECL.
2408 * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
2409 call cp_finish_decl.
2410 * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
2413 2008-02-15 Douglas Gregor <doug.gregor@gmail.com>
2418 * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
2419 is error_mark_node, return an error early.
2420 (find_parameter_packs_r): Pass the pointer set along to recursive
2421 calls of cp_walk_subtrees; don't try to manage the pointer set
2423 (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
2424 (make_pack_expansion): Ditto.
2425 (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
2426 a second pass through the tree with find_parameter_packs_r; that
2427 second pass no longer does anything.
2428 (push_template_decl_real): If we have an erroneous declaration,
2429 set its type to error_mark_node before returning an error.
2431 2008-02-14 Douglas Gregor <doug.gregor@gmail.com>
2434 * pt.c (tsubst_initializer_list): Deal with the use of
2435 VOID_TYPE_NODE to indicate value-initialization of the bases.
2437 2008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2438 Jason Merrill <jason@redhat.com>
2442 * class.c (type_has_user_nondefault_constructor): New fn.
2443 * cp-tree.h: Declare it.
2444 * init.c (emit_mem_initializers): Use it for -W warning about
2445 missing base initializer.
2447 2008-02-14 Paolo Carlini <pcarlini@suse.de>
2450 * pt.c (determine_specialization): In case of function templates,
2451 when the type of DECL does not match FN there is no match.
2453 2008-02-13 Jakub Jelinek <jakub@redhat.com>
2454 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2457 * parser.c (cp_parser_pseudo_destructor_name): If next tokens
2458 are not identifier :: ~, return before calling cp_parser_type_name.
2460 2008-02-13 Jason Merrill <jason@redhat.com>
2462 PR c++/34962, c++/34937, c++/34939
2463 * decl2.c (is_late_template_attribute): Always defer attributes
2464 vector_size and weak.
2467 * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
2468 of enumerators, too.
2470 2008-02-12 Jason Merrill <jason@redhat.com>
2473 * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
2474 if we're doing conversions to call a user-defined conversion function.
2476 2008-02-12 Steven Bosscher <steven@gcc.gnu.org>
2479 * semantics.c (finish_qualified_id_expr): Avoid duplicate access
2482 2008-02-12 Jakub Jelinek <jakub@redhat.com>
2485 * init.c (build_new_1): Don't create placement_expr before
2486 constructing alloc_call. Verify that the pointer is passed by
2487 value to operator new.
2489 2008-02-11 Jason Merrill <jason@redhat.com>
2492 * pt.c (tsubst): Don't look up a template typedef in an explicit
2495 2008-02-11 Douglas Gregor <doug.gregor@gmail.com>
2498 * tree.c (cp_build_qualified_type_real): When building a
2499 cv-qualified array type, build it as a unique type with
2500 build_cplus_array_type_1 and then adopt the unqualified type's
2503 2008-02-11 Paolo Carlini <pcarlini@suse.de>
2506 * decl.c (groktypename): Check grokdeclarator return.
2508 2008-02-10 Jason Merrill <jason@redhat.com>
2511 * decl2.c (cp_write_global_declarations): Don't write out static
2512 data members with DECL_IN_AGGR_P set.
2514 2008-02-08 Jason Merrill <jason@redhat.com>
2517 * tree.c (build_target_expr_with_type): Handle void initializer.
2518 (bot_manip): Remap slot before recursing.
2520 2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2523 * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
2525 2008-02-06 Alexandre Oliva <aoliva@redhat.com>
2528 * tree.c: Include tree-flow.h.
2529 (build_target_expr): Check type compatibility.
2530 * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
2531 * call.c (convert_like_real): Convert bitfield to expected type.
2533 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
2537 * typeck.c (structural_comptypes): Call cp_comptypes.
2538 (comptypes): New; called from the C/C++ common bits to perform
2540 (cp_comptypes): Renamed from comptypes, which is already used,
2541 with a different signature, by the C++ front end.
2542 (build_reinterpret_cast_1): Call cp_comptypes.
2543 (ptr_reasonably_similar): Ditto.
2544 * decl.c (decls_match): Ditto.
2545 * cvt.c (convert_to_reference): Ditto.
2546 * cp-tree.h (same_type_p): Ditto.
2547 (same_or_base_type_p): Ditto.
2548 (comptypes): Rename to cp_comptypes.
2549 * pt.c (canonical_type_parameter): Call cp_comptypes.
2551 2008-02-05 Jakub Jelinek <jakub@redhat.com>
2554 * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
2555 value dependent expression.
2557 2008-02-05 Douglas Gregor <doug.gregor@gmail.com>
2560 * decl2.c (save_template_attributes): When we're modifying the
2561 TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
2562 all of the other variants to add those same attributes. Otherwise,
2563 the main variant will be inconsistent with those other variants.
2565 2008-02-04 Richard Guenther <rguenther@suse.de>
2568 * decl.c (record_builtin_java_type): Make jboolean a
2569 integer type again where its mode doesn't match that of bool.
2571 2008-02-02 Jason Merrill <jason@redhat.com>
2572 Mark Mitchell <mark@codesourcery.com>
2575 * init.c (build_value_init_1): New function.
2576 (build_value_init): New function.
2577 * typeck2.c (build_functional_cast): Call it.
2578 * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
2580 * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
2581 TYPE_HAS_CONSTRUCTOR.
2582 * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
2583 add_implicitly_declared_members): Adjust.
2584 (check_field_decls): Adjust. Remove warnings about reference/const
2585 in class without constructor.
2586 (check_bases_and_members): Adjust. Give those warnings here instead.
2587 * decl.c (fixup_anonymous_aggr): Adjust.
2588 (check_initializer): Adjust, clarify logic slightly.
2589 (grok_special_member_properties): Adjust, only set if user-provided.
2590 * rtti.c (create_tinfo_types): Don't set.
2591 * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
2592 Use same_type_ignoring_top_level_qualifiers_p.
2593 * pt.c (check_explicit_specialization): Adjust.
2594 (instantiate_class_template): Adjust.
2596 2008-01-31 Douglas Gregor <doug.gregor@gmail.com>
2597 Jakub Jelinek <jakub@redhat.com>
2601 * typeck.c (structural_comptypes): Handle comparisons of
2602 VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
2604 * mangle.c (write_builtin_type): Map down to the canonical type,
2605 which will be one of the predefined type nodes.
2607 2008-01-29 Michael Meissner <michael.meissner@amd.com>
2610 * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
2611 bits to allow for expansion of the number of middle end tree
2614 2008-01-29 Douglas Gregor <doug.gregor@gmail.com>
2625 * typeck.c (check_return_expr): Tweak call to
2626 check_for_bare_parameter_packs.
2627 * class.c (add_method): Be careful with error_mark_nodes.
2628 * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
2630 * pt.c (struct find_parameter_pack_data): Remove
2632 (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
2633 (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
2634 (make_pack_expansion): Ditto.
2635 (check_for_bare_parameter_packs): Parameter is now a tree, not a
2637 (process_template_parm): Tweak call to
2638 check_for_bare_parameter_packs.
2639 (push_template_decl_real): Tweak calls to
2640 check_for_bare_parameter_packs. If bare parameter packs are found
2641 in the list of exceptions, clear out that list after giving an
2643 * semantics.c (finish_cond): Tweak call to
2644 check_for_bare_parameter_packs.
2645 (finish_expr_stmt): Ditto.
2646 (finish_for_expr): Ditto.
2647 (finish_switch_cond): Ditto.
2648 (finish_mem_initializers): Ditto.
2649 (finish_member_declaration): Ditto.
2650 (finish_static_assert): Check for bare parameter packs in the
2652 * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
2653 attributes of a declaration.
2654 * parser.c (cp_parser_using_declaration): Tweak call to
2655 check_for_bare_parameter_packs.
2656 (cp_parser_base_clause): Ditto.
2658 2008-01-28 Jason Merrill <jason@redhat.com>
2661 * class.c (build_base_path): Fix !want_pointer case.
2663 2008-01-27 Jason Merrill <jason@redhat.com>
2666 * class.c (build_base_path): Fix previous change.
2668 2008-01-26 Jakub Jelinek <jakub@redhat.com>
2671 * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
2674 2008-01-26 Richard Guenther <rguenther@suse.de>
2677 * typeck.c (build_binary_op): Remove code to shorten compares.
2679 2008-01-25 Richard Guenther <rguenther@suse.de>
2682 * decl.c (record_builtin_java_type): Make __java_boolean
2684 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2685 after TYPE_MAIN_VARIANT check.
2687 2008-01-25 Jason Merrill <jason@redhat.com>
2690 * class.c (build_base_path): Don't mess with virtual access if
2692 * call.c (standard_conversion): Don't check whether source type
2695 * decl2.c (is_late_template_attribute): Don't defer attribute
2696 visibility just because the type is dependent.
2698 2008-01-25 Jason Merrill <jason@redhat.com>
2699 Mark Mitchell <mark@codesourcery.com>
2702 * call.c (standard_conversion): Allow conversion from integer/real
2704 (compare_ics): Such a conversion is worse than a normal arithmetic
2707 2008-01-25 Richard Guenther <rguenther@suse.de>
2710 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
2713 2008-01-24 Paolo Carlini <pcarlini@suse.de>
2716 * pt.c (push_template_decl_real): Return error_mark_node in case
2717 of template definition of non-template.
2719 2008-01-24 Jason Merrill <jason@redhat.com>
2722 * decl2.c (is_late_template_attribute): Defer any attribute with
2723 dependent args. Also defer type attributes if the type is dependent.
2725 2008-01-22 Jakub Jelinek <jakub@redhat.com>
2726 Alexandre Oliva <aoliva@redhat.com>
2729 * call.c (reference_binding): For bitfields use the declared bitfield
2731 (add_builtin_candidates): Likewise.
2732 * class.c (layout_class_type): For bitfields copy over the
2733 original type quals.
2735 2008-01-22 Jason Merrill <jason@redhat.com>
2738 * decl.c (groktypename): Also ignore attributes on dependent
2739 possibly-class types.
2742 * friend.c (do_friend): Check for prior declaration of a friend
2743 function of a local class.
2744 * name-lookup.c (lookup_name_innermost_nonclass_level):
2746 * name-lookup.h: Declare it.
2748 2008-01-22 Tom Tromey <tromey@redhat.com>
2751 * init.c (build_new_1): Only disallow Java aggregates.
2753 2008-01-22 Jakub Jelinek <jakub@redhat.com>
2756 * semantics.c (finish_omp_for): Don't call c_finish_omp_for
2757 if decl or init is error_mark_node.
2760 * error.c (dump_expr): Handle VECTOR_CST.
2762 2008-01-21 Jason Merrill <jason@redhat.com>
2765 * pt.c (tsubst_aggr_type): Make sure our context is complete.
2768 * pt.c (retrieve_local_specialization): Robustify.
2769 (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
2772 * pt.c (tsubst): Only call retrieve_local_specialization if the
2773 original typedef was in a function template.
2776 * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
2778 2008-01-21 Richard Guenther <rguenther@suse.de>
2781 * error.c (cp_print_error_function): Deal with recursive
2784 2008-01-20 Paolo Carlini <pcarlini@suse.de>
2787 * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
2789 2008-01-20 Paolo Carlini <pcarlini@suse.de>
2793 * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
2794 on non-IS_AGGR_TYPE scope.
2795 (constructor_name_p): Assert IS_AGGR_TYPE.
2797 2008-01-18 Ian Lance Taylor <iant@google.com>
2800 * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
2801 (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
2802 DECL_IS_OPERATOR_NEW flag.
2804 2008-01-16 Richard Guenther <rguenther@suse.de>
2807 * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
2808 for conversions to type variants.
2810 2008-01-15 Andreas Tobler <a.tobler@schweiz.org>
2812 * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
2813 declaration and code. Update copyright year.
2815 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2818 * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
2819 know we have a class type.
2821 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2824 * pt.c (coerce_template_parameter_pack): When substituting into
2825 the type of a non-type template parameter pack. use the
2826 deduced/substituted arguments.
2827 * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
2828 can be a parameter pack with the ellipsis following it. When we
2829 have an erroneous declaration, allow it to be a parameter pack.
2830 (cp_parser_template_parameter): Complain about default
2831 arguments on non-type template parameter packs, and parse them
2832 using the new cp_parser_default_argument.
2833 (cp_parser_parameter_declaration): Complain about parameter packs
2834 with default arguments. Move parsing of default arguments into a
2835 new function, cp_parser_default_argument.
2836 (cp_parser_default_argument): New; extracted from
2837 cp_parser_parameter_declaration.
2839 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2845 * typeck.c (check_return_expr): If there are bare parameter packs
2846 in the return value, set it to error_mark_node.
2847 * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
2848 * pt.c (find_parameter_packs_r): Look at the type of
2849 IDENTIFIER_NODEs (e.g., for user-defined conversions).
2850 (check_for_bare_parameter_packs): Flip the result: now returns
2851 TRUE when there were bare parameter packs, FALSE otherwise.
2852 (push_template_decl_real): Deal with flipped result of
2853 check_for_bare_parameter_packs.
2854 * semantics.c (finish_cond): If there are bare parameter packs in
2855 the conditional, set it to error_mark_node.
2856 (finish_expr_stmt): If there are bare parameter packs in the
2857 expression, set it to error_mark_node.
2858 (finish_for_expr): Ditto.
2859 (finish_switch_cond): If there are bare parameter packs in
2860 the conditional, set it to error_mark_node.
2861 (finish_mem_initializers): If there are bare parameter packs in
2862 the member initializer, set it to error_mark_node.
2863 (finish_member_declaration): Check the attributes of the
2864 declaration for bare parameter packs, and remove the attributes if
2865 any have bare parameter packs.
2866 * parser.c (cp_parser_using_declaration): Check the using
2867 declaration for bare parameter packs.
2868 (cp_parser_base_clause): If there are bare parameter packs in a
2869 base specifier, don't add it to the chain.
2871 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2874 * error.c (dump_simple_decl): Display ellipsis for template
2875 non-type parameter packs.
2876 (dump_decl): Display ellipsis for template type parameter packs.
2877 (dump_template_decl): Display ellipsis for template template
2879 * pt.c (redeclare_class_template): When redeclaring a class
2880 template, check for collisions between template parameters and
2881 template parameter packs.
2883 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2886 * pt.c (process_partial_specialization): Don't mark template
2887 parameters that occur in non-deduced contexts.
2888 (struct pair_fn_data): Add include_nondeduced_p.
2889 (for_each_template_parm_r): Only visit non-deduced contexts if
2890 include_nondeduced_p is set.
2891 (for_each_template_parm): Added parameter include_nondeduced_p,
2892 which states whether template parameters found in non-deduced
2893 contexts should be visited.
2894 (uses_template_parms): Visit all template parameters, even those
2895 in non-deduced contexts.
2897 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2900 * pt.c (check_default_tmpl_args): Check for parameter packs that
2901 aren't at the end of a primary template.
2902 (push_template_decl_real): Remove check for parameter packs that
2903 aren't at the end of a primary template; that now happens in
2904 check_default_tmpl_args.
2905 * semantics.c (finish_template_template_parm): Use
2906 check_default_tmpl_args to check for errors in the template
2909 2008-01-12 Doug Kwan <dougkwan@google.com>
2911 * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
2912 instead of OPT_Wreturn_type in warning due to ignored return type
2914 * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
2915 instead of OPT_Wreturn_type in warning due to ignored return type
2918 2008-01-08 Jakub Jelinek <jakub@redhat.com>
2921 * semantics.c (finish_omp_for): Don't call
2922 fold_build_cleanup_point_expr if processing_template_decl.
2924 2008-01-04 Paolo Carlini <pcarlini@suse.de>
2925 Jakub Jelinek <jakub@redhat.com>
2928 * error.c (dump_template_argument): Deal with TREE_LIST.
2930 2008-01-01 Douglas Gregor <doug.gregor@gmail.com>
2932 * parser.c (cp_parser_check_decl_spec): Don't warn about "long
2933 long" in C++0x mode; change the warning to note that "long long"
2934 is only unsupported in C++98 mode.
2936 2007-12-20 Jason Merrill <jason@redhat.com>
2939 * call.c (standard_conversion): Derived-to-base is considered a
2940 standard conversion.
2942 2007-12-19 Jakub Jelinek <jakub@redhat.com>
2945 * parser.c (cp_parser_omp_parallel): For non-combined parallel
2946 call cp_parser_statement rather than
2947 cp_parser_already_scoped_statement.
2949 2007-12-18 Jason Merrill <jason@redhat.com>
2952 * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
2954 (dependent_type_p_r): Handle the domain of an array.
2956 2007-12-18 Douglas Gregor <doug.gregor@gmail.com>
2957 Jakub Jelinek <jakub@redhat.com>
2962 * pt.c (template_template_parm_bindings_ok_p): New; verifies
2963 bindings of template template parameters after all template
2964 arguments have been deduced.
2965 (coerce_template_parms): Don't complain when COMPLAIN doesn't
2967 (fn_type_unification): Use template_template_parm_bindings_ok_p.
2968 (unify): Deal with variadic, bound template template parameters.
2969 (get_class_bindings): Use template_template_parm_bindings_ok_p.
2971 2007-12-18 Jakub Jelinek <jakub@redhat.com>
2974 * decl.c (grokdeclarator): Reject friend sfk_constructor
2977 2007-12-17 Jakub Jelinek <jakub@redhat.com>
2980 * parser.c (cp_parser_omp_all_clauses): Accept optional comma
2983 2007-12-15 Alexandre Oliva <aoliva@redhat.com>
2986 * cp-lang.c (cp_classify_record): New.
2987 (LANG_HOOKS_CLASSIFY_RECORD): Override.
2989 2007-12-11 Jakub Jelinek <jakub@redhat.com>
2992 * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
2995 * rtti.c (build_dynamic_cast): Call convert_from_reference even for
2996 dynamic_cast in a template.
2998 2007-12-10 Simon Martin <simartin@users.sourceforge.net>
3001 * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
3002 MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
3004 2007-12-10 Jakub Jelinek <jakub@redhat.com>
3007 * error.c (dump_type_prefix, dump_type_suffix): Handle
3008 TYPE_PACK_EXPANSION.
3011 * error.c (dump_expr): Handle ABS_EXPR.
3013 2007-12-09 Jakub Jelinek <jakub@redhat.com>
3017 * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
3018 in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3019 Return 2 also if DECL_EXPLICIT_INSTANTIATION.
3020 * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
3021 flag_use_repository and repo_emit_p returned 2.
3023 2007-12-06 Jakub Jelinek <jakub@redhat.com>
3026 * tree.c (stabilize_call, stabilize_init): Do nothing if
3027 processing_template_decl.
3029 2007-12-05 Jakub Jelinek <jakub@redhat.com>
3032 * semantics.c (finish_decltype_type): For SCOPE_REF issue an
3033 error instead of assertion failure.
3034 * parser.c (cp_parser_decltype): If closing paren is not found,
3035 return error_mark_node.
3037 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
3040 * name-lookup.c (arg_assoc_template_arg): Recurse on argument
3042 (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
3043 since arg_assoc_template_arg will deal with them (better).
3045 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
3048 * pt.c (tsubst_exception_specification): Handle substitutions into
3049 member templates, where tsubst_pack_expansion returns a
3050 TYPE_PACK_EXPANSION.
3052 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
3055 * pt.c (unify_pack_expansion): If we didn't deduce any actual
3056 bindings for the template parameter pack, don't try to keep the
3057 empty deduced arguments.
3058 (unify): If a parameter is a template-id whose template argument
3059 list contains a pack expansion that is not at the end, then we
3060 cannot unify against that template-id.
3062 2007-12-02 Paolo Carlini <pcarlini@suse.de>
3065 * pt.c (current_template_args): Use error_operand_p.
3067 2007-12-02 Paolo Carlini <pcarlini@suse.de>
3070 * error.c (dump_decl): Handle TREE_BINFO.
3072 2007-12-01 Ollie Wild <aaw@google.com>
3075 * typeck.c (build_binary_op): Add conversion of pointers to function
3076 members appearing as operands to the equality operators.
3078 2007-11-30 Jakub Jelinek <jakub@redhat.com>
3081 * error.c (dump_expr): Handle OBJ_TYPE_REF.
3083 2007-11-29 Jakub Jelinek <jakub@redhat.com>
3086 * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
3088 * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
3093 * parser.c (cp_parser_decltype): Don't call finish_id_expression
3095 * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
3098 2007-11-27 Jakub Jelinek <jakub@redhat.com>
3100 PR tree-optimization/34181
3101 * method.c (use_thunk): Don't inline the call in the thunk.
3104 * tree.c (decl_linkage): Static data members and static member
3105 functions in anonymous ns classes are lk_external.
3107 2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
3110 * decl.c (start_preparsed_function): Pass
3111 processing_template_decl for the new allocate_struct_function
3114 2007-11-25 Richard Guenther <rguenther@suse.de>
3116 * decl.c (poplevel): Use BLOCK_CHAIN.
3118 2007-11-24 Ollie Wild <aaw@google.com>
3120 * typeck.c (delta_from_ptrmemfunc): New function.
3121 (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
3122 (build_binary_op): Call delta_from_ptrmemfunc.
3124 2007-11-23 Jakub Jelinek <jakub@redhat.com>
3128 * decl.c (cp_finish_decl): Disallow variable or field
3129 definitions if extern "Java" aggregates.
3130 (grokparms): Disallow parameters with extern "Java"
3132 (check_function_type): Disallow function return values
3133 with extern "Java" aggregates.
3134 * init.c (build_new_1): Disallow placement new with
3135 extern "Java" aggregates.
3137 2007-11-23 Mark Mitchell <mark@codesourcery.com>
3138 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3141 * call.c (convert_like_real): Build a zero constant when __null is
3142 converted to an integer type.
3144 2007-11-22 Jakub Jelinek <jakub@redhat.com>
3147 * decl2.c (cp_write_global_declarations): Issue error about static
3148 data members in anonymous namespace which are declared and used,
3151 2007-11-20 Jakub Jelinek <jakub@redhat.com>
3154 * parser.c (cp_parser_class_head): Reject function template ids.
3157 * tree.c (build_cplus_array_type_1): Don't pass any VLA types
3158 when processing_template_decl to build_array_type.
3161 * pt.c (more_specialized_fn): Don't segfault if one or
3162 both argument list end with ellipsis.
3164 2007-11-18 Jakub Jelinek <jakub@redhat.com>
3167 * semantics.c (finish_call_expr): Set
3168 current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
3169 or OVERLOAD with all noreturn functions.
3171 2007-11-16 Jakub Jelinek <jakub@redhat.com>
3174 * pt.c (apply_late_template_attributes): Do nothing if decl's type is
3177 2007-11-13 Jakub Jelinek <jakub@redhat.com>
3184 * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
3185 set to error_mark_node the outermost POINTER_TYPE to the pack if
3186 it is seen in a POINTER_TYPE.
3187 (push_template_decl_real): If check_for_bare_parameter_packs
3188 fails for function return type, set the return type to
3189 integer_type_node. If check_for_bare_parameter_packs failed
3190 for non-function, return error_mark_node.
3193 * call.c (build_new_op): Call resolve_args before calling
3196 2007-11-11 Tom Tromey <tromey@redhat.com>
3199 * lex.c (handle_pragma_implementation): Use cpp_included_before.
3201 2007-11-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3204 * pt.c (redeclare_class_template): Update error message. Use a
3205 note to show the previous declaration.
3206 (tsubst_friend_class): Use the location of the friend template as
3207 the input location before calling redeclare_class_template.
3209 2007-11-11 Jakub Jelinek <jakub@redhat.com>
3212 * semantics.c (finish_pseudo_destructor_expr): Handle
3213 object == error_mark_node.
3215 2007-11-10 Jakub Jelinek <jakub@redhat.com>
3218 * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
3219 is not scalar type, let finish_class_member_access_expr handle
3220 diagnostics. Pass BIT_NOT_EXPR argument to
3221 finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
3223 2007-11-09 Douglas Gregor <doug.gregor@gmail.com>
3226 * decl.c (cp_complete_array_type): If any of the initializer
3227 elements are pack expansions, don't compute the array size yet.
3229 2007-11-08 Andrew Pinski <pinskia@gmail.com>
3232 * tree.c (decl_linkage): Fields have no linkage.
3234 2007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
3236 * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
3238 2007-11-07 Douglas Gregor <doug.gregor@gmail.com>
3243 * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
3244 Be careful with ERROR_MARK_NODEs.
3245 * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
3248 2007-11-07 Jakub Jelinek <jakub@redhat.com>
3251 * call.c (build_over_call): Don't check TREE_ADDRESSABLE
3254 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
3258 * tree.c (c_build_qualified_type): Define bridge to
3259 cp_build_qualified_type.
3261 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
3272 * typeck.c (check_return_expr): Pass address of retval to
3273 check_for_bare_parameter_packs.
3274 * class.c (build_base_field): Tolerate bases that have no layout
3276 (end_of_base): Ditto.
3277 * tree.c (canonical_type_variant): Be careful with
3279 * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
3281 * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
3282 which states whether parameter packs should be replaced with
3284 (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
3285 possible. If set_packs_to_error is set true, replace the parameter
3286 pack with ERROR_MARK_NODE. Manage our own pointer sets.
3287 (uses_parameter_packs): Don't set parameter packs to
3289 (check_for_bare_parameter_packs): Now takes a pointer to a tree,
3290 which may be modified (if it is a parameter pack). Instructs
3291 find_parameter_packs_r to replace parameter packs with
3292 ERROR_MARK_NODE (so that they won't cause errors later on).
3293 (process_template_parm): Pass pointer to
3294 check_for_bare_parameter_packs.
3295 (process_partial_specialization): Replace pack expansions before
3296 the end of the template argument list with ERROR_MARK_NODE.
3297 (push_template_decl_real): Pass pointer to
3298 check_for_bare_parameter_packs. Replace parameter packs not at the
3299 end of the template parameter list with ERROR_MARK_NODE.
3300 (convert_template_argument): Be more careful about using DECL_NAME
3301 on only declarations.
3302 (unify): Can't unify against ERROR_MARK_NODE.
3303 * semantics.c (finish_cond): Pass pointer to
3304 check_for_bare_parameter_packs.
3305 (finish_expr_stmt): Ditto.
3306 (finish_for_expr): Ditto.
3307 (finish_switch_cond): Pass pointer to
3308 check_for_bare_parameter_packs, and call it before we put the
3309 condition into the statement.
3310 (finish_mem_initializers): Pass pointer to
3311 check_for_bare_parameter_packs.
3312 (finish_member_declaration): Ditto.
3313 * parser.c (cp_parser_base_clause): Ditto.
3315 2007-11-06 Jakub Jelinek <jakub@redhat.com>
3318 * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
3319 with the final TREE_READONLY flag in place. processing_template_decl
3320 is known to be 0 in this part of function.
3323 * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
3324 OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
3325 * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
3326 * semantics.c (finish_omp_atomic): Revert most of the
3327 2007-02-05 changes, just keep the new representation of
3328 OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
3330 2007-11-05 H.J. Lu <hongjiu.lu@intel.com>
3333 * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
3336 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
3341 * typeck.c (merge_types): Don't lose rvalue references when
3343 * call.c (build_over_call): Don't elide move constructors just
3344 because the copy constructor is trivial (!).
3345 (compare_ics): If comparing cv-qualifiers fails, we can still order
3346 based on binding lvalues vs. rvalues.
3348 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
3351 * pt.c (unify_pack_expansion): bring handling of function call
3352 arguments into line with type_unification_real.
3354 2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3356 * typeck.c (build_binary_op): Use pedwarn instead of error for
3359 2007-11-05 Jakub Jelinek <jakub@redhat.com>
3362 * parser.c (cp_parser_unary_expression): For &&label call
3363 cp_parser_non_integral_constant_expression and return error_mark_node
3364 if it returned true.
3367 * decl.c (grokdeclarator): Don't call build_memfn_type if type
3368 is neither FUNCTION_TYPE nor METHOD_TYPE.
3370 2007-11-02 Jakub Jelinek <jakub@redhat.com>
3373 * parser.c (cp_parser_nested_name_specifier_opt): Use
3374 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
3375 typedef of currently open class.
3377 2007-11-02 Paolo Carlini <pcarlini@suse.de>
3380 * error.c (dump_expr): Deal specially with statements.
3382 2007-11-01 Jason Merrill <jason@redhat.com>
3385 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
3387 (lookup_template_class): Use it to get the outer template args
3388 for instantiating one.
3391 * pt.c (reduce_template_parm_level): tsubst the parameters
3392 of a template template parm.
3394 2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
3397 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
3399 2007-11-01 Jakub Jelinek <jakub@redhat.com>
3402 * parser.c (cp_parser_postfix_dot_deref_expression): If
3403 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
3404 first and if that succeeds and type is SCALAR_TYPE_P, create
3408 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
3409 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
3410 as for std::type_info.
3412 2007-10-31 Paolo Carlini <pcarlini@suse.de>
3415 * cxx-pretty-print.c (pp_cxx_typeid_expression,
3416 pp_cxx_delete_expression): Change to static linkage.
3417 * cxx-pretty-print.h: Adjust declarations.
3418 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
3419 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
3420 MODOP_EXPR): Forward to pp_expression.
3422 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
3425 2007-10-31 Christian Bruel <christian.bruel@st.com>
3426 Mark Mitchell <mark@codesourcery.com>
3429 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
3430 if retval is volatile.
3432 2007-10-30 Jakub Jelinek <jakub@redhat.com>
3435 * decl2.c (build_offset_ref_call_from_tree): Call
3436 build_non_dependent_expr on object prior to building ADDR_EXPR from it
3437 if FN is DOTSTAR_EXPR.
3439 2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
3443 * pt.c (find_parameter_packs_r): Fix typo in comment.
3444 (convert_template_argument): Look at the pattern of a pack
3445 expansion to determine what kind of entity we're converting.
3446 (coerce_template_parameter_pack): When we have coerced a non-type
3447 template parameter pack, substitute into the type of that pack.
3448 (tsubst_pack_expansion): When our substitution of a parameter pack
3449 is a "trivial" substitution of itself, just substitute into the
3450 pack expansion rather than actually expanding.
3452 2007-10-29 Jakub Jelinek <jakub@redhat.com>
3455 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
3456 for non-integral type bitfields. Return true if bitfield is correct, false
3457 error has been diagnosed.
3458 (check_field_decls): If check_bitfield_decl returned false, call also
3461 2007-10-28 Paolo Carlini <pcarlini@suse.de>
3462 Mark Mitchell <mark@codesourcery.com>
3465 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
3466 class member error out and return.
3468 2007-10-27 Jakub Jelinek <jakub@redhat.com>
3470 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
3471 to current_function_decl rather than 0.
3474 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
3476 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
3478 2007-10-27 Jason Merrill <jason@redhat.com>
3481 * call.c (convert_default_arg): Detect recursion.
3483 2007-10-27 Jakub Jelinek <jakub@redhat.com>
3486 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
3487 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
3489 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
3491 * error.c (dump_expr): Handle OFFSETOF_EXPR.
3493 2007-10-26 Jason Merrill <jason@redhat.com>
3496 * pt.c (get_template_info): New fn.
3497 (template_class_depth): Use it.
3498 (push_template_decl_real): Check that the template args of the
3499 definition match the args of the previous declaration.
3501 2007-10-26 Paolo Carlini <pcarlini@suse.de>
3504 * decl2.c (coerce_new_type): Do not allow a default argument for
3505 the first parameter.
3507 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
3510 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
3511 don't see the leading '('. Only lookup names if we get an
3514 2007-10-26 Jakub Jelinek <jakub@redhat.com>
3517 * parser.c (cp_parser_parenthesized_expression_list): Set
3518 greater_than_is_operator_p to true in between the parens.
3520 2007-10-26 Paolo Carlini <pcarlini@suse.de>
3523 * decl.c (grokdeclarator): In case of conflicting specifiers
3524 just return error_mark_node.
3526 2007-10-26 Ollie Wild <aaw@google.com>
3528 * expr.c (cxx_expand_expr): Removed.
3529 * cp-tree.h (exx_expand_expr): Removed.
3530 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
3533 2007-10-25 Paolo Carlini <pcarlini@suse.de>
3536 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
3538 2007-10-23 Jason Merrill <jason@redhat.com>
3540 PR c++/25950 (DR 391)
3541 * call.c (struct conversion): Remove check_copy_constructor_p.
3542 (reference_binding): Always bind a reference directly to a
3543 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
3545 (check_constructor_callable): Remove.
3546 (convert_like_real): Don't call it.
3547 (initialize_reference): Don't call check_constructor_callable.
3548 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
3549 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
3550 conversions if LOOKUP_NO_TEMP_BIND.
3551 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
3552 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
3554 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
3556 2007-10-22 Jakub Jelinek <jakub@redhat.com>
3559 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
3560 before checking if its type is integral.
3562 2007-10-22 Jason Merrill <jason@redhat.com>
3565 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
3566 * pt.c (apply_late_template_attributes): Splice out dependent
3567 attributes from DECL_ATTRIBUTES.
3569 * decl.c (cxx_maybe_build_cleanup): Use build_address.
3571 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3573 * typeck.c (build_binary_op) : Use appropriate warning option
3574 instead of unnamed warning.
3576 2007-10-16 Paolo Carlini <pcarlini@suse.de>
3579 * pt.c (current_template_args): Do not change TREE_LIST elements
3580 with a TREE_VALUE of error_mark_node.
3582 2007-10-16 Mark Mitchell <mark@codesourcery.com>
3584 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
3585 * decl.c (start_decl): Tidy.
3586 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
3588 (grokdeclarator): Clarify comment.
3590 2007-10-14 Andrew Pinski <pinskia@gmail.com>
3593 * decl.c (grokfndecl): Return NULL after the "definition of
3594 implicitly-declared" error happened.
3596 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
3599 * call.c (build_user_type_conversion_1): Do not consider conversion
3600 functions to convert a (possibly cv-qualified) object to the (possibly
3601 cv-qualified) same object type (or a reference to it), to a (possibly
3602 cv-qualified) base class of that type (or a reference to it).
3604 2007-10-12 Paolo Carlini <pcarlini@suse.de>
3606 * pt.c (tsubst): Use template_parm_level_and_index.
3608 2007-10-12 Jakub Jelinek <jakub@redhat.com>
3611 * parser.c (cp_parser_compound_statement): Handle label-declarations
3612 at the beginning of the compound statement.
3613 (cp_parser_block_declaration): Issue diagnostics about __label__
3614 not at the beginning of a block.
3616 2007-10-11 Paolo Carlini <pcarlini@suse.de>
3619 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
3620 to convert_template_argument.
3621 (coerce_template_parms): Return error_mark_node after fixed-length
3623 (tsubst_decl): Check for error_mark_node the return value of the
3624 first tsubst in 'case VAR_DECL'.
3626 2007-10-08 Ollie Wild <aaw@google.com>
3628 * typeck2.c (digest_init): Call cplus_expand_constant after
3629 convert_for_initialization.
3630 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3631 * expr.c (cplus_expand_constant): Updated function description.
3633 2007-10-04 Jason Merrill <jason@redhat.com>
3636 * call.c (initialize_reference): Handle local static reference
3639 2007-10-03 Jason Merrill <jason@redhat.com>
3642 * name-lookup.c (push_namespace_with_attrs): Fold back into...
3643 (push_namespace): Here.
3644 (handle_namespace_attrs): New fn for the attr code.
3645 (leave_scope): Don't pop_visibility.
3646 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
3647 * parser.c (cp_parser_namespace_definition): Call
3648 handle_namespace_attrs and pop_visibility as appropriate.
3651 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
3653 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
3655 * decl.c (duplicate_decls): Preserve linkage flags for mere
3656 redeclarations of gnu_inline definitions.
3658 2007-10-03 Jason Merrill <jason@redhat.com>
3661 * decl.c (wrap_cleanups_r): New fn.
3662 (wrap_temporary_cleanups): New fn.
3663 (initialize_local_var): Call it.
3665 2007-09-29 Jason Merrill <jason@redhat.com>
3668 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
3669 constant to not have DECL_EXTERNAL if it's file-local.
3671 2007-09-28 Ollie Wild <aaw@google.com>
3674 2007-09-27 Ollie Wild <aaw@google.com>
3676 * typeck2.c (digest_init): Call cplus_expand_constant after
3677 convert_for_initialization.
3678 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3679 * expr.c (cplus_expand_constant): Updated function description.
3681 2007-09-28 Jason Merrill <jason@redhat.com>
3684 * class.c (layout_empty_base): Take rli parameter, update
3685 rli->record_align if empty base has user-specified alignment.
3686 (build_base_field): Pass rli to it.
3688 2007-09-28 Paolo Carlini <pcarlini@suse.de>
3691 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
3693 2007-09-28 Paolo Carlini <pcarlini@suse.de>
3696 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
3697 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
3698 (dump_parameters): Just call dump_type for argument packs too.
3700 2007-09-28 Jakub Jelinek <jakub@redhat.com>
3703 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
3704 qualification by creating qualified PACK_EXPANSION_PATTERN and
3705 then calling make_pack_expansion on it.
3707 2007-09-27 Ollie Wild <aaw@google.com>
3709 * typeck2.c (digest_init): Call cplus_expand_constant after
3710 convert_for_initialization.
3711 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3712 * expr.c (cplus_expand_constant): Updated function description.
3714 2007-09-27 Jason Merrill <jason@redhat.com>
3717 * decl2.c (is_late_template_attribute): Don't crash on unknown
3720 2007-09-27 Paolo Carlini <pcarlini@suse.de>
3723 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
3724 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
3725 spaces in the formatting.
3726 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
3728 2007-09-27 Jakub Jelinek <jakub@redhat.com>
3730 * error.c (cxx_print_error_function): Add third argument, pass
3731 it over to lhd_print_error_function.
3732 (cp_print_error_function): If diagnostic->abstract_origin, print
3734 * cp-tree.h (struct diagnostic_info): New forward decl.
3735 (cxx_print_error_function): Add third argument.
3737 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
3740 * name-lookup.c (pushtag): Do not create an implicit typedef before
3741 the associated type declaration is known to be valid.
3743 2007-09-25 Jakub Jelinek <jakub@redhat.com>
3745 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
3746 rather than pointers.
3748 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
3751 * search.c (check_final_overrider): Fail if
3752 targetm.comp_type_attributes returns 0.
3754 2007-09-24 Jason Merrill <jason@redhat.com>
3757 * pt.c (resolve_typename_type): Don't look things up in the original
3758 template if it would mean losing template arguments.
3760 2007-09-24 Jakub Jelinek <jakub@redhat.com>
3763 * cp-tree.h (cxx_type_hash_eq): New prototype.
3764 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
3765 * tree.c (cxx_type_hash_eq): New function.
3767 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
3770 * tree.c (cp_build_qualified_type_real): Build a canonical
3771 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
3773 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
3777 * tree.c (cplus_array_compare): Compare pointers, not types.
3778 (build_cplus_array_type_1): Store new array type into the hash
3779 table before building the canonical type; build the canonical type
3781 (cp_build_qualified_type_real): Put all of the array types with
3782 cv-qualified element types into the C++ array hash table, built as
3783 variants of the unqualified versions.
3785 2007-09-23 Jason Merrill <jason@redhat.com>
3788 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
3789 for deprecation warnings.
3791 2007-09-22 Jason Merrill <jason@redhat.com>
3794 * call.c (build_over_call): Warn about deprecated virtuals.
3797 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
3798 (MAYBE_TAGGED_TYPE_P): Remove.
3799 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
3800 instead of calling is_late_template_attribute again.
3801 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
3802 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
3803 Don't crash on typedefs from non-template classes.
3804 * decl2.c (grokfield): Don't sorry about attrs on template parms.
3805 (is_late_template_attribute): All attributes applied to template
3806 parms or typename types are dependent. Static.
3807 (splice_template_attributes): Pass decl through.
3808 (save_template_attributes): Likewise.
3810 2007-09-20 Jakub Jelinek <jakub@redhat.com>
3813 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
3814 returned from tsubst_pack_expansion.
3815 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
3816 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
3818 2007-09-20 Paolo Carlini <pcarlini@suse.de>
3821 * semantics.c (finish_id_expression): Use consistently
3822 context_for_name_lookup.
3823 * decl.c (fixup_anonymous_aggr): Fix error message for
3824 anonymous struct (vs union).
3826 2007-09-19 Jason Merrill <jason@redhat.com>
3829 * pt.c (tsubst): Handle typedefs by looking for the specialization.
3830 (retrieve_specialization): Only tagged types use
3831 DECL_TEMPLATE_INSTANTIATIONS.
3832 (instantiate_class_template): Push nested classes too.
3833 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
3835 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
3836 * init.c (is_aggr_type): Remove redundant tests.
3837 * class.c (push_nested_class): Use CLASS_TYPE_P.
3839 2007-09-20 Paolo Carlini <pcarlini@suse.de>
3842 * init.c (build_zero_init): If, recursively, build_zero_init
3843 returns a NULL_TREE, do not append it to the VEC of constructors.
3845 2007-09-18 Jason Merrill <jason@redhat.com>
3848 * pt.c (apply_late_template_attributes): Set processing_template_decl.
3849 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
3850 ATTR_FLAG_TYPE_IN_PLACE.
3851 (tsubst): Do unqualified lookup to find typedefs from current class.
3852 [ARRAY_TYPE]: Propagate alignment info.
3853 * decl2.c (is_late_template_attribute): Only defer handling of
3854 attribute aligned if the expression is dependent.
3855 (save_template_attributes): If we're deferring any attributes,
3856 make this a naming typedef.
3858 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3860 PR c++/33462 (again)
3861 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
3862 va_arg instead of __builtin_va_arg.
3864 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3867 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
3868 (pp_cxx_primary_expression): Use it.
3869 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
3870 * error.c (dump_expr): Use it.
3872 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3875 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
3876 out case TYPEID_EXPR to...
3877 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
3878 and pp_cxx_right_paren.
3879 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
3880 * error.c (dump_expr): Use it.
3882 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3885 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
3886 (pp_cxx_primary_expression): Use it.
3887 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
3888 * error.c (dump_expr): Use it.
3890 2007-09-16 Paolo Carlini <pcarlini@suse.de>
3893 * init.c (build_new): Remove warning for zero-element
3896 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
3899 * call.c (maybe_handle_implicit_object): Set this_p, clear
3900 rvaluedness_matches_p.
3901 (compare_ics): Do not compare rvaluedness matching when one of the
3902 operands is an implicit object.
3904 2007-09-14 Jason Merrill <jason@redhat.com>
3906 PR c++/17743, c++/19163
3907 * decl2.c (is_late_template_attribute): New fn.
3908 (splice_template_attributes, save_template_attributes): New fns.
3909 (cplus_decl_attributes): Call save_template_attributes.
3910 * pt.c (apply_late_template_attributes): New fn.
3911 (instantiate_class_template, tsubst_decl): Use it.
3912 * cp-tree.h: Declare is_late_template_attribute.
3914 2007-09-13 Tom Tromey <tromey@redhat.com>
3916 * parser.c (cp_lexer_new_main): Don't use
3917 c_lex_return_raw_strings.
3918 (cp_lexer_get_preprocessor_token): Update. Add special case when
3921 2007-09-11 Jan Hubicka <jh@suse.cz>
3923 * method.c (use_thunk): Use tree_rest_of_compilation
3924 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
3925 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
3926 * cp-tree.h (expand_body): Kill.
3927 (emit_associated_thunks): Declare.
3928 * semantics.c (emit_associated_thunks): Export.
3929 (expand_body): Kill.
3931 2007-09-09 David Daney <ddaney@avtrex.com>
3934 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
3935 to calculate cookie_ptr.
3937 2007-09-08 Jason Merrill <jason@redhat.com>
3940 * pt.c (most_specialized_class): Set processing_template_decl
3941 while tsubsting partial spec args.
3943 2007-09-06 Jason Merrill <jason@redhat.com>
3945 * decl2.c (get_guard): Copy visibility from the guarded variable.
3947 2007-09-06 Jan Hubicka <jh@suse.cz>
3949 * semantics.c (expand_body): Do not mark arguments of clones used.
3951 2007-09-06 Paolo Carlini <pcarlini@suse.de>
3954 * decl.c (cp_finish_decl): When processing_template_decl,
3955 deal correctly with init as TREE_LIST.
3957 2007-09-06 Tom Tromey <tromey@redhat.com>
3959 * decl.c (finish_function): Put return's location on line zero of
3962 2007-09-05 Jason Merrill <jason@redhat.com>
3965 * except.c (prepare_eh_type): Use type_decays_to.
3968 * init.c (build_delete): Use build_headof to get the address of the
3969 complete object if we aren't using the deleting destructor.
3970 * rtti.c (build_headof): No longer static.
3971 * cp-tree.h: Declare it.
3973 2007-09-06 Jakub Jelinek <jakub@redhat.com>
3975 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
3976 decl if a prototype for XX is provided with throw().
3979 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
3980 on __*_chk non-__builtin_* decls.
3982 2007-09-05 Paolo Carlini <pcarlini@suse.de>
3985 * semantics.c (finish_id_expression): Use context_for_name_lookup
3986 insted of DECL_CONTEXT, to see through anonymous structs and unions.
3987 * class.c (finish_struct_anon): Deal correctly with anonymous
3988 structs (vs unions, as GNU extension) in error messages.
3990 2007-09-05 Jan Hubicka <jh@suse.cz>
3992 * sematics.c (expand_body): Remove unnecesary import_export_decl
3993 call, DECL_EXTERNAL checks and current_function_decl saving.
3995 2007-09-05 Paolo Carlini <pcarlini@suse.de>
3997 PR c++/29731 (again)
3998 * parser.c (cp_parser_primary_expression): Return error_mark_node
3999 when a statement-expression is found in a template-argument list.
4001 2007-09-04 Jason Merrill <jason@redhat.com>
4003 * except.c (initialize_handler_parm): Use
4004 fold_build_cleanup_point_expr.
4007 * call.c (reference_binding): Don't look for user-defined conversions
4011 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
4012 the MUST_NOT_THROW_EXPR.
4014 2007-09-04 Richard Sandiford <richard@codesourcery.com>
4016 * decl.c (cp_finish_decl): Call determine_visibility before
4017 make_rtl_for_nonlocal_decl.
4019 2007-09-04 Jason Merrill <jason@redhat.com>
4022 * pt.c (most_specialized_class): Substitute outer template
4023 arguments into the arguments of a member template partial
4025 (strip_innermost_template_args): New fn.
4027 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
4029 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
4031 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4033 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
4034 * decl.c (cp_make_fname_decl): Likewise,
4035 * parser.c (cp_parser_string_literal): Likewise,
4036 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
4037 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4040 2007-09-02 Paolo Carlini <pcarlini@suse.de>
4043 * typeck.c (build_unary_op): Fix error message for
4044 Boolean expression as operand to operator--.
4046 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4048 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
4049 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4052 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4055 * init.c (build_default_init): Make extern.
4056 * cp-tree.h (build_default_init): Declare here.
4057 * pt.c (tsubst_expr): When the instantiation of the initializer of
4058 a variable results in an empty list, default-initialize the
4060 (tsubst_copy_and_build): When the instantiation of the initializer
4061 in a new expression results in an empty initializer list,
4062 default-initialize it.
4064 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4066 * mangle.c (write_type): Change mangling of rvalue reference from
4069 2007-08-31 Jakub Jelinek <jakub@redhat.com>
4071 * decl.c (duplicate_decls): Remove duplicated line.
4073 2007-08-31 Paolo Carlini <pcarlini@suse.de>
4076 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
4077 BOUND_TEMPLATE_TEMPLATE_PARM.
4079 2007-08-31 Paolo Carlini <pcarlini@suse.de>
4082 * search.c (lookup_member): Check the name argument for
4085 2007-08-31 Paolo Carlini <pcarlini@suse.de>
4088 * parser.c (cp_parser_trait_expr): Check rerurn value of
4091 2007-08-30 Ollie Wild <aaw@google.com>
4093 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
4094 convert_ptrmem for pointer to member conversions.
4095 (convert_to_pointer_force): Update cp_convert_to_pointer call.
4096 (ocp_convert): Update cp_convert_to_pointer call.
4097 * typeck.c (convert_ptrmem): Add conditional for null pointers to
4099 (build_static_cast_1): Check can_convert for conversions in either
4101 (get_delta_difference_1): New function.
4102 (get_delta_difference): Refactor to call get_delta_difference_1.
4104 2007-08-30 Jakub Jelinek <jakub@redhat.com>
4106 * decl.c (start_preparsed_function): Set
4107 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
4109 2007-08-28 Paolo Carlini <pcarlini@suse.de>
4112 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
4113 BOUND_TEMPLATE_TEMPLATE_PARM.
4115 2007-08-28 Jakub Jelinek <jakub@redhat.com>
4119 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
4120 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
4122 2007-08-27 Jason Merrill <jason@redhat.com>
4125 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
4126 Look inside STMT_EXPR.
4127 * semantics.c (stmt_expr_value_expr): New fn.
4128 * cp-tree.h: Declare it.
4131 * decl.c (groktypename): Ignore attributes applied to class type.
4133 2007-08-28 Richard Guenther <rguenther@suse.de>
4135 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
4137 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
4139 * error.c (dump_expr): Handle COMPLEX_CST.
4140 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
4141 (pp_cxx_expression): Likewise.
4143 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
4145 * decl.c (GNU_INLINE_P): New.
4146 (duplicate_decls): Handle gnu_inline. Merge attributes and
4147 some flags in overriding definitions.
4148 (redeclaration_error_message): Handle gnu_inline.
4149 (start_preparsed_function): Likewise.
4151 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4153 * call.c (sufficient_parms_p): Constify.
4154 * class.c (same_signature_p): Likewise.
4155 * cp-gimplify.c (is_invisiref_parm,
4156 cxx_omp_privatize_by_reference): Likewise.
4157 * cp-objcp-common.c (has_c_linkage): Likewise.
4158 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
4159 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
4160 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
4161 num_artificial_parms_for, comp_template_parms,
4162 template_parameter_pack_p, any_dependent_template_arguments_p,
4163 any_type_dependent_arguments_p, any_value_dependent_elements_p,
4164 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
4165 zero_init_p, member_p, cp_lvalue_kind,
4166 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4167 varargs_function_p, is_dummy_object, special_function_kind,
4168 string_conv_p, type_unknown_p, comp_except_specs, compparms,
4169 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
4170 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
4171 cp_has_mutable_p, at_least_as_qualified_p,
4172 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
4173 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
4174 * except.c (nothrow_libfn_p): Likewise.
4175 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
4177 * pt.c (comp_template_parms, template_parameter_pack_p,
4178 any_type_dependent_arguments_p, any_value_dependent_elements_p,
4179 any_dependent_template_arguments_p): Likewise.
4180 * repo.c (repo_export_class_p): Likewise.
4181 * semantics.c (anon_aggr_type_p): Likewise.
4182 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
4183 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4184 varargs_function_p, member_p, is_dummy_object, pod_type_p,
4185 zero_init_p, special_function_p): Likewise.
4186 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
4187 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
4188 compparms, invalid_nonstatic_memfn_p,
4189 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
4190 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
4191 cp_has_mutable_p, lvalue_or_else): Likewise.
4193 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
4195 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
4196 * cp-objcp-common.c (cp_tree_size): Ditto.
4197 * tree.c (cp_walk_subtrees): Ditto
4198 * cp-tree.def (TINST_LEVEL): Go away.
4199 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
4200 move together with other non-tree structs.
4201 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
4202 (union lang_tree_node): Eliminate tinst_level field.
4203 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
4204 (current_instantiation, outermost_tinst_level): Return
4205 a "struct tinst_level *".
4207 * error.c (print_instantiation_partial_context): Change second
4208 parameter to a "struct tinst_level *". Replace accessor macros
4210 (print_instantiation_full_context): Likewise.
4211 * lex.c (in_main_input_context): Likewise.
4213 * pt.c (struct pending_templates): New.
4214 (pending_templates, last_pending_template): Use it as a type.
4215 (current_tinst_level): Change typo to "struct tinst_level *"
4216 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
4217 (add_pending_template): Construct a "struct pending_template".
4218 Replace TINST_LEVEL accessor macros with field access.
4219 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
4220 (pop_tinst_level): Likewise.
4221 (instantiate_pending_templates): Likewise. Factor common code used
4222 when an instantiation has been done.
4223 (outermost_tinst_level): Replace tree_last with loop.
4224 (current_instantiation): Return a "struct tinst_level *".
4226 2007-08-24 Ollie Wild <aaw@google.com>
4228 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
4229 * name-lookup.h (cp_binding_level): Remove vtables member.
4231 2007-08-24 Richard Guenther <rguenther@suse.de>
4233 * tree.c (cp_cannot_inline_tree_fn): Remove.
4234 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
4235 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
4238 2007-08-24 Jakub Jelinek <jakub@redhat.com>
4241 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
4242 error_mark_node right away if build_expr_type_conversion
4246 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
4247 is error_mark_node rather than NULL_TREE.
4248 * pt.c (check_explicit_specialization): Likewise.
4251 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
4252 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
4254 2007-08-22 Jason Merrill <jason@redhat.com>
4257 * pt.c (outermost_tinst_level): New function.
4258 * lex.c (in_main_input_context): New function.
4259 * cp-tree.h: Declare it.
4260 * decl2.c (constrain_class_visibility): Use it to avoid warning
4261 about uses of the anonymous namespace in the main input file.
4263 2007-08-21 Jakub Jelinek <jakub@redhat.com>
4265 * init.c (build_new_1): Use get_target_expr instead of save_expr.
4267 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
4270 * class.c (finish_struct_1): Warn when a class has virtual
4271 functions and accessible non-virtual destructor.
4273 2007-08-20 Richard Guenther <rguenther@suse.de>
4277 * call.c (build_new_method_call): Convert initializer to
4279 * init.c (build_aggr_init): Do not fiddle with types.
4280 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
4281 * except.c (build_throw): Do not drop qualifiers for the
4283 * typeck.c (get_member_function_from_ptrfunc): Do not
4284 fiddle with types, instead convert.
4285 (build_ptrmemfunc1): Convert to the target type for
4287 (gfc_trans_allocate): Convert result to target type.
4288 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
4289 pointer-to-member structures shall have alias set zero as well.
4291 2007-08-20 Richard Guenther <rguenther@suse.de>
4293 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
4295 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
4296 (nonstatic_local_decl_p): Likewise.
4297 * tree.c (cp_auto_var_in_fn_p): Remove.
4298 * decl.c (nonstatic_local_decl_p): Remove.
4300 2007-08-20 Richard Guenther <rguenther@suse.de>
4302 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
4304 * tree.h (cp_walk_tree): New define to walk_tree_1 with
4305 cp_walk_subtrees lh parameter.
4306 (cp_walk_tree_without_duplicates): New define to
4307 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
4308 * tree.c (count_trees): Call
4309 cp_walk_tree_without_duplicates.
4310 (verify_stmt_tree): Call cp_walk_tree.
4311 (break_out_target_exprs): Likewise.
4312 (WALK_SUBTREE): Likewise.
4313 * cp-gimplify.c (cp_genericize): Likewise.
4314 * cp-pt.c (find_parameter_packs_r): Likewise.
4315 (uses_parameter_packs): Likewise.
4316 (make_pack_expansion): Likewise.
4317 (check_for_bare_parameter_packs): Likewise.
4318 (for_each_template_parm): Likewise.
4319 * decl.c (check_default_argument): Call
4320 cp_walk_tree_without_duplicates.
4321 * except.c (build_throw): Likewise.
4322 * decl2.c (type_visibility): Likewise.
4323 * semantics.c (expand_or_defer_fn): Likewise.
4324 (finalize_nrv): Call cp_walk_tree.
4326 2007-08-20 Jakub Jelinek <jakub@redhat.com>
4329 * init.c (build_new_1): Rename placement_var variable to placement_expr.
4330 Initialize it with save_expr rather than get_temp_regvar.
4332 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
4335 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
4338 2007-08-17 Ollie Wild <aaw@google.com>
4341 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
4342 declarations into appropriate slots for comparison. Fix type
4345 2007-08-17 Paolo Carlini <pcarlini@suse.de>
4348 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
4349 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
4351 2007-08-17 Paolo Carlini <pcarlini@suse.de>
4354 * parser.c (cp_parser_class_head): Improve error message.
4356 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
4358 * pt.c (instantiate_decl): Set input_location
4359 for the function end.
4361 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4363 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
4365 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
4366 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
4367 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
4368 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
4369 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
4370 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
4371 * typeck.c (cp_type_quals): Likewise.
4372 * typeck2.c (cxx_incomplete_type_diagnostic,
4373 cxx_incomplete_type_error): Likewise.
4375 2007-08-16 Paolo Carlini <pcarlini@suse.de>
4378 * pt.c (tsubst_friend_function): When check_classfn
4379 returns error_mark_node likewise return it.
4381 2007-08-15 Jakub Jelinek <jakub@redhat.com>
4384 * typeck.c (check_return_expr): Don't NRV optimize vars in
4386 * decl.c (finish_function): Comment fix.
4388 2007-08-15 Paolo Carlini <pcarlini@suse.de>
4391 * pt.c (push_template_decl_real): Depending on TYPE_P
4392 use either TYPE_CONTEXT or DECL_CONTEXT.
4394 2007-08-14 Mark Mitchell <mark@codesourcery.com>
4396 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
4397 constructors and destructors return this.
4399 2007-08-14 Paolo Carlini <pcarlini@suse.de>
4402 * decl2.c (check_classfn): Return error_mark_node in case of error;
4403 in that case, do not call add_method.
4404 * decl.c (start_decl): Deal with check_classfn returning
4406 (grokfndecl): Likewise.
4407 * pt.c (tsubst_friend_function): Likewise.
4409 2007-08-14 Andrew Pinski <pinskia@gmail.com>
4412 * typeck.c (build_binary_op): Disallow vector float types with
4413 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
4415 2007-08-11 Ian Lance Taylor <iant@google.com>
4417 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
4419 * cp-tree.h (cxx_get_alias_set): Update declaration.
4421 2007-08-10 Ollie Wild <aaw@google.com>
4423 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
4425 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
4427 (unqualified_namespace_lookup): Fix ambiguous_decl call.
4428 (lookup_using_namespace): Fix ambiguous_decl call.
4429 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
4431 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4433 * call.c (name_as_c_string): Use CONST_CAST.
4434 * decl.c (build_decl): Likewise.
4435 * parser.c (cp_parser_string_literal): Likewise.
4437 2007-08-10 Paolo Carlini <pcarlini@suse.de>
4440 * error.c (dump_expr): Consistently use the *_cxx_*
4441 variants of the pretty-print functions.
4443 2007-08-10 Paolo Carlini <pcarlini@suse.de>
4446 * decl.c (check_special_function_return_type): Just error
4447 on return type specified for conversion operator.
4449 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
4451 * typeck2.c (readonly_error): Handle general expressions.
4452 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
4454 2007-08-06 Dan Hipschman <dsh@google.com>
4456 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
4457 access function name.
4459 2007-08-04 Alfred Minarik <a.minarik@aon.at>
4462 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
4463 * g++spec.c (lang_specific_driver): Check them.
4465 2007-08-06 Paolo Carlini <pcarlini@suse.de>
4468 * pt.c (inline_needs_template_parms): Fix comment; change return type
4471 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
4474 2007-03-26 Dirk Mueller <dmueller@suse.de>
4476 * parser.c (cp_parser_member_declaration): Pedwarn
4477 about stray semicolons after member declarations.
4479 2007-08-02 Lee Millward <lee.millward@gmail.com>
4484 * parser.c (cp_parser_asm_definition): Detect and discard asm
4485 statements with invalid inputs or outputs.
4486 (cp_parser_asm_operand_list): Return error mark node if any
4487 of the operands are invalid. Adjust documentation.
4489 2007-08-02 Nick Clifton <nickc@redhat.com>
4491 * typeck.c: Change copyright header to refer to version 3 of the
4492 GNU General Public License and to point readers at the COPYING3
4493 file and the FSF's license web page.
4494 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
4495 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
4496 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
4497 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
4498 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
4499 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
4500 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
4501 name-lookup.h, parser.c: Likewise.
4503 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4506 * call.c (magic_varargs_p): Honor the "type generic" attribute.
4508 2007-07-30 Paolo Carlini <pcarlini@suse.de>
4511 * semantics.c (finish_label_stmt): Reject the __label__
4512 extension outside function scopes.
4514 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4516 * parser.c (eof_token): Un-constify.
4517 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
4518 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
4521 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
4523 * pt.c, tree.c, typeck2.c: Fix comment typos.
4525 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
4526 Mark Mitchell <mark@codesourcery.com>
4529 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
4530 hidden due to friend declarations in local classes.
4532 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
4534 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
4535 * cp-tree.def (DECLTYPE_TYPE): New.
4536 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
4537 (dump_type_prefix): Ditto.
4538 (dump_type_suffix): Ditto.
4539 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
4540 * mangle.c (write_type): Handle DECLTYPE_TYPE.
4541 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
4543 (DECLTYPE_TYPE_EXPR): New.
4544 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
4545 (finish_declared_type): Declare.
4546 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
4547 DECLTYPE_TYPE nodes.
4548 (pp_cxx_type_id): Ditto.
4549 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
4550 (tsubst): Substitute into a DECLTYPE_TYPE node.
4551 (tsubst_copy): Ditto.
4552 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
4554 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
4555 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
4556 structural equality (because we can't hash the expressions).
4557 (finish_declared_type): New.
4558 * lex.c (reswords): Add "decltype" keyword.
4559 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
4560 (cp_parser_postfix_expression): Add member_access_only_p to
4561 restrict postfix expression to member access expressions.
4562 (cp_parser_unary_expression): Update call to
4563 cp_parser_postfix_expression to reflect new parameter.
4564 (cp_parser_declared_type): New.
4565 (cp_parser_simple_type_specifier): Parse decltype types.
4567 2007-07-27 Mark Mitchell <mark@codesourcery.com>
4570 * call.c (convert_for_arg_passing): Only widen bitfields to their
4571 declared types if necessary.
4573 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4575 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
4578 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4580 * decl.c (typename_hash, typename_compare): Constify.
4581 * mangle.c (hash_type, compare_type): Likewise.
4582 * pt.c (eq_local_specializations, hash_local_specialization):
4584 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
4585 list_hash): Likewise.
4586 * typeck2.c (pat_compare): Likewise.
4588 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
4590 * method.c (implicitly_declare_fn): Increase alignment if member
4591 function pointer format requires it.
4593 2007-07-24 Paolo Carlini <pcarlini@suse.de>
4596 * typeck.c (check_return_expr): Do not pass a null argument
4599 2007-07-24 Paolo Carlini <pcarlini@suse.de>
4602 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
4605 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
4608 * typeck.c (convert_arguments): Only use default args if we have
4612 * typeck.c (structural_comptypes): No need to check
4613 resolve_typename_type return value here.
4614 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
4615 * pt.c (resolve_typename_type): Follow typename typedefs. Return
4616 original type rather than error_mark_node in case of failure.
4617 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
4618 resolve_typename_type result check.
4619 (cp_parser_direct_declarator, cp_parser_head,
4620 cp_parser_constructor_declarator_p): Likewise.
4622 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
4624 * pt.c (template_parms_variadic_p): Remove.
4625 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
4627 2007-07-12 Jakub Jelinek <jakub@redhat.com>
4630 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
4631 argument to dump_aggr_init_expr_args instead of false.
4633 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
4635 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
4636 canonical types; otherwise, fall back to structural type
4637 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
4638 internal compiler error if the canonical types are wrong.
4640 2007-07-11 Paolo Carlini <pcarlini@suse.de>
4643 * parser.c (cp_parser_make_indirect_declarator): When the
4644 the code argument is ERROR_MARK return cp_error_declarator.
4646 2007-07-09 Geoffrey Keating <geoffk@apple.com>
4649 * decl.c (cxx_init_decl_processing): Don't set
4650 force_align_functions_log.
4651 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
4652 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
4653 FUNCTION_DECL, return its alignment.
4655 2007-07-09 Richard Guenther <rguenther@suse.de>
4657 * decl.c (start_preparsed_function): Do not promote return type.
4659 2007-07-08 Paolo Carlini <pcarlini@suse.de>
4662 * pt.c (unify): Never pass error_mark_node to template_decl_level.
4664 2007-07-07 Mark Mitchell <mark@codesourcery.com>
4667 * pt.c (resolve_overloaded_unification): Robustify. Return a
4669 (type_unification_real): Adjust accordingly.
4671 2007-07-06 Richard Guenther <rguenther@suse.de>
4673 * init.c (build_new_1): Use the correct pointer type.
4674 * typeck2.c (build_m_component_ref): Likewise.
4676 2007-07-05 Mark Mitchell <mark@codesourcery.com>
4679 * init.c (build_zero_init): Always build an initializer for
4681 * typeck2.c (build_functional_cast): Use build_zero_init.
4684 * init.c (build_new_1): Always pass the allocation function to
4685 build_op_delete_call.
4686 * call.c (build_op_delete_call): Handle operator delete with a
4687 variable-argument list. Do not issue an error when no matching
4688 deallocation function is available for a new operator.
4691 * cp-tree.h (any_value_dependent_elements_p): Declare it.
4692 * decl.c (value_dependent_init_p): New function.
4693 (cp_finish_decl): Use it.
4694 * pt.c (value_dependent_expression_p): Use
4695 any_value_dependent_elements_p.
4696 * parser.c (cp_parser_primary_expression): Add comment about
4697 treating dependent qualified names as integral
4698 constant-expressions.
4700 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
4702 * decl.c (build_ptrmemfunc_type): Always use structural equality
4703 tests when comparing pointer-to-member-function types, because the
4704 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
4707 2007-07-03 Mark Mitchell <mark@codesourcery.com>
4709 * init.c (build_new): Tweak comment.
4711 2007-06-29 Dave Brolley <brolley@redhat.com>
4714 * parser.c (cp_parser_new_type_id): Don't reduce a named array
4715 type to its base type and number of elements here.
4716 * init.c (build_new): Call complete_type_or_else to ensure that the
4717 type is complete and to issue a diagnostic if it is not.
4718 (build_new_1): Don't call complete_type_or_else here.
4720 2007-07-03 Richard Guenther <rguenther@suse.de>
4723 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
4726 2007-07-02 Simon Baldwin <simonb@google.com>
4728 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
4729 for inner-style nested forward declarations that don't declare
4732 2007-07-02 Jakub Jelinek <jakub@redhat.com>
4735 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
4736 DECL_P in not a variable and appears more than once error messages.
4738 2007-07-01 Ollie Wild <aaw@google.com>
4740 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
4741 (select_decl): Remove function.
4742 (unqualified_namespace_lookup): Populate binding by calling
4743 ambiguous_decl. Remove select_decl call.
4744 (lookup_qualified_name): Remove select_decl call.
4745 * decl.c (lookup_and_check_tag): Check for ambiguous references.
4746 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
4747 generation when name lookup is ambiguous.
4749 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
4752 * init.c (build_new_1): Use structural equality on the copy of the
4755 2007-06-28 Geoffrey Keating <geoffk@apple.com>
4757 * decl2.c (determine_visibility): Implement
4758 flag_visibility_ms_compat effect on type info.
4759 * decl.c (cxx_init_decl_processing): Implement
4760 global effect of flag_visibility_ms_compat.
4762 2007-06-28 Geoffrey Keating <geoffk@apple.com>
4764 * decl2.c (start_objects): Mark constructor-running function
4767 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
4770 * decl.c (grokdeclarator): Reset friendp for member functions declared
4771 friend of their own class.
4773 2007-06-23 Mark Mitchell <mark@codesourcery.com>
4775 * decl2.c (determine_visibility): Don't look for dllexport here.
4776 (determine_visibility_from_class): Tidy.
4778 2007-06-18 Simon Baldwin <simonb@google.com>
4781 * parser.c (cp_parser_single_declaration): Added check for storage
4782 class other than sc_none in parsed declaration, and a flag to indicate
4783 if the call is part of an explicit template specialization parse.
4784 * (cp_parser_explicit_specialization): Specialization check flag added
4785 to call to cp_parser_single_declaration(), set true.
4786 * (cp_parser_template_declaration_after_export): Specialization check
4787 flag added to call to cp_parser_single_declaration(), set false.
4788 * pt.c (check_explicit_specialization): Added code to copy visiblity
4789 and linkage from the templated function to the explicit specialization.
4791 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
4793 * typeck.c (build_binary_op): For templates build the
4794 expression in pieces to avoid the assert in build2_stat.
4795 (get_member_function_from_ptrfunc):
4796 Change over to using POINTER_PLUS_EXPR and convert
4797 the second operand to sizetype.
4798 * typeck2.c (build_m_component_ref): Likewise.
4799 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
4800 instead of PLUS_EXPR for pointers.
4801 (build_new_1): Likewise.
4802 (build_vec_delete_1): Likewise.
4803 (build_vec_delete): Likewise.
4804 * class.c (build_base_path): Likewise.
4805 (build_base_path): Likewise.
4806 (convert_to_base_statically): Likewise.
4807 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
4808 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
4809 instead of PLUS_EXPR.
4810 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
4811 instead of PLUS_EXPR for pointers.
4812 * call.c (build_special_member_call): Likewise.
4813 * rtti.c (build_headof): Likewise.
4814 Use sizetype instead of ptrdiff_type_node.
4815 (tinfo_base_init): Create a POINTER_PLUS_EXPR
4816 instead of PLUS_EXPR for pointers.
4817 * except.c (expand_start_catch_block): Do a
4818 NEGATIVE and then a POINTER_PLUS_EXPR instead
4820 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
4821 PLUS_EXPR on pointer types over to use
4822 POINTER_PLUS_EXPR and remove the conversion
4823 to the pointer types.
4824 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
4825 adding to a pointer type. Use size_int instead of
4826 ssize_int. Convert the index to sizetype before
4827 adding it to the pointer.
4829 2007-06-15 Mark Mitchell <mark@codesourcery.com>
4831 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
4832 (DECL_ANON_UNION_VAR_P): New macro.
4833 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
4834 than DECL_VAR_MARKED_P, to keep track of which variables we have
4836 * decl.c (redeclaration_error_message): Complain about redeclaring
4837 anonymous union members at namespace scope.
4838 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
4840 2007-06-14 Geoff Keating <geoffk@apple.com>
4842 * decl2.c (determine_visibility): Ensure that functions with
4843 hidden types as parameters are hidden.
4846 * decl2.c (determine_visibility): Remove duplicate code for
4849 2007-06-12 Ian Lance Taylor <iant@google.com>
4852 * init.c (avoid_placement_new_aliasing): New static function.
4853 (build_new_1): Call it.
4855 2007-06-11 Rafael Ávila de Espíndola <espindola@google.com>
4857 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
4858 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
4860 2007-06-08 Jakub Jelinek <jakub@redhat.com>
4863 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
4864 on init, the non-decl cond operand and increment value.
4866 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
4869 * decl.c (check_initializer): Report an error when a brace enclosed
4870 initializer is used for a non-aggregate type in C++98.
4871 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
4873 (grokdeclarator): Likewise.
4874 (move_fn_p): Likewise.
4875 * typeck.c (check_return_expr): Likewise.
4876 * call.c (reference_binding): Likewise.
4877 * error.c (cp_cpp_error): Likewise.
4878 * pt.c (check_default_tmpl_args): Likewise.
4880 * lex.c (init_reswords): Likewise.
4881 * parser.c (p_parser_primary_expression): Likewise.
4882 (TOKEN_PRECEDENCE): Likewise.
4883 (cp_parser_init_declarator): Likewise.
4884 (cp_parser_ptr_operator): Likewise.
4885 (cp_parser_parameter_declaration): Likewise.
4886 (cp_parser_enclosed_template_argument_list): Likewise.
4887 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
4888 (cp_parser_next_token_ends_template_argument_p): Likewise.
4890 2007-06-04 Simon Baldwin <simonb@google.com>
4892 * decl.c (grokdeclarator): Readability change. Moved case labels
4893 into direct switch statement scope.
4895 2007-06-04 Paolo Carlini <pcarlini@suse.de>
4897 * call.c (convert_like_real): Remove pointless code.
4899 2007-05-31 Mark Mitchell <mark@codesourcery.com>
4901 * decl.c (get_atexit_fn_ptr_type): New function.
4902 (get_atexit_node): Use it.
4903 (start_cleanup_fn): Likewise.
4904 (register_dtor_fn): Use the object's destructor, instead of a
4905 separate cleanup function, where possible.
4906 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
4907 (atexit_fn_ptr_type_node): New macro.
4908 * decl2.c (build_cleanup): Use build_address.
4910 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
4912 * typeck.c (build_binary_op): Include types in error.
4914 2007-05-31 Jakub Jelinek <jakub@redhat.com>
4917 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
4918 needs runtime initialization.
4920 2007-05-31 Paolo Carlini <pcarlini@suse.de>
4923 * semantics.c (finish_trait_expr): Complete the types.
4925 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
4926 Douglas Gregor <doug.gregor@gmail.com>
4927 Pedro Lamarao <pedro.lamarao@mndfck.org>
4928 Howard Hinnant <howard.hinnant@gmail.com>
4932 * typeck.c (comptypes): Don't consider rvalue and lvalue
4933 reference types to be equivalent.
4934 (check_return_expr): Move from certain lvalues when returning
4936 * decl.c (grokdeclarator): Implement reference collapsing.
4937 (copy_fn_p): Don't consider constructors taking rvalue references
4938 to be copy constructors.
4940 * call.c (conversion): New "rvaluedness_matches_p" member.
4941 (convert_class_to_reference): Require reference type as first
4942 parameter instead of base type.
4943 (reference_binding): Add logic to handle rvalue references.
4944 (implicit_conversion): Update inaccurate comment.
4945 (convert_like_real): Disable creation of temporaries that are
4946 impossible to initialize for types with move constructors.
4947 (build_over_call): Elide move constructors when possible.
4948 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
4949 (maybe_handle_ref_bind): Return conversion instead of type node.
4950 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
4951 determine preferred conversion sequences.
4952 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
4953 (LOOKUP_PREFER_RVALUE): New.
4954 (DECL_MOVE_CONSTRUCTOR_P): New.
4955 (struct cp_declarator): Add "reference" member for reference
4956 types, with new "rvalue_ref" flag.
4957 (cp_build_reference_type): Declare.
4958 (move_fn_p): Declare.
4959 * error.c (dump_type_prefix): Format rvalue reference types
4960 correctly in error messages.
4961 * except.c (build_throw): Move from certain lvalues when
4963 * mangle.c (write_type): Mangle rvalue references differently
4964 than regular references.
4965 * parser.c (make_reference_declarator): Add boolean parameter for
4967 (cp_parser_make_indirect_declarator): New.
4968 (cp_parser_new_declarator_opt): Call
4969 cp_parser_make_indirect_declarator.
4970 (cp_parser_conversion_declarator_opt): Ditto.
4971 (cp_parser_declarator): Ditto.
4972 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
4974 * pt.c (tsubst): Implement reference collapsing.
4975 (maybe_adjust_types_for_deduction): Implement special template
4976 parameter deduction rule for rvalue references.
4977 (type_unification_real): Update calls to
4978 maybe_adjust_types_for_deduction.
4979 (try_one_overload): Ditto.
4980 (unify_pack_expansion): Ditto.
4981 * tree.c (lvalue_p_1): Handle rvalue reference types.
4982 (cp_build_reference_type): New.
4984 2007-05-30 Jakub Jelinek <jakub@redhat.com>
4987 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
4988 variables that need runtime initialization.
4990 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
4993 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
4994 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
4995 case POSTDECREMENT_EXPR>): Return the error_mark_node
4996 if either the real or imaginary parts would an
4999 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
5000 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5003 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
5004 token is a closing brace, false if there are no tokens left.
5005 (cp_parser_namespace_alias_definition): Only consume the next token if
5006 it is a closing brace.
5008 * parser.c (cp_parser_class_specifier): Likewise.
5010 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
5012 * semantics.c (finish_member_declaration): Fix a typo in the
5015 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
5027 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
5028 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
5029 * pt.c (check_for_bare_parameter_packs): Return bool indicated
5030 whether everything was okay. Fix indentation.
5031 (push_template_decl_real): Check for bare parameter packs in
5032 function parameters; where errors occur, mark the parameter types
5033 with ERROR_MARK_NODEs to avert ICEs.
5034 (coerce_template_parameter_pack): New.
5035 (coerce_template_parms): Moved parameter pack coercion into
5036 coerce_template_parameter_pack, and permit it anywhere in the
5037 template parameter list (not just at the end). Parameter and
5038 argument indices can vary (somewhat) separately now, so add
5039 PARM_IDX and ARG_IDX.
5040 (fn_type_unification): Don't set an argument pack as incomplete if
5041 no argument pack was deduced.
5042 (type_unification_real): If a type parameter is a parameter pack
5043 and has not otherwise been deduced, it will be deduced to an empty
5045 (more_specialized_fn): Use the actual lengths of the argument
5046 lists when comparing against expansions.
5047 * semantics.c (finish_member_declaration): If a field's type has
5048 bare parameter packs, error and set its type to ERROR_MARK_NODE.
5050 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
5053 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
5055 2007-05-22 Ollie Wild <aaw@google.com>
5057 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
5058 (unqualified_namespace_lookup): Adds check for hidden types.
5060 2007-05-22 Ollie Wild <aaw@google.com>
5062 * decl.c (duplicate_decls): Verify namespace names are unique.
5064 2007-05-21 Mark Mitchell <mark@codesourcery.com>
5066 * decl.c (cxx_maybe_build_cleanup): Handle
5067 __attribute__((cleanup)).
5069 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5071 * cvt.c (cp_convert_and_check): Don't check warnings if the
5074 2007-05-18 Geoffrey Keating <geoffk@apple.com>
5076 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
5078 2007-05-14 Paolo Carlini <pcarlini@suse.de>
5081 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
5082 type only if is a class type (5.2.8/4).
5084 2007-05-14 Rafael Ávila de Espíndola <espindola@google.com>
5086 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
5087 * decl.c (grokdeclarator): Use unsigned_type_for instead of
5088 c_common_unsigned_type.
5090 2007-05-11 Silvius Rus <rus@google.com>
5092 * typeck.c (build_indirect_ref): Add call to
5093 strict_aliasing_warning.
5094 (build_reinterpret_cast_1): Condition call to
5095 strict_aliasing_warning.
5097 2007-05-11 Jan Hubicka <jh@suse.cz>
5099 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
5100 * decl2.c (start_objects): ctors and dtors are no longer public.
5101 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
5103 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
5105 * typeck.c (build_unary_op): Remove code that used to
5106 handle non lvalue increments/decrements.
5108 2007-05-07 Mike Stump <mrs@apple.com>
5110 * parser.c (check_empty_body): Add.
5111 (cp_parser_iteration_statement): Add call to check_empty_body.
5113 2007-05-05 Geoffrey Keating <geoffk@apple.com>
5116 * mangle.c (write_mangled_name): Mangle static variable names.
5117 (write_unqualified_name): Use local-source-name for
5118 namespace-scope static variables.
5120 2007-05-04 Dirk Mueller <dmueller@suse.de>
5122 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
5125 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
5128 * decl2.c (constrain_class_visibility):
5129 Use strip_pointer_or_array_types instead of strip_array_types.
5131 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
5134 * decl.c (reshape_init_r): Don't reshape the first element if it
5135 is a pointer to member function.
5137 2007-04-27 Simon Baldwin <simonb@google.com>
5139 * decl.c (grokparms): Changed message format from %qD to %qE.
5141 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
5143 * error.c (maybe_warn_variadic_templates): Variadic templates are
5144 now in C++0x, so only warn about them in C++98 mode.
5146 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
5149 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
5150 integeral types from vectors types.
5152 2007-04-26 Jakub Jelinek <jakub@redhat.com>
5155 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
5156 for type dependent OMP_CLAUSE_DECLs.
5158 2007-04-24 Mark Mitchell <mark@codesourcery.com>
5161 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
5162 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
5163 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
5164 * init.c (build_zero_init): Adjust, as
5165 COMPLEX_TYPE is now a SCALAR_TYPE.
5166 * typeck2.c (digest_init): Allow brace-enclosed initializers for
5167 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
5169 2007-04-25 Paolo Carlini <pcarlini@suse.de>
5171 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
5172 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
5173 (trait_expr_value): Adjust.
5175 2007-04-23 Simon Baldwin <simonb@google.com>
5177 * decl.c (grokparms): Added new error for duplicate function
5178 parameters names in function prototypes, to match gcc behavior.
5180 2007-04-23 Jan Hubicka <jh@suse.cz>
5182 * decl2.c (finish_objects): Do not call target constructor/destructor
5185 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
5187 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
5188 instead of checking GIMPLE_STMT_P in chain_next.
5190 2007-04-17 Mark Mitchell <mark@codesourcery.com>
5193 * call.c (convert_for_arg_passing): Convert bitfields to their
5196 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
5199 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
5201 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
5204 * decl2.c (constrain_class_visibility):
5205 Do not warn about the use of anonymous namespace in the main input file.
5207 2007-04-15 Mark Mitchell <mark@codesourcery.com>
5209 * cp-tree.h (current_template_parms): Fix typo in comment.
5211 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
5213 * cp-tree.h, error.c: Fix comment typos.
5215 2007-04-13 Jason Merrill <jason@redhat.com>
5218 * call.c (reference_binding): Add c_cast_p parm. If true,
5219 add quals to TO as needed to make it reference-compatible.
5221 2007-04-11 Jan Hubicka <jh@suse.cz>
5223 * class.c (convert_to_base_statically): Fold produced tree; verify
5224 that we are not processing template_decl.
5226 2007-04-09 Mark Mitchell <mark@codesourcery.com>
5229 * class.c (build_base_path): Ensure that the converted pointer has
5230 the same cv-qualification as the input.
5232 2007-04-09 Paolo Carlini <pcarlini@suse.de>
5234 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
5236 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
5238 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
5240 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
5241 * tree.c (cp_add_pending_fn_decls): Remove.
5242 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
5244 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
5246 Revert change removing staticp.
5248 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
5250 * cp-objcp-common.c (cxx_staticp): Remove.
5251 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
5252 * cp-tree.h (cxx_staticp):
5254 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
5256 * class.c (check_for_override): Don't remove dllmport attribute
5259 2007-04-03 Jakub Jelinek <jakub@redhat.com>
5262 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
5263 type issue error and return early.
5265 2007-03-30 Jason Merrill <jason@redhat.com>
5268 * typeck.c (cp_type_readonly): New fn.
5269 * cp-tree.h: Declare it.
5270 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
5271 (cp_finish_decl): Not here.
5273 2007-03-31 Richard Guenther <rguenther@suse.de>
5275 * optimize.c (maybe_clone_body): Replace splay-tree usage by
5278 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
5283 * parser.c (declarator_can_be_parameter_pack): New.
5284 (cp_parser_template_parameter): Only parse the `...' if the
5285 declarator can be a parameter pack.
5286 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
5288 * pt.c (find_parameter_packs_r): Look into the bounds on integer
5289 types (they could be used as array bounds).
5290 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
5291 (tsubst_pack_expansion): Handle failure to expand parameter
5294 2007-03-30 Paolo Carlini <pcarlini@suse.de>
5297 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
5298 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
5299 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
5300 (CLASS_TYPE_NON_UNION_P): Add.
5301 (struct lang_type_class): Add has_complex_dflt.
5302 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
5303 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
5304 * cp-tree.def: Add TRAIT_EXPR.
5305 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
5306 * lex.c (struct resword): Add __has_nothrow_assign,
5307 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
5308 __has_trivial_constructor, __has_trivial_copy,
5309 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
5310 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
5311 __is_pod, __is_polymorphic, __is_union.
5312 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
5313 (cp_parser_trait_expr): New.
5314 * semantics.c (finish_trait_expr, trait_expr_value
5315 classtype_has_nothrow_copy_or_assign_p): New.
5316 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
5318 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
5319 * class.c (check_bases, check_field_decl, check_bases_and_members):
5320 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
5321 * pt.c (uses_template_parms, tsubst_copy_and_build,
5322 value_dependent_expression_p, type_dependent_expression_p): Deal with
5324 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
5326 2007-03-29 Richard Guenther <rguenther@suse.de>
5328 * tree.c (cp_walk_subtrees): Do not set input_location.
5330 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
5333 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
5336 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5338 * parser.c (struct cp_parser): Update comment for
5339 greater_than_is_operator_p.
5340 (cp_parser_primary_expression): In C++0x mode, a cast operator can
5341 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
5342 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
5343 !GREATER_THAN_IS_OPERATOR_P.
5344 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
5345 `>>' operators that will become two `>' tokens in C++0x.
5346 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
5347 mode, allowing it to terminate default arguments.
5348 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
5349 `>>' like two consecutive `>' tokens.
5350 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
5351 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
5352 ends a template argument.
5354 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5356 * decl.c (redeclaration_error_message): Complain when redeclaring
5357 a friend function with default template arguments (C++0x mode only).
5358 * cp-tree.h (check_default_tmpl_args): Declare.
5359 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
5360 template arguments in function templates. Add support for checking
5361 the default template arguments of friend templates.
5362 (push_template_decl_real): Fix call to check_default_tmpl_args.
5363 (type_unification_real): If a template parameter has not been
5364 deduced but provides a default template argument, substitute into
5365 that default template argument.
5366 * parser.c (cp_parser_init_declarator): When declaring (but not
5367 defining!) a function template in C++0x mode, check for default
5370 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5373 * decl.c (grokdeclarator): Deal with cv-qualified function type
5374 typedefs in the same way for member and non-member functions.
5376 2007-03-26 Dirk Mueller <dmueller@suse.de>
5378 * parser.c (cp_parser_member_declaration): Pedwarn
5379 about stray semicolons after member declarations.
5381 2007-03-26 Paolo Carlini <pcarlini@suse.de>
5384 * pt.c (instantiate_decl): Set in_system_header.
5386 2007-03-22 Mark Mitchell <mark@codesourcery.com>
5388 * cp-tree.h (current_tempalte_parms): Improve documentation.
5389 * pt.c (current_template_args): Likewise.
5392 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
5393 not consume tokens when failing.
5395 2007-03-22 Jim Wilson <wilson@specifix.com>
5396 Mark Mitchell <mark@codesourcery.com>
5399 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
5400 consistent with FROM.
5402 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
5404 * error.c (dump_expr): Handle dependent names that designate types.
5405 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
5407 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
5409 * cp-tree.def, parser.c, pt.c: Fix comment typos.
5411 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5413 * cvt.c (cp_convert_and_check) : Define.
5414 * cp-tree.h (cp_convert_and_check): Declare.
5415 * call.c (convert_conversion_warnings): Rename to
5416 conversion_null_warnings. The warning for floating-point to
5417 integer is handled by convert_and_check in convert_like_real.
5418 (convert_like_real): convert_conversion_warnings was renamed as
5419 conversion_null_warnings.
5420 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
5421 overflow and changes of value during conversion.
5423 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5426 * parser.c (cp_parser_statement): If 'namespace' is found, this
5427 only can be a namespace alias definition, so parse it now.
5428 (cp_parser_namespace_alias_definition): if we find an open brace
5429 instead of '=', then this is actually a misplaced namespace
5432 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5435 * decl.c (cxx_init_decl_processing): Move command-line options
5436 processing to c-opts.c.
5438 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
5440 * ptree.c (cxx_print_type): Use formatting markup for integers
5441 when printing template parameter index/level/orig level.
5442 (cxx_print_xnode): Ditto.
5443 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
5444 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
5445 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
5447 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
5448 rather than a HOST_WIDE_INT.
5449 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
5450 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
5452 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
5453 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
5454 IN_BASE_INITIALIZER bool bitfields.
5455 (struct cp_declarator): Make KIND a 4-bit field. Make
5456 PARAMETER_PACK_P a bool bitfield just after KIND.
5457 * pt.c (uses_parameter_packs): Destroy the pointer set.
5458 (make_pack_expansion): Ditto.
5459 (check_for_bare_parameter_packs): Ditto.
5460 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
5462 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
5465 * call.c (convert_default_arg): Instead of copying the node,
5468 2007-03-15 Dirk Mueller <dmueller@suse.de>
5471 * call.c (convert_conversion_warnings): New..
5472 (convert_like_real): .. factored out from here.
5473 (convert_conversion_warnings): Add warning about
5474 false being converted to NULL in argument passing.
5476 2007-03-14 Dirk Mueller <dmueller@suse.de>
5478 * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
5479 (finish_do_body): Warn about empty body in do/while statement.
5481 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5483 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
5485 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5488 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
5491 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
5493 * repo.c (init_repo): Initialize random_seed saved options.
5494 (finish_repo): Adjust.
5496 2007-03-13 Mark Mitchell <mark@codesourcery.com>
5499 * Make-lang.in (doc/g++.1): Use $< to specify the location from
5502 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
5504 * decl.c (compute_array_index_type): New warning flag warn_vla.
5506 2007-03-12 Mark Mitchell <mark@codesourcery.com>
5509 * call.c (convert_default_arg): Copy non-constant arguments.
5511 2007-03-11 Mark Mitchell <mark@codesourcery.com>
5514 * parser.c (cp_parser_postfix_expression): Disallow compound
5515 literals in constant expressions.
5518 * semantics.c (finish_typeof): Use unlowered_expr_type.
5520 2007-03-10 Mark Mitchell <mark@codesourcery.com>
5523 * cp-tree.h (unlowered_expr_type): New function.
5524 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
5525 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
5526 (unlowered_expr_type): New function.
5527 (build_unary_op): Disallow predecrements of bool bitfields.
5528 * call.c (build_conditional_expr): Use unlowered_expr_type.
5529 * pt.c (type_unification_real): Likewise.
5531 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
5534 * typeck.c (check_return_expr): Check for bare parameter packs.
5535 (comptypes): Compare template parameter packs and
5536 type pack expansions.
5537 * decl.c (grokdeclarator): Deal with the declaration of function
5539 (grokparms): Verify that the (optional) function parameter pack is
5540 at the end of the parameter list.
5541 (xref_basetypes): Handle pack expansions in the base class.
5542 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
5543 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
5544 (NONTYPE_ARGUMENT_PACK): New.
5545 (TYPE_PACK_EXPANSION): New.
5546 (EXPR_PACK_EXPANSION): New.
5547 (ARGUMENT_PACK_SELECT): New.
5548 * cp-objcp-common.c (cp_tree_size): Compute size of
5549 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
5550 ARGUMENT_PACK_SELECT.
5551 * error.c (dump_template_argument): Print template argument packs.
5552 (dump_template_argument_list): Ditto.
5553 (dump_template_parameter): Dump `...' for template type parameter
5555 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
5556 (dump_parameters): Print function parameter packs.
5557 (dump_template_parms): Print template argument packs.
5558 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
5559 (maybe_warn_variadic_templates): New.
5560 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
5561 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
5562 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
5564 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
5565 (write_template_arg): Write argument packs as separate arguments.
5566 * cp-tree.h (struct template_parm_index_s): Add flag that
5567 indicates that the template parameter is actually a parameter
5569 (struct tree_argument_pack_select): New.
5570 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
5571 (union lang_tree_node): Add argument_pack_select.
5572 (FUNCTION_PARAMETER_PACK_P): New.
5573 (PACK_EXPANSION_P): New.
5574 (PACK_EXPANSION_PATTERN): New.
5575 (SET_PACK_EXPANSION_PATTERN): New.
5576 (PACK_EXPANSION_PARAMETER_PACKS): New.
5577 (ARGUMENT_PACK_P): New.
5578 (ARGUMENT_PACK_ARGS): New.
5579 (SET_ARGUMENT_PACK_ARGS): New.
5580 (ARGUMENT_PACK_INCOMPLETE_P): New.
5581 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
5582 (TEMPLATE_PARM_PARAMETER_PACK): New.
5583 (TEMPLATE_TYPE_PARAMETER_PACK): New.
5584 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
5585 (ARGUMENT_PACK_SELECT_INDEX): New.
5586 (ARGUMENT_PACK_SELECT_ARG): New.
5587 (struct cp_declarator): Add parameter_pack_p flag.
5588 (maybe_warn_variadic_templates): Declare.
5589 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
5590 indicate a template parameter pack.
5591 (uses_parameter_packs): Declare.
5592 (template_parameter_pack_p): Declare.
5593 (template_parms_variadic_p): Declare.
5594 (make_pack_expansion): Declare.
5595 (check_for_bare_parameter_packs): Declare.
5596 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
5597 sizeof... expressions.
5598 (pp_cxx_expression): Print pack expansions and non-type argument
5600 (pp_cxx_exception_specification): Print pack expansions.
5601 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
5602 (pp_cxx_ctor_initializer): Print pack expansions.
5603 (pp_cxx_type_id): Print pack expansions.
5604 (pp_cxx_template_argument_list): Print argument packs.
5605 (pp_cxx_template_parameter): Print ellipsis for template parameter
5607 * pt.c (comp_template_parms): Compare template parameter packs.
5608 (template_parameter_pack_p): New.
5609 (template_parms_variadic_p): New.
5610 (template_args_variadic_p): New.
5611 (make_ith_pack_parameter_name): New.
5612 (struct find_parameter_pack_data): New.
5613 (find_parameter_packs_r): New.
5614 (uses_parameter_packs): New.
5615 (make_pack_expansion): New.
5616 (check_for_bare_parameter_packs): New.
5617 (expand_template_argument_pack): New.
5618 (reduce_template_parm_level): Propagate parameter pack flag.
5619 (process_template_parm): Add is_parameter_pack parameter to state
5620 when the parameter is actually a parameter pack. Create template
5621 parameter packs when is_parameter_pack is true.
5622 (current_template_args): The argument for a template parameter
5623 pack is an argument pack containing a single pack expansion.
5624 (process_partial_specialization): When checking that non-type
5625 argument expressions do not involve template parameters, loop over
5626 the arguments in argument packs separately.
5627 (push_template_decl_real): Check that the type of the declaration
5628 does not have any bare parameter packs. Check that primary
5629 templates have no more than one parameter pack, and that it comes
5630 at the end of the template parameter list.
5631 (convert_template_argument): Handle coercions for pack expansion
5632 expressions by coercing the pattern then rebuilding the expansion.
5633 (coerce_template_parms): When coercing the arguments for a
5634 variadic template, pack "extra" arguments into an argument pack.
5635 (coerce_template_template_parms): Cannot coerce between parameter
5636 packs and non-pack parameters.
5637 (template_args_equal): Compare PACK_EXPANSION_P expressions.
5638 (comp_template_args): Expand all template arguments packs before
5639 comparing template argument lists.
5640 (mangle_class_name_for_template): Make argument packs as separate
5642 (for_each_template_parm_r): No need to handle BASELINK.
5643 (instantiate_class_template): Handle pack expansions in the base
5645 (tsubst_pack_expansion): New.
5646 (tsubst_template_args): Handle substitutions of argument packs and
5647 pack expansion into template argument lists.
5648 (tsubst_decl): Expand function parameter packs into separate
5649 function parameters.
5650 (tsubst_arg_types): Expand a type pack expansion into separate
5652 (tsubst_exception_specification): Handle pack expansions in
5653 exception specifiers.
5654 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
5655 replacing a template parameter with its argument. If we encounter
5656 a substitution for an argument pack, just return the parameter
5658 (tsubst_copy): sizeof(X...) returns the number of elements in
5659 parameter pack X. See through ARGUMENT_PACK_SELECT when the
5660 PARM_DECL is a parameter pack.
5661 (tsubst_expr): Expression pack expansions and argument packs
5662 cannot show up here; they will all be handled through function
5663 calls, sizeof, and template argument lists.
5664 (tsubst_copy_and_build): sizeof(X...) returns the number of
5665 elements in parameter pack X. Handle pack expansions in TREE_LIST
5666 and CONSTRUCTOR nodes.
5667 (fn_type_unification): Handle "incomplete" explicit template
5668 argument lists that specify some of the arguments for a template
5670 (type_unification_real): Unify arguments against pack expansions.
5671 (template_parm_level_and_index): New, helper function.
5672 (unify_pack_expansion): New.
5673 (unify): Unify argument packs on an argument-by-argument basis,
5674 handling variadic argument packs as well.
5675 (more_specialized_fn): Handle unification of function parameter
5676 packs. All things being equal, prefer non-variadic function
5677 templates to variadic function templates.
5678 (more_specialized_class): Prefer the variadic class template
5679 partial specialization that binds fewer arguments to a parameter
5681 (regenerate_decl_from_template): Expand function parameter packs
5682 into separate parameters.
5683 (instantiate_decl): Ditto.
5684 (tsubst_initializer_list): Handle pack expansions for base-class
5686 (dependent_type_p_r): Determine dependent types in argument packs
5687 and pack expansions.
5688 (value_dependent_expression_p): Determine value-dependence of
5689 non-type argument packs.
5690 (dependent_template_arg_p): Handle argument packs.
5691 * semantics.c (finish_cond): Check for bare parameter packs.
5692 (finish_expr_stmt): Ditto.
5693 (finish_for_expr): Ditto.
5694 (finish_switch_cond): Ditto.
5695 (finish_mem_initializers): Ditto.
5696 * name-lookup.c (arg_assoc_type): Handle pack expansions and
5698 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
5699 * parser.c (make_declarator): Declarator is not an expansion.
5700 (make_pointer_declarator): Transfer parameter pack flag to outer
5702 (make_reference_declarator): Ditto.
5703 (make_ptrmem_declarator): Ditto.
5704 (make_call_declarator): Ditto.
5705 (make_array_declarator): Ditto.
5706 (cp_parser_postfix_expression): Allow pack expansion expressions
5707 in the argument list for a call expression.
5708 (cp_parser_parenthesized_expression_list): Add new parameter
5709 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
5710 into separate arguments."
5711 (cp_parser_new_placement): Allow pack expansion expressions.
5712 (cp_parser_new_initializer): Ditto.
5713 (cp_parser_mem_initializer_list): Allow ellipsis to create a
5714 base-class initializer expansion.
5715 (cp_parser_mem_initializer): Ditto.
5716 (cp_parser_template_parameter_list): Keep track of whether the
5717 template parameter is a template parameter pack.
5718 (cp_parser_template_parameter): Parse the ellipsis to indicate a
5719 template parameter pack.
5720 (cp_parser_type_parameter): Ditto.
5721 (cp_parser_template_argument_list): Parse the ellipsis to indicate
5723 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
5724 this declarator is a parameter pack.
5725 (cp_parser_parameter_declaration): The ellipsis does not end the
5726 parameter declaration, because it might be a parameter pack. Parse
5727 the ellipsis to indicate a parameter pack.
5728 (cp_parser_initializer): Allow pack expansions.
5729 (cp_parser_initializer_list): Allow ellipsis to create an
5730 initializer expansion.
5731 (cp_parser_base_clause): Allow ellipsis to create a base specifier
5733 (cp_parser_type_id_list): Allow ellipsis to create an exception
5734 specifier expansion.
5735 (cp_parser_attribute_list): Don't allow pack expansions.
5736 (cp_parser_functional_cast): Allow pack expansions.
5737 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
5738 compute the length of a parameter pack.
5739 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
5740 end a template argument.
5741 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
5742 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
5745 2007-03-09 Dirk Mueller <dmueller@suse.de>
5747 * call.c (build_new_op): Call warn_logical_operator.
5749 2007-03-08 Volker Reichelt <v.reichelt@netcologne.de>
5752 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
5755 * pt.c (any_template_arguments_need_structural_equality_p):
5758 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
5760 * decl.c (grokdeclarator): Disable warnings for anonymous
5763 2007-03-05 Volker Reichelt <v.reichelt@netcologne.de>
5765 * typeck2.c (readonly_error): Always emit a hard error.
5766 Remove last argument.
5767 * cp-tree.h (readonly_error): Adjust prototype.
5768 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
5769 * typeck.c (build_unary_op): Likewise.
5770 (build_modify_expr): Likewise.
5772 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
5775 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
5777 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5780 * parser.c (struct cp_parser): New IN_IF_STMT.
5781 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
5782 returning if parsing the body of an 'if' statement or issuing an
5783 error and continuing.
5784 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
5786 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
5788 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
5791 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
5794 2007-03-02 Geoffrey Keating <geoffk@apple.com>
5796 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
5797 Objective-C++. Don't exit early if -shared-libgcc needs to be
5800 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5802 * typeck.c (common_base_type): Delete unused function.
5804 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5806 * Make-lang.in: Add dummy lang.install-pdf target.
5808 2007-03-01 Simon Baldwin <simonb@google.com>
5811 * decl.c (check_tag_decl): Added new warning for typedef ignored
5812 when it precedes an otherwise valid non-typedef declaration.
5814 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
5816 * typeck.c (build_function_call): Store converted arguments
5817 in a stack-allocated array instead of building a list.
5818 (convert_arguments): Store arguments in the array passed in as an
5819 argument, and return the actual number of arguments.
5820 * call.c (build_call): Delete, and replace with...
5821 (build_call_n, build_call_a): New.
5822 (build_op_delete_call): Rewrite to avoid constructing argument lists.
5823 (build_over_call): Store converted arguments in a stack-allocated
5824 array instead of building a list.
5825 (build_cxx_call): Pass arguments in an array instead of as a list.
5826 (build_java_interface_fn_ref): Rewrite to avoid constructing
5828 * tree.h: Update declarations to reflect above changes.
5829 * method.c (use_thunk): Use a stack-allocated array to hold
5830 the arguments instead of a list.
5831 * rtti.c (throw_bad_cast): Update call to cxx_call.
5832 (throw_bad_typeid): Likewise.
5833 (build_dynamic_cast_1): Likewise.
5834 * init.c (build_builtin_delete_call): Use build_call_n.
5835 * decl.c (expand_static_init): Likewise.
5836 * except.c (cp_protect_cleanup_actions): Likewise.
5837 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
5838 (gimplify_must_not_throw_expr): Likewise.
5839 (cxx_omp_apply_fn): Use build_call_a.
5841 2007-02-26 Mark Mitchell <mark@codesourcery.com>
5843 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
5844 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
5846 2007-02-25 Mark Mitchell <mark@codesourcery.com>
5848 * cp-tree.h (static_ctors): Remove.
5849 * cp-tree.h (static_dtors): Likewise.
5850 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
5851 refactoring of tree_map hierarchy.
5852 (decl_shadowed_for_var_insert): Likewise.
5853 * semantics.c (expand_body): Use c_expand_body.
5854 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
5855 * decl2.c (static_ctors): Remove.
5856 (static_dtors): Likewise.
5857 (generate_ctor_or_dtor_function): Pass NULL_TREE to
5858 objc_generate_static_init_call. Do not call static_[cd]tors.
5859 (generate_ctor_and_dtor_functions_for_priority): Do not check for
5861 (cp_write_global_declarations): Likewise.
5863 2007-02-23 Richard Guenther <rguenther@suse.de>
5865 * class.c (note_name_declared_in_class): Make declaration
5866 changes meaning a pedwarn.
5868 2007-02-22 Michael Matz <matz@suse.de>
5871 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
5872 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
5873 dump_function_decl): Guard emitting outer scopes by new flag.
5874 * cp-lang.c (cxx_dwarf_name): New function.
5875 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
5876 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
5878 (push_template_decl_real, lookup_template_class): Remove calls
5881 2007-02-19 Mark Mitchell <mark@codesourcery.com>
5883 * call.c (build_new_method_call): Ensure that explicit calls of
5884 destructors have type "void".
5886 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5888 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
5889 and -Walways-true with -Waddress.
5890 * cvt.c (convert_to_void): Replace unconditional warning with
5893 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
5895 * decl.c, tree.c: Fix comment typos.
5897 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
5900 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
5901 statement expression if we had an error mark node.
5903 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
5904 Brooks Moses <brooks.moses@codesourcery.com>
5905 Lee Millward <lee.millward@codesourcery.com>
5907 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
5908 Change class to tcc_vl_exp.
5910 * call.c (build_call): Use build_call_list instead
5912 (build_over_call): Likewise.
5913 (build_new_method_call): Use build_min_non_dep_call_list
5914 instead of build_min_non_dep.
5916 * error.c (dump_call_expr_args): New function.
5917 (dump_aggr_init_expr_args): New function.
5918 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
5919 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
5921 * cvt.c (convert_to_void): Use build_call_array instead
5922 of build3; use new AGGR_INIT_EXPR accessor macros.
5924 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
5925 instead of TREE_CODE_LENGTH.
5927 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
5928 AGGR_INIT_EXPR accessor macros.
5930 * cp-gimplify.c (cp_gimplify_init_expr): Use
5931 AGGR_INIT_EXPR_SLOT to set the slot operand.
5933 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
5934 (AGGR_INIT_EXPR_SLOT): New macro.
5935 (AGGR_INIT_EXPR_ARG): New macro.
5936 (aggr_init_expr_nargs): New macro.
5937 (AGGR_INIT_EXPR_ARGP): New macro.
5938 (aggr_init_expr_arg_iterator): New.
5939 (init_aggr_init_expr_arg_iterator): New.
5940 (next_aggr_init_expr_arg): New.
5941 (first_aggr_init_expr_arg): New.
5942 (more_aggr_init_expr_args_p): New.
5943 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
5944 (stabilize_aggr_init): New declaration.
5945 (build_min_non_dep_call_list): Likewise.
5947 * tree.c (process_aggr_init_operands): New function.
5948 (build_aggr_init_array) New function.
5949 (build_cplus_new): Update to use new CALL_EXPR and
5950 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
5951 build_aggr_init_array.
5952 (build_min_non_dep_call_list) New function.
5953 (build_min_nt): Assert input code parameter is not a variable
5954 length expression class.
5955 (build_min, build_min_non_dep): Likewise.
5956 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
5957 to check for equality instead of recursing. Handle tcc_vl_exp
5959 (stabilize_call): Update to only handle CALL_EXPRs, not
5960 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
5961 (stabilize_aggr_init): New function.
5962 (stabilize_init): Use it.
5964 * cxx-pretty-print.c (pp_cxx_postfix_expression)
5965 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
5966 AGGR_INIT_EXPR accessor macros and argument iterators.
5968 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
5969 build_vl_exp. Iterate through the operands, recursively
5970 processing each one.
5971 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
5972 CALL_EXPR accessor macros.
5973 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
5974 tree code classes. Use TREE_OPERAND_LENGTH instead of
5977 * semantics.c (finish_call_expr): Use build_nt_call_list
5978 instead of build_nt.
5979 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
5980 accessor macros. Use build_call_array to construct the
5981 CALL_EXPR node instead of build3
5983 * decl2.c (build_offset_ref_call_from_tree): Use
5984 build_nt_call_list and build_min_non_dep_call_list instead
5985 of build_min_nt and build_min_non_dep.
5987 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
5988 Use build_nt_call_list instead of build_min_nt.
5990 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5993 * call.c (build_conditional_expr): Improve error message.
5995 2007-02-13 Dirk Mueller <dmueller@suse.de>
5997 * friend.c (do_friend): Annotate warning about friend
5998 declarations in templates with OPT_Wnon_template_friend.
5999 Convert informal message from warning() to inform().
6001 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
6002 Mark Mitchell <mark@codesourcery.com>
6005 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
6006 instantiations for variables.
6008 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6011 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
6012 Check warn_unused_value just once.
6014 2007-02-11 Mark Mitchell <mark@codesourcery.com>
6017 * pt.c (determine_specialization): Use skip_artificial_parms_for.
6018 (fn_type_unificiation): Likewise.
6019 (get_bindings): Likewise.
6021 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
6024 * decl.c (finish_function): Use DECL_REPLACEABLE.
6025 * tree.c (cp_cannot_inline_tree_fn): Likewise.
6027 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
6029 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
6031 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
6033 * decl.c (grokvardecl): Don't error if !have_tls.
6034 (grokdeclarator): Likewise.
6035 * parser.c (cp_parser_omp_threadprivate): Likewise.
6037 2007-02-07 Jakub Jelinek <jakub@redhat.com>
6040 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
6041 parameters and result decls in omp clauses.
6042 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
6045 2007-02-05 Dirk Mueller <dmueller@suse.de>
6048 * parser.c (cp_parser_class_specifier): Always initialize bases.
6050 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
6052 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
6053 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
6054 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
6056 * semantics.c (finish_omp_atomic): Store a whole expression node
6057 in operand 1, and integer_zero_node in operand 0, for dependent
6058 OMP_ATOMIC. Rewrite to make flow easier to understand.
6060 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
6062 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
6064 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
6066 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
6067 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
6069 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
6071 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
6072 keyword warning to -Wc++0x-compat.
6074 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
6076 * decl.c (grokdeclarator): Update documentation.
6078 2007-02-02 Jakub Jelinek <jakub@redhat.com>
6081 * decl.c (grokdeclarator): If __thread is used together with
6082 a storage class other than extern and static, clear thread_p
6083 after issuing diagnostics and fall through to checking the
6086 2007-01-30 Roger Sayle <roger@eyesopen.com>
6088 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
6089 calculating the size of an array (to avoid recursive errors).
6091 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6094 * typeck.c (build_binary_op): Fix logic for warning. Move warning
6096 * call.c (convert_like_real): Don't warn when converting to
6099 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6101 * decl.c (pop_label): Replace warning with call to
6102 warn_for_unused_label.
6104 2007-01-28 Andrew Pinski <pinskia@gmail.com>
6107 * semantics.c (finish_pseudo_destructor_expr): Check the
6108 destrutor name by calling check_dtor_name.
6110 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
6112 * lex.c (D_CPP0X): Rename.
6114 (reswords): D_CPP0X -> D_CXX0X.
6115 (init_reswords): Ditto.
6116 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
6117 of C++0x keywords as identifiers.
6119 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
6122 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
6125 2007-01-23 Ian Lance Taylor <iant@google.com>
6127 * typeck.c (convert_for_assignment): Only warn about a = b = c
6128 when converting to bool.
6130 2007-01-23 Roger Sayle <roger@eyesopen.com>
6132 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
6134 * typeck.c (ignore_overflows): Remove the remaining uses of
6135 TREE_CONSTANT_OVERFLOW.
6137 2007-01-20 Jan Hubicka <jh@suse.cz>
6139 * decl2.c (start_objects, start_static_storage_duration_function):
6140 Do not make the functions uninlinable.
6142 2007-01-17 Ian Lance Taylor <iant@google.com>
6144 * class.c (add_method): Call VEC_reserve_exact rather than passing
6145 a negative size to VEC_reserve.
6147 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
6150 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
6152 2007-01-10 Mark Mitchell <mark@codesourcery.com>
6155 * decl.c (make_typename_type): If the qualified name is not a
6156 type, issue an error.
6157 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
6160 2007-01-08 Geoffrey Keating <geoffk@apple.com>
6162 * rtti.c: Include target.h.
6163 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
6164 don't emit typeinfo for fundamental types as weak.
6165 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
6167 2007-01-08 Richard Guenther <rguenther@suse.de>
6169 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
6171 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
6173 * call.c (standard_conversion): Pass flag to
6174 vector_types_convertible_p to disallow emission of note.
6175 * typeck.c (convert_for_assignment): Pass flag to
6176 vector_types_convertible_p to allow emission of note.
6177 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
6178 to disallow emission of note.
6180 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6183 * typeck.c (build_binary_op): Call overflow_warning if
6184 TREE_OVERFLOW_P is true for the result and not for any of the
6187 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
6190 * class.c (add_method): Don't wait until template
6191 instantiation time to complain about duplicate methods.
6193 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6196 * semantics.c (finish_unary_op_expr): Warn only if result
6197 overflowed and operands did not.
6199 2007-01-05 Ian Lance Taylor <iant@google.com>
6201 * typeck.c (build_binary_op): Warn about comparing a non-weak
6204 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
6206 * pt.c (tsubst): Propagate the need for structural equality checks
6207 when reducing the level of template parameters.
6209 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
6211 * pt.c: Fix a comment typo.
6213 2007-01-02 Ian Lance Taylor <iant@google.com>
6215 * semantics.c (maybe_convert_cond): Optionally warn when using an
6216 assignment as a condition.
6217 * typeck.c (convert_for_assignment): Optionally warn about
6218 assigning the result of an assignment to a bool.
6220 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
6222 * pt.c (canonical_template_parms): Correct typo in comment.
6224 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
6226 * typeck.c (structural_comptypes): Renamed from "comptypes".
6227 (comptypes): Use canonical type information to perform fast type
6228 comparison. When VERIFY_CANONICAL_TYPES, verify that the
6229 canonical type comparison returns the same results as we would see
6230 from the current, structural check. Support COMPARE_STRUCTURAL
6231 when we need structural checks.
6232 * decl.c (typename_compare): Fix comment.
6233 (build_typename_type): TYPENAME_TYPE nodes require structural
6234 equality checks, because they resolve different based on the
6236 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
6237 require structural equality checks (for now).
6238 (build_ptrmemfunc_type): Build the canonical pointer to member
6240 (compute_array_index_type): Whenever we build a new index type
6241 to represent the size of an array in a template, we need to mark
6242 this index type as requiring structural equality. This goes for
6243 arrays with value-dependent sizes with the current ABI, or all
6245 * tree.c (cplus_array_hash): New.
6246 (struct cplus_array_info): New.
6247 (cplus_array_compare): New.
6248 (cplus_array_htab): New.
6249 (build_cplus_array_type_1): Use a hash table to cache the array
6250 types we build. Build the canonical array type for each array
6252 (cp_build_qualified_type_real): When building a cv-qualified array
6253 type, use the hash table of array types and build canonical array
6255 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
6256 use structural equality (for now).
6257 * cp-tree.h (COMPARE_STRUCTURAL): New.
6258 * pt.c (canonical_template_parms): New.
6259 (canonical_type_parameter): New.
6260 (process_template_parm): Find the canonical type parameter.
6261 (lookup_template_class): When we have named the primary template
6262 type, set the canonical type for our template class to the primary
6263 template type. If any of the template arguments need structural
6264 equality checks, the template class needs structural equality
6266 (tsubst): When reducing the level of a template template
6267 parameter, we require structural equality tests for the resulting
6268 parameter because its template parameters have not had their types
6269 canonicalized. When reducing a template type parameter, find the
6270 canonical reduced type parameter.
6271 (any_template_arguments_need_structural_equality_p): New.