1 2009-11-19 Jason Merrill <jason@redhat.com>
4 * class.c (build_self_reference): Call set_underlying_type.
5 * decl.c (check_elaborated_type_specifier): Don't complain about
7 (type_is_deprecated): Use TYPE_MAIN_VARIANT.
8 * pt.c (convert_template_argument): Handle injected-class-name used
9 as template template argument.
10 * typeck2.c (abstract_virtuals_error): Use TYPE_MAIN_VARIANT.
13 * decl.c (static_fn_type): Split out...
14 (revert_static_member_fn): ...from here.
15 * cp-tree.h: Declare it.
16 * class.c (resolve_address_of_overloaded_function): Use it to compare
17 pointers to member functions.
18 * typeck.c (build_static_cast_1): Call instantiate_type.
20 2009-11-18 Shujing Zhao <pearly.zhao@oracle.com>
23 * error.c (maybe_warn_cpp0x): Accept enum cpp0x_warn_str as argument.
24 (maybe_warn_variadic_templates): Update the maybe_warn_cpp0x calls to
25 match the new declaration.
26 * cp-tree.h (cpp0x_warn_str): New type.
27 (maybe_warn_cpp0x): Adjust prototype with new argument.
28 * call.c (reference_binding): Update the maybe_warn_cpp0x calls.
29 * decl.c (reshape_init_r, check_initializer, grokdeclarator):
31 * parser.c (cp_parser_primary_expression)
32 (cp_parser_parenthesized_expression_list, cp_parser_new_initializer)
33 (cp_parser_assignment_expression, cp_parser_condition)
34 (cp_parser_jump_statement, cp_parser_mem_initializer)
35 (cp_parser_simple_type_specifier, cp_parser_elaborated_type_specifier)
36 (cp_parser_enum_specifier, cp_parser_initializer)
37 (cp_parser_pure_specifier, cp_parser_functional_cast): Likewise.
39 2009-11-18 Jakub Jelinek <jakub@redhat.com>
42 * cp-tree.h (expand_or_defer_fn_1): New prototype.
43 * decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL
44 also all same_body aliases.
45 * semantics.c (expand_or_defer_fn): Move most of the function
46 except registering with cgraph to ...
47 (expand_or_defer_fn_1): ... here. New function.
48 * optimize.c: Include cgraph.h.
49 (maybe_clone_body): If in charge parm is not used and both base
50 and complete clones are created and are not comdat, tell cgraph
51 they have the same body.
52 * Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H).
54 2009-11-17 Paolo Carlini <paolo.carlini@oracle.com>
57 * typeck2.c (digest_init_r): Check init for error_operand_p.
58 * decl.c (reshape_init_class): Check return value of reshape_init_r
61 2009-11-17 Jakub Jelinek <jakub@redhat.com>
64 * call.c (reference_binding): Return NULL for initializer list with
65 error operand inside of it.
68 * typeck.c (cp_build_modify_expr): For initializer list call
69 check_array_initializer to make sure lhs isn't a VLA.
71 2009-11-16 Jason Merrill <jason@redhat.com>
73 PR c++/189, c++/9937, c++/13950, DR 176
74 * search.c (lookup_field_r): Allow lookup to find the
75 injected-class-name from a template base.
76 (template_self_reference_p): Remove.
77 * decl.c (make_typename_type): Diagnose ambiguity. Use
78 maybe_get_template_decl_from_type_decl.
79 * parser.c (cp_parser_template_name): Pass true to is_template
80 rather than use maybe_get_template_decl_from_type_decl.
81 (cp_parser_lookup_name): Use maybe_get_template_decl_from_type_decl.
82 * pt.c (maybe_get_template_decl_from_type_decl): Handle ambiguity.
83 Use DECL_SELF_REFERENCE_P.
85 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
86 Avoid duplicate ambiguity error.
87 * error.c (dump_decl): Don't say "typedef" for injected-class-name.
88 * pt.c (convert_template_argument): Tweak logic.
90 2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
93 * pt.c (determine_specialization): Assign to candidates the return
94 value of the chainon called before print_candidates.
96 2009-11-16 Paolo Carlini <paolo.carlini@oracle.com>
99 * decl.h (enum decl_context): Add TPARM enumerator.
100 * decl.c (grokdeclarator): Per 14.1/2, error out if a storage class
101 is specified in a template parameter declaration.
102 * parser.c (cp_parser_template_parameter): Call grokdeclarator with
103 TPARM as third argument.
105 2009-11-13 Jason Merrill <jason@redhat.com>
109 * pt.c (expand_template_argument_pack): Handle null arg gracefully.
110 (convert_template_argument): Use %T for type.
113 * decl.c (create_implicit_typedef): Set TYPE_STUB_DECL here.
114 (cxx_init_decl_processing): Not here.
115 * name-lookup.c (pushtag): Or here.
116 * pt.c (lookup_template_class): Or here.
119 * pt.c (convert_nontype_argument): Give helpful error about
120 reference variable argument to reference template parameter.
123 * semantics.c (finish_non_static_data_member): Don't check
124 derivation in a template.
127 * parser.c (cp_parser_direct_declarator): Give helpful error about
128 trying to define member of a dependent typedef.
129 * pt.c (resolve_typename_type): Don't resolve a typedef typename.
130 * tree.c (typedef_variant_p): New.
131 * cp-tree.h: Declare it.
133 2009-11-12 Jason Merrill <jason@redhat.com>
136 * parser.c (cp_parser_primary_expression): Don't give a duplicate
140 * decl2.c (build_anon_union_vars): Set DECL_ARTIFICIAL.
143 * decl.c (grokdeclarator): Don't generate a void PARM_DECL.
146 * call.c (build_conditional_expr): Check specifically for folding
147 to CALL_EXPR rather than TREE_SIDE_EFFECTS.
149 * typeck.c (cv_qualified_p): New fn.
150 (decay_conversion): Use it.
151 * cp-tree.h: Declare it.
152 * tree.c (rvalue): Use it and cv_unqualified.
153 * init.c (build_aggr_init): Likewise.
156 * call.c (build_conditional_expr): Don't fold a TREE_SIDE_EFFECTS
157 COND_EXPR in unevaluated context.
159 2009-11-12 Jan Hubicka <jh@suse.cz>
161 * decl2.c (constrain_visibility): Clear WEAK and COMMON flags.
163 2009-11-11 Jason Merrill <jason@redhat.com>
166 * rtti.c (emit_support_tinfos): Add DFP types.
168 * call.c (build_op_delete_call): Downgrade error about
169 placement/non-placement confusion to permerror.
171 2009-11-10 Jason Merrill <jason@redhat.com>
173 * call.c (build_op_delete_call): Tweak error.
177 * call.c (non_placement_deallocation_fn_p): Split out...
178 (build_op_delete_call): ...from here. Use instantiate_type
179 for placement delete. Simplify logic.
180 * pt.c (primary_template_instantiation_p): Non-static.
181 * cp-tree.h: Declare it.
183 2009-11-09 Jason Merrill <jason@redhat.com>
186 * parser.c (cp_parser_template_argument): Accept SCOPE_REF around
190 * pt.c (tsubst_baselink): tsubst the name.
192 2009-11-07 Jason Merrill <jason@redhat.com>
195 * pt.c (tsubst) [TYPEOF_TYPE]: Set cp_unevaluated_operand.
199 * cp-tree.h (cp_decl_specifier_seq): Add any_type_specifiers_p.
200 * parser.c (cp_parser_single_declaration): Call
201 cp_parser_parse_and_diagnose_invalid_type_name here, too.
202 (cp_parser_parameter_declaration): And here.
203 (cp_parser_parse_and_diagnose_invalid_type_name): Be
204 less picky about declarator form. Don't skip to
205 the end of the block if we're in a declarator.
206 (cp_parser_decl_specifier_seq): Set any_type_specifiers_p.
207 (cp_parser_simple_declaration): Check it.
208 (cp_parser_member_declaration): Likewise.
209 (cp_parser_diagnose_invalid_type_name): Tweak error message.
210 (cp_parser_expression_statement): Likewise.
211 * decl2.c (grokfield): Mention decltype instead of typeof.
213 2009-11-06 Jason Merrill <jason@redhat.com>
216 * parser.c (cp_parser_check_template_parameters): Don't talk about
217 specialization at function scope.
218 (cp_parser_diagnose_invalid_type_name): Handle dependent scope.
219 (cp_parser_parse_and_diagnose_invalid_type_name): Likewise.
220 (cp_parser_expression_statement): Suggest typename.
221 * error.c (dump_decl) [SCOPE_REF]: Print the type here.
222 (dump_expr) [SCOPE_REF]: Call it.
223 (dump_type) [UNBOUND_CLASS_TEMPLATE]: Check TFF_UNQUALIFIED_NAME.
224 * cxx-pretty-print.c (pp_cxx_unqualified_id): Print class template
228 * decl2.c (build_memfn_type): Preserve attributes.
229 (cp_reconstruct_complex_type): Likewise.
230 (maybe_retrofit_in_chrg): Likewise.
231 * class.c (adjust_clone_args): Likewise.
232 * call.c (standard_conversion): Use build_memfn_type.
233 * pt.c (tsubst): Likewise.
234 * decl.c (build_ptrmem_type): Likewise
235 (check_function_type): Preserve attributes.
236 * tree.c (cp_build_type_attribute_variant): Propagate exception
237 specs on METHOD_TYPE, too.
238 (strip_typedefs): Preserve exception specs and attributes.
240 2009-11-06 Andrew Pinski <andrew_pinski@playstation.sony.com>
243 * optimize.c (maybe_clone_body): Copy DECL_ATTRIBUTES and
244 DECL_DISREGARD_INLINE_LIMITS also.
246 2009-11-06 Jakub Jelinek <jakub@redhat.com>
249 * parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly
250 nested loop and parsing statements, don't cp_parser_require }, instead
251 exit the loop if next token is CPP_EOF.
253 2009-11-05 Jason Merrill <jason@redhat.com>
256 * method.c (do_build_copy_constructor): Don't drop cv-quals from
260 * class.c (finish_struct): Store maximum_field_alignment in
262 * pt.c (instantiate_class_template): Set maximum_field_alignment.
265 * name-lookup.c (arg_assoc_class): Call complete_type.
266 * pt.c (instantiate_class_template): Call uses_template_parms
267 instead of dependent_type_p.
270 * pt.c (check_undeduced_parms): New subroutine of...
271 (more_specialized_fn): ...here. Undeduced template parms can make
272 a template less specialized than another.
274 2009-11-04 Jason Merrill <jason@redhat.com>
277 * search.c (lookup_base): Don't complete_type (base).
280 * method.c (use_thunk): Check DECL_WEAK as well as
284 * name-lookup.c (add_function): Ignore non-functions.
286 2009-11-03 Jason Merrill <jason@redhat.com>
289 * decl2.c (cxx_callgraph_analyze_expr): Don't reference a function
290 just because a static variable in it is needed unless -frepo.
293 * parser.c (cp_parser_type_specifier_seq): Rename is_condition to
295 (cp_parser_exception_declaration): Pass true.
296 (cp_parser_omp_for_loop): Likewise.
299 * typeck.c (build_x_binary_op): Don't do warn_parentheses
300 if we're in a SFINAE context.
303 * call.c (build_call_a): Strip cv-quals from rvalue result.
306 * call.c (initialize_reference): Add complain parm.
307 * typeck.c (convert_for_initialization): Pass it.
308 * decl.c (grok_reference_init): Likewise.
309 * cp-tree.h: Declare it.
312 * pt.c (do_auto_deduction): Diagnose inconsistent deduction.
314 2009-11-02 Dodji Seketeli <dodji@redhat.com>
317 * pt.c (check_valid_ptrmem_cst_expr): New function.
318 (convert_nontype_argument): Use it to output an error for
319 illegal pointer to member expressions used as template arguments.
321 2009-11-02 Jason Merrill <jason@redhat.com>
323 Restrict DR 757 change to C++0x mode.
324 * decl2.c (mark_used): Check cxx_dialect.
325 * decl.c (grokfndecl): Do check type linkage in C++98 mode.
326 (grokvardecl): Likewise.
327 * pt.c (check_instantiated_arg): Likewise.
329 2009-11-02 Jakub Jelinek <jakub@redhat.com>
332 * name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
334 * parser.c (cp_parser_namespace_definition): Pass 1 as argument to
336 * rtti.c (push_abi_namespace): Pass 2 as last argument to
338 (pop_abi_namespace): Pass 2 as argument to pop_visibility.
340 2009-10-31 Jason Merrill <jason@redhat.com>
342 * tree.c (cv_unqualified): New fn.
343 * cp-tree.h: Declare it.
344 * typeck.c (decay_conversion): Use it instead of TYPE_MAIN_VARIANT.
346 * rtti.c (tinfo_name): Fix lengths for private case.
348 2009-10-31 Jason Merrill <jason@redhat.com>
351 * call.c (compare_ics): Avoid bad union use when
352 comparing two ck_lists.
354 2009-10-30 Jerry Quinn <jlquinn@optonline.net>
356 * mangle.c (mangle_type_string_for_rtti): Reapply 153734.
357 (needs_fake_anon): Likewise.
358 (write_name): Likewise.
359 (write_nested_name): Likewise.
360 * cp-tree.h (mangle_type_string_for_rtti): Likewise.
361 (get_anonymous_namespace): Likewise.
362 * name-lookup.c (get_anonymous_namespace_name): Likewise.
363 * rtti.c (tinfo_name): Likewise, with +1 in the second
364 build_string call fixed.
365 (tinfo_base_init): Likewise.
367 2009-10-30 Jason Merrill <jason@redhat.com>
370 * decl.c (cp_fname_init): Correct build_string argument.
372 2009-10-30 Jerry Quinn <jlquinn@optonline.net>
374 * mangle.c (mangle_type_string_for_rtti): Revert 153734.
375 (needs_fake_anon): Likewise.
376 (write_name): Likewise.
377 (write_nested_name): Likewise.
378 * cp-tree.h (mangle_type_string_for_rtti): Likewise.
379 (get_anonymous_namespace): Likewise.
380 * name-lookup.c (get_anonymous_namespace_name): Likewise.
381 * rtti.c (tinfo_name): Likewise.
382 (tinfo_base_init): Likewise.
384 2009-10-30 Dodji Seketeli <dodji@redhat.com>
387 * pt.c (iterative_hash_template_arg): articifial parms
388 don't have DECL_PARM_INDEX set. Do not hash it.
390 2009-10-28 Jerry Quinn <jlquinn@optonline.net>
392 * mangle.c (mangle_type_string_for_rtti): Revert r149964.
393 (needs_fake_anon): Likewise.
394 (write_name): Likewise.
395 (write_nested_name): Likewise.
396 * cp-tree.h (mangle_type_string_for_rtti): Likewise.
397 (get_anonymous_namespace): Likewise.
398 * name-lookup.c (get_anonymous_namespace_name): Likewise.
399 * rtti.c (tinfo_name): Insert '*' in front of private names.
400 (tinfo_base_init): Use it.
402 2009-10-28 Jason Merrill <jason@redhat.com>
405 * name-lookup.c (set_decl_namespace): Deal properly with inline
407 (qualified_lookup_using_namespace): Overhaul.
408 * pt.c (print_candidates): Handle getting an OVERLOAD.
410 2009-10-28 Jason Merrill <jason@redhat.com>
412 * decl.c (cp_fname_init): Correct build_string argument.
414 2009-10-27 Jason Merrill <jason@redhat.com>
416 Allow no-capture lambdas to convert to function pointer.
417 * semantics.c (maybe_add_lambda_conv_op): New.
418 * parser.c (cp_parser_lambda_expression): Call it.
419 (cp_parser_lambda_declarator_opt): Make op() static if
421 * mangle.c (write_closure_type_name): Adjust.
422 * semantics.c (finish_this_expr): Adjust.
423 * decl.c (grok_op_properties): Allow it.
424 * call.c (build_user_type_conversion_1): Handle static conversion op.
425 (build_op_call): And op().
427 2009-10-26 Jakub Jelinek <jakub@redhat.com>
430 * cp-lang.c (cxx_dwarf_name): Return NULL instead of
431 <anonymous ...> for anonymous aggregate names.
433 2009-10-26 Jason Merrill <jason@redhat.com>
435 PR c++/38796, Core issue 906
436 * cp-tree.h (DECL_DEFAULTED_OUTSIDE_CLASS_P): New.
437 (DECL_DEFAULTED_IN_CLASS_P): New.
438 * class.c (user_provided_p): Non-static.
439 (check_methods): Use it.
440 (check_bases_and_members): Check defaulted fns.
441 (defaultable_fn_p): Move and rename to...
442 * method.c (defaultable_fn_check): ...this.
443 (defaulted_late_check): New.
444 * pt.c (tsubst_decl): Call it.
445 * decl2.c (grokfield): Adjust.
446 * decl.c (cp_finish_decl): Adjust.
447 (grok_special_member_properties): Use user_provided_p.
449 2009-10-26 Dodji Seketeli <dodji@redhat.com>
452 * pt.c (template_args_equal): Handle comparison of
453 an ARGUMENT_PACK_SELECT node with the arguments node it selects into.
454 * cp-tree.def: Fix a typo in the description of TYPE_PACK_EXPANSION.
456 2009-10-26 Dodji Seketeli <dodji@redhat.com>
459 * decl.c (decls_match): Use DECL_IS_BUILTIN instead of
462 2009-10-23 Dodji Seketeli <dodji@redhat.com>
465 * mangle.c (write_template_args): Allow mangling of empty template
466 argument list. Updated function comments.
468 2009-10-23 Jason Merrill <jason@redhat.com>
470 * semantics.c (lambda_expr_this_capture): Use thisify_lambda_field.
472 * semantics.c (outer_lambda_capture_p): New fn.
473 (thisify_lambda_field): Factor out...
474 (add_default_capture): ...from here.
475 (finish_id_expression): Use them.
478 * call.c (add_function_candidate): Only permit explicit conversion
479 ops if copy ctor was called with a single argument.
481 * call.c (initialize_reference): Tweak error message.
483 2009-10-21 Jakub Jelinek <jakub@redhat.com>
485 * mangle.c (finish_mangling_get_identifier): Use
486 obstack_base (mangle_obstack) instead of name_base.
488 2009-10-19 Jakub Jelinek <jakub@redhat.com>
490 * parser.c (cp_lexer_print_token, cp_parser_is_string_literal,
491 cp_parser_string_literal, cp_parser_primary_expression): Likewise.
492 (cp_lexer_get_preprocessor_token): Use C_LEX_STRING_JOIN instead
493 of C_LEX_RAW_STRINGS.
495 2009-10-15 Jason Merrill <jason@redhat.com>
498 * error.c (dump_template_bindings): Wrap argument packs in {}.
501 * parser.c (CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS): New.
502 (cp_parser_type_specifier): Don't try to parse a class-specifier
503 or enum-specifier in that case.
504 (cp_parser_trailing_type_id): New.
505 (cp_parser_late_return_type_opt): Call it.
506 (cp_parser_type_id_1): Add is_trailing_return parm.
507 (cp_parser_type_specifier_seq): Likewise.
509 2009-10-14 Jason Merrill <jason@redhat.com>
512 * call.c (print_z_candidates): Don't print deleted candidates.
513 (print_z_candidate): Note deleted candidates.
515 2009-10-14 Larry Evans <cppljevans@suddenlink.net>
518 * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
521 2009-10-12 Jason Merrill <jason@redhat.com>
524 * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
527 * pt.c (type_unification_real): Call convert_template_argument
528 for function default template arguments.
529 (check_default_tmpl_args): Suggest -std=c++0x when function default
530 template args seen in C++98 mode.
532 2009-10-11 Jason Merrill <jason@redhat.com>
535 * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
538 2009-10-11 Richard Guenther <rguenther@suse.de>
540 * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
542 2009-10-08 Jason Merrill <jason@redhat.com>
545 * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
546 even when DEDUCE_EXACT.
549 * pt.c (resolve_nondeduced_context): New.
550 * cvt.c (convert_to_void): Call it.
551 * semantics.c (finish_decltype_type): Likewise.
552 * typeck.c (decay_conversion): Here too.
553 * pt.c (tsubst_decl): Don't clobber input_location.
554 Don't register a bad specialization.
556 2009-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
558 * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
560 2009-10-07 Jason Merrill <jason@redhat.com>
563 * pt.c (tsubst_pack_expansion): Don't do anything now if we
564 have incomplete packs of different lengths.
567 * tree.c (build_qualified_name): Call convert_from_reference.
569 2009-10-06 Jason Merrill <jason@redhat.com>
571 Fix lookup of initialized captures in unevaluated context.
572 * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
573 * name-lookup.c (qualify_lookup): Check it.
574 * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
576 * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
577 on captures without explicit init.
578 (add_default_capture): Pass explicit_init_p.
580 Fix capture by copy of types with explicit copy constructor.
581 * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
582 (DIRECT_INIT_EXPR_P): New.
583 * typeck.c (convert_for_initialization): Just return if
585 * semantics.c (build_lambda_object): Use
586 TARGET_EXPR_DIRECT_INIT_P for normal captures.
588 2009-10-05 Jason Merrill <jason@redhat.com>
590 * parser.c: Mark lambda_scope and lambda_count for PCH.
592 2009-10-03 Jason Merrill <jason@redhat.com>
595 * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
598 2009-10-02 Jason Merrill <jason@redhat.com>
600 * mangle.c (write_unnamed_type_name): Implement.
601 (local_class_index): Split out from...
602 (discriminator_for_local_entity): ...here.
603 (nested_anon_class_index): New.
604 * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
606 2009-10-02 Janis Johnson <janis187@us.ibm.com>
608 * call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
611 2009-10-01 Jason Merrill <jason@redhat.com>
613 * parser.c (cp_parser_lambda_expression): Compute visibility.
614 (no_linkage_lambda_type_p): Remove.
615 * cp-tree.h: Remove declaration.
616 * tree.c (no_linkage_check): Don't call it. Don't check template
617 args. Don't check TREE_PUBLIC Types.
619 2009-10-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
620 Jason Merrill <jason@redhat.com>
622 * decl.c (grokdeclarator): Set constexprness before announcing
625 2009-10-01 Gabriel Dos Reis <gdr@cs.tamu.edu>
627 * decl.c (record_builtin_java_type): Undo unintended change.
628 (cxx_init_decl_processing): Likewise.
630 2009-10-01 Jason Merrill <jason@redhat.com>
632 * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
635 * decl.c (grok_special_member_properties): Only adjust
636 TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
637 (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
640 2009-09-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
642 * decl.c (check_for_uninitialized_const_var): Check constexpr
644 (grokdeclarator): Handle `constexpr'.
645 (check_tag_decl): Reject `constexpr'.
646 (check_function_type): Check constexpr functions.
647 * cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
648 (CLASSTYPE_LITERAL_P): New.
649 (lang_type_class::is_literal): New.
650 (lang_type_class::dummy): Adjust width.
651 (literal_type_p): Declare.
652 * parser.c (cp_parser_check_decl_spec): Print it.
653 (cp_parser_decl_specifier_seq): Accept "constexpr".
654 * semantics.c (validate_constexpr_fundecl): Define.
655 (literal_type_p): Define.
657 2009-09-30 Jason Merrill <jason@redhat.com>
659 * semantics.c (lambda_expr_this_capture): Fix default capture
660 of explicit capture of 'this'.
662 2009-09-30 Jason Merrill <jason@redhat.com>
664 * parser.c (cp_parser_lambda_expression): Don't add __ to __this.
666 2009-09-30 Jason Merrill <jason@redhat.com>
668 * cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
670 2009-09-29 John Freeman <jfreeman08@gmail.com>
671 Jason Merrill <jason@redhat.com>
673 Add support for lambda-expressions as per N2927.
674 * cp-tree.def (VEC_INIT_EXPR, LAMBDA_EXPR): New.
675 * cp-tree.h (LAMBDA_TYPE_P, LAMBDA_FUNCTION_P): New.
676 (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE): New.
677 (LAMBDA_EXPR_DEFAULT_CAPTURE_LIST): New.
678 (LAMBDA_EXPR_THIS_CAPTURE, LAMBDA_EXPR_CAPTURES_THIS_P): New.
679 (LAMBDA_EXPR_MUTABLE_P, LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): New.
680 (LAMBDA_EXPR_RETURN_TYPE, LAMBDA_EXPR_LOCATION): New.
681 (LAMBDA_EXPR_EXTRA_SCOPE, LAMBDA_EXPR_DISCRIMINATOR): New.
682 (struct tree_lambda_expr): New.
683 (union lang_tree_node): Add lambda_expression.
684 (struct lang_type_class): Add lazy_move_ctor flag, lambda_expr field.
685 (CLASSTYPE_LAZY_MOVE_CTOR, CLASSTYPE_LAMBDA_EXPR): New.
686 (LAMBDA_TYPE_EXTRA_SCOPE, VEC_INIT_EXPR_SLOT): New.
687 (VEC_INIT_EXPR_INIT, DECLTYPE_FOR_LAMBDA_CAPTURE): New.
688 (DECLTYPE_FOR_LAMBDA_RETURN): New.
689 (enum special_function_kind): Add sfk_move_constructor.
690 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT, LAMBDANAME_P): New.
691 * parser.c (cp_parser_lambda_expression, cp_parser_lambda_introducer)
692 (cp_parser_lambda_declarator_opt, cp_parser_lambda_body): New.
693 (start_lambda_scope, record_lambda_scope, finish_lambda_scope): New.
694 (no_linkage_lambda_type_p): New.
695 (cp_parser_primary_expression): Recognize lambda expression.
696 (cp_parser_init_declarator): Note lambda scope.
697 (cp_parser_function_definition_after_declarator): Likewise.
698 (cp_parser_late_parsing_default_args): Likewise.
699 (cp_parser_skip_to_closing_parenthesis): Skip to end of lambda capture
701 (cp_parser_parameter_declaration): Don't defer lambda default args.
702 * semantics.c (finish_non_static_data_member, finish_id_expression):
703 Handle default capture for lambda expressions.
704 (finish_this_expr): Handle 'this' keyword inside of lambda expressions.
705 (outer_automatic_var_p): New.
706 (finish_decltype_type): Handle decltypes within lambda expressions.
707 (classtype_has_nothrow_assign_or_copy_p): Synthesized move constructor.
708 (build_lambda_expr, build_lambda_object, begin_lambda_type)
709 (lambda_return_type, lambda_capture_field_type, apply_lambda_return_type)
710 (capture_decltype, add_capture, add_default_capture)
711 (lambda_expr_this_capture): New.
712 * mangle.c (write_unnamed_type_name): New. Incomplete.
713 (write_closure_type_name): New.
714 (write_unqualified_name): Recognize unnamed, closure types.
715 (write_type): Do not write decltypes from lambda expressions.
716 (decl_mangling_context): New.
717 (write_name): Use it. Handle PARM_DECL scope.
718 (write_prefix): Likewise. Handle VAR_DECL/FIELD_DECL scope.
719 (write_compact_number): Factor out from...
720 (write_expression, write_template_param): ...here.
721 (discriminator_for_local_entity): Recognize lambdas.
722 (write_local_name): Handle PARM_DECL scope.
723 * typeck.c (structural_comptypes): Compare decltypes from lambda
725 (check_return_expr): Deduce lambda return type from multiple return
727 * class.c (add_implicitly_declared_members): Add lazy move constructor
729 (check_bases_and_members): Delete default constructor and assignment
730 operator for lambda types.
731 (maybe_note_name_used_in_class): Do not confuse lambda expression with
733 * decl.c (reshape_init_r): Array copy.
734 (grokfndecl): Synthesized move constructor.
735 (cp_tree_node_structure): Lambda expression.
736 * method.c (use_thunk): Synthesized move constructor.
737 (do_build_copy_constructor): Likewise.
738 (locate_copy): Likewise.
739 (implicitly_declare_fn): Likewise.
740 * cp-objcp-common.c (cp_tree_size): Handle LAMBDA_EXPR.
741 * error.c (dump_aggr_type): Recognize lambda type.
742 (dump_function_decl): Recognize lambda function.
743 (function_category): Likewise.
744 (dump_function_name): Hide lambda name.
745 * tree.c (build_array_copy, move): New.
746 (special_function_p): Synthesized move constructor.
747 (no_linkage_check): Handle lambdas.
748 * search.c (lookup_fnfields_1): Synthesized move constructor.
749 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr):
750 Handle VEC_INIT_EXPR.
751 * typeck2.c (digest_init_r): Array copy.
752 * pt.c (get_template_info): Don't touch typedefs.
753 (instantiate_decl): Don't resubstitute artificial decls.
754 (tsubst_decl, tsubst, tsubst_copy_and_build): Handle lambdas.
755 (lookup_template_class): Don't fall back on name lookup.
756 * name-lookup.c (make_lambda_name): New.
757 (pushdecl_class_level): Handle default capture for lambda expressions.
758 (qualify_lookup): Handle decltypes within lambda expressions.
759 (pushtag): Handle ts_within_enclosing_non_class in function scope.
761 2009-09-28 Janis Johnson <janis187@us.ibm.com>
763 * mangle.c (write_builtin_type): Support decimal float types.
765 2009-09-28 Richard Henderson <rth@redhat.com>
767 * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
769 2009-09-24 Jakub Jelinek <jakub@redhat.com>
771 * method.c (make_thunk, make_alias_for): Don't set
772 DECL_NO_STATIC_CHAIN.
773 * decl.c (builtin_function_1, grokfndecl): Likewise.
774 * lex.c (build_lang_decl): Likewise.
776 2009-09-23 Dodji Seketeli <dodji@redhat.com>
779 * decl.c (cp_finish_decl): Record the types used by the global
780 variable declaration we've just parsed.
782 2009-09-22 Dodji Seketeli <dodji@redhat.com>
784 * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
785 LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
786 LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
787 hooks for the c++ FE.
788 * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
789 function_parameter_expanded_from_pack_p): Declare ...
790 * pt.c (function_parameter_pack_p, get_function_template_decl,
791 function_parameter_expanded_from_pack_p): ... new hooks.
792 (get_template_info): Make this more robust.
793 (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
794 line between comment and function.
795 (get_template_argument_pack_elems): Fix comment.
796 (tsubst_decl): Arguments of function parameter packs are not
797 parameter packs themselves.
799 2009-09-21 Jason Merrill <jason@redhat.com>
802 * tree.c (trivial_type_p): Fix logic.
804 2009-09-21 Jason Merrill <jason@redhat.com>
806 * name-lookup.c (push_class_level_binding): Sanity check.
808 2009-09-18 Jason Merrill <jason@redhat.com>
810 * decl2.c (determine_visibility): Make anonymous types internal.
811 (mark_used): Complain about types without linkage used in
812 decls with internal linkage.
813 (vague_linkage_fn_p): Split out from...
814 * decl.c (maybe_commonize_var): ...here.
815 (grokdeclarator): Adjust linkage when a typedef gives linkage name.
816 * tree.c (no_linkage_check): Check the enclosing class and template
819 * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New.
821 * pt.c (get_pattern_parm): New.
822 (listify): Split out from...
823 (listify_autos): ...here.
824 (unify): Deduce std::initializer_list for T.
825 * call.c (build_over_call): Warn about it.
827 2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
830 * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
832 (convert_for_assignment): Likewise.
833 * cvt.c (type_promotes_to): Likewise.
835 2009-09-14 Richard Henderson <rth@redhat.com>
836 Jakub Jelinek <jakub@redhat.com>
838 * cp-tree.h (finish_asm_stmt): Update decl.
839 * parser.c (cp_parser_asm_definition): Parse asm goto.
840 (cp_parser_asm_label_list): New.
841 * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
842 (tsubst_expr): Handle asm labels.
843 * semantics.c (finish_asm_stmt): Add and use labels parameter.
845 2009-09-14 Richard Henderson <rth@redhat.com>
847 * except.c (init_exception_processing): Don't call
848 default_init_unwind_resume_libfunc.
849 (cp_protect_cleanup_actions): Return the decl to call.
850 (build_exc_ptr): Use __builtin_eh_pointer.
851 * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
853 2009-09-13 Richard Guenther <rguenther@suse.de>
854 Rafael Avila de Espindola <espindola@google.com>
856 * except.c (init_exception_processing): Do not set
857 lang_eh_runtime_type.
858 (choose_personality_routine): Do not set eh_personality_decl,
859 set pragma_java_exceptions.
860 * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
861 (LANG_HOOKS_EH_PERSONALITY): Likewise.
862 (cp_eh_personality_decl): New.
863 (cp_eh_personality): Likewise.
864 * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
867 2009-09-13 Wei Guozhi <carrot@google.com>
870 * cp/optimize.c (build_delete_destructor_body): New function.
871 (maybe_clone_body): Call build_delete_destructor_body for
874 2009-09-10 Jason Merrill <jason@redhat.com>
876 * repo.c (extract_string, get_base_filename, init_repo): constify.
878 2009-09-09 Jason Merrill <jason@redhat.com>
880 * error.c (find_typenames_r): Also add decltypes.
882 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
885 * decl2.c (grokfield): Check for explicit template argument lists.
887 2009-09-09 Jack Howarth <howarth@bromo.med.uc.edu>
890 * Make-lang.in: Remove redundant code from linkage for darwin10.
892 2009-09-08 Paolo Carlini <paolo.carlini@oracle.com>
895 * decl.c (build_init_list_var_init): Check return value of
896 perform_implicit_conversion.
898 2009-09-08 Jason Merrill <jason@redhat.com>
900 * class.c (currently_open_class): Make sure we're dealing with the
903 * cp-tree.h (enum overload_flags): Remove OP_FLAG.
904 * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
906 * name-lookup.c (is_class_level): Remove.
907 (push_binding_level, leave_scope, resume_scope): Adjust.
908 (pushlevel_class): Adjust.
909 (poplevel_class): Make sure we're on class_binding_level.
911 * decl.c (grokmethod): Rename from start_method.
912 (finish_method): Remove.
914 * parser.c (cp_parser_save_member_function_body): Adjust.
916 2009-09-03 Doug Kwan <dougkwan@google.com>
918 * tree.c (cp_fix_function_decl_p): New.
919 (cp_free_lang_data): New.
921 2009-09-03 Diego Novillo <dnovillo@google.com>
923 * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
924 * decl2.c: Include pointer-set.h.
925 (collect_candidates_for_java_method_aliases): New.
926 (cp_write_global_declarations): Call it.
927 Add local variable CANDIDATES. If set, call
928 build_java_method_aliases.
929 (build_java_method_aliases): Add argument CANDIDATES.
930 Use it to determine if FNDECL should get a hidden alias.
931 * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
932 * cp-tree.h (cp_free_lang_data): Declare.
934 2009-09-03 Richard Guenther <rguenther@suse.de>
936 * method.c (use_thunk): Use cgraph_finalize_function to hand
937 off thunks to the cgraph.
938 * semantics.c (emit_associated_thunks): Do not emit thunks
939 for really extern functions.
941 2009-09-03 Diego Novillo <dnovillo@google.com>
943 * cp-lang.c (lang_hooks): Remove const qualifier.
945 2009-09-02 Jason Merrill <jason@redhat.com>
947 * semantics.c (describable_type): Don't pretend to be in a template.
949 * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
951 2009-09-01 Alexandre Oliva <aoliva@redhat.com>
953 * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
954 * cp-lang.c (cxx_dwarf_name): Pass it.
955 * error.c (count_non_default_template_args): Take flags as
956 argument. Adjust all callers. Skip counting of default
957 arguments if the new flag is given.
959 2009-09-01 Dodji Seketeli <dodji@redhat.com>
962 * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
965 2009-09-01 Richard Guenther <rguenther@suse.de>
967 * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
968 * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
970 2009-09-01 Richard Guenther <rguenther@suse.de>
972 * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
974 2009-08-31 Dodji Seketeli <dodji@redhat.com>
977 * cp-tree.h (get_template_info): Parameter should be const.
978 (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
979 (get_template_argument_pack_elems,
980 get_primary_template_innermost_parameters,
981 get_template_innermost_arguments, template_template_parameter_p):
983 * pt.c (get_template_argument_pack_elems,
984 get_template_innermost_parameters, get_template_innermost_arguments,
985 template_template_parameter_p):
986 ... New C++ front end implementation of new language hooks.
987 (primary_template_instantiation_p): New private helper.
988 (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
990 (get_template_info): Const-ify parameter.
991 * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
992 LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
993 LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
994 LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
995 interfaces for the C++ front-end.
997 2009-08-31 Jason Merrill <jason@redhat.com>
1000 * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
1001 type-specifier-seq before we commit.
1003 2009-08-28 Richard Guenther <rguenther@suse.de>
1006 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
1007 into the generic IL.
1009 2009-08-27 Richard Guenther <rguenther@suse.de>
1011 * class.c (build_vtbl_ref_1): Remove excess vertical space.
1012 * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
1013 tracked by $(TREE_H).
1014 * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
1016 2009-08-26 Jason Merrill <jason@redhat.com>
1018 * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
1019 if we're contextually converting to bool.
1020 (build_conditional_expr): Likewise.
1021 * typeck.c (condition_conversion): Likewise.
1023 * call.c (build_conditional_expr): Fix logic errors.
1024 (build_new_op): Remove dead COND_EXPR handling.
1026 2009-08-24 Jason Merrill <jason@redhat.com>
1028 * cp-tree.h (DECL_DEFERRED_FN): Remove.
1029 (struct lang_decl_fn): Remove deferred flag.
1030 * class.c (build_clone): Don't set it.
1031 * decl2.c (note_vague_linkage_fn): Don't check or set it.
1032 (mark_used): Don't check it.
1033 * method.c (make_thunk, make_alias_for): Don't set it.
1035 * decl2.c (mark_used): Streamline logic.
1040 * cp-tree.h (DECL_ODR_USED): New macro.
1041 (struct lang_decl_base): Add odr_used flag.
1042 * decl.c (duplicate_decls): Propagate it. Use it for error.
1043 * pt.c (register_specialization): Use it for error.
1044 * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
1045 (cp_write_global_declarations): Use it for error.
1046 (tree_used_ok): Remove.
1047 * cp-tree.h: Remove tree_used_ok.
1048 * call.c (build_call_a): Don't call it.
1049 * init.c (build_offset_ref): Likewise.
1051 2009-08-21 Jakub Jelinek <jakub@redhat.com>
1054 * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
1057 2009-08-19 Jason Merrill <jason@redhat.com>
1061 * decl2.c (mark_used): Increment function_depth during synthesis.
1062 * parser.c (cp_parser_default_argument): Not here.
1064 2009-08-19 Jakub Jelinek <jakub@redhat.com>
1066 * method.c (use_thunk): Call free_after_compilation after
1067 assemble_end_function.
1069 2009-08-17 Richard Guenther <rguenther@suse.de>
1071 * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
1073 (finish_enum): Keep variant chain intact.
1074 * tree.c (cp_build_reference_type): Likewise.
1076 2009-08-16 Jason Merrill <jason@redhat.com>
1078 Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
1079 and VAR_DECL, so mark_used only has effect the first time.
1080 * decl2.c (mark_used): Just return if TREE_USED is already set.
1081 Don't set TREE_USED if cp_unevaluated_operand is set.
1082 (tree_used_ok): New fn.
1083 * init.c (build_offset_ref): Check it instead of TREE_USED.
1084 * call.c (build_call_a): Likewise.
1085 * cp-tree.h: Declare it.
1086 (DECL_NO_LINKAGE_CHECKED): No longer needed.
1087 (struct lang_decl_base): Remove no_linkage_checked bitfield.
1089 * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
1091 * decl2.c (mark_used): It's ok to synthesize for default args now.
1093 2009-08-10 Jason Merrill <jason@redhat.com>
1095 Implement DR 757: It's OK for a decl to use a type without linkage
1096 so long as the decl is defined in the current translation unit.
1097 * decl2.c (no_linkage_decls): New vector.
1098 (mark_used): Add decls that use types with no linkage.
1099 (cp_write_global_declarations): Check that they are defined.
1100 (decl_defined_p, no_linkage_error): New fns.
1101 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
1102 (struct lang_decl_base): Add flag.
1103 * decl.c (grokfndecl): Don't check type linkage.
1104 (grokvardecl): If the type has no linkage, just make sure
1105 DECL_LANG_SPECIFIC is set.
1106 * pt.c (check_instantiated_arg): Don't check type linkage.
1107 * name-lookup.c (is_local_extern): New fn.
1108 * name-lookup.h: Declare it.
1110 2009-08-05 Jason Merrill <jason@redhat.com>
1113 * init.c (build_vec_init): Evaluate the initializer before
1114 starting the initialization try block.
1116 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
1119 * typeck.c (convert_for_assignment): Do not warn for any boolean
1120 variant. Use explicit location.
1122 2009-08-04 Dodji Seketeli <dodji@redhat.com>
1125 * pt.c (tsubst_default_argument): Let access checks of the
1126 default argument happen in the context of the current function.
1128 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
1131 * call.c (build_new_op): Only try prefix operator if -fpermissive,
1132 otherwise just error.
1134 2009-08-04 Dodji Seketeli <dodji@redhat.com>
1137 * error.c (lang_decl_name): Print qualified names for decls
1140 2009-08-03 Jason Merrill <jason@redhat.com>
1141 Jakub Jelinek <jakub@redhat.com>
1144 * init.c (build_vec_init): Look through a TARGET_EXPR around a
1147 2009-07-31 Jason Merrill <jason@redhat.com>
1148 Douglas Gregor <doug.gregor@gmail.com>
1150 Remove implicit binding of lvalues to rvalue references (N2831)
1151 * call.c (convert_class_to_reference): Binding an lvalue to an
1152 rvalue reference is bad. If the user-defined conversion is bad,
1153 set bad_p before merging conversions.
1154 (maybe_handle_ref_bind): Don't push down bad_p.
1155 (reference_binding): Binding an lvalue to an rvalue reference is bad.
1156 (convert_like_real): Give a helpful error about binding lvalue
1157 to rvalue reference.
1158 (reference_related_p): No longer static.
1159 * typeck.c (build_typed_address): New.
1160 (build_static_cast_1): Add static_cast from lvalue to &&.
1161 * cp-tree.h: Adjust.
1163 2009-07-31 Jason Merrill <jason@redhat.com>
1165 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
1166 Do direct binding of "rvalues" in memory to rvalue references.
1167 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
1169 * typeck.c (build_static_cast_1): Do direct binding of memory
1170 "rvalues" to rvalue references.
1171 * cvt.c (cp_fold_convert): New.
1172 * cp-tree.h: Declare it.
1174 2009-07-31 Jason Merrill <jason@redhat.com>
1176 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
1177 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
1179 2009-07-29 Jason Merrill <jason@redhat.com>
1182 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
1183 * error.c (count_non_default_template_args): Pass it.
1184 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
1186 2009-07-29 Richard Guenther <rguenther@suse.de>
1189 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
1192 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
1195 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
1196 with a qualified return type.
1198 2009-07-24 Jason Merrill <jason@redhat.com>
1201 * call.c (build_op_delete_call): If this is for a new-expression
1202 and the op delete is deleted, do nothing.
1205 * call.c (compare_ics): Give list-initialization of std::init_list
1206 priority over conversion to scalar, too.
1208 2009-07-22 Jason Merrill <jason@redhat.com>
1210 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
1211 (needs_fake_anon): New.
1212 (write_name): Check it.
1213 (write_nested_name): Add a fake anonymous namespace scope if true.
1214 * name-lookup.c (get_anonymous_namespace_name): No longer static.
1215 * rtti.c, cp-tree.h: Adjust.
1217 2009-07-22 Richard Guenther <rguenther@suse.de>
1220 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
1221 related exprs to ...
1222 (cp_genericize_r): ... genericization stage.
1223 (cp_genericize): Adjust.
1225 2009-07-21 Jason Merrill <jason@redhat.com>
1228 * call.c (reference_binding): Implement binding to { }.
1229 (initialize_reference): Binding temporary to non-const && is fine.
1230 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
1232 * decl.c (reshape_init_r): { T } is not an aggregate initializer
1235 2009-07-17 Richard Guenther <rguenther@suse.de>
1238 * decl.c (finish_function): Do not emit unused result warnings
1240 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
1241 c_warn_unused_result_pass.
1242 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
1243 * optimize.c (clone_body): Clone in GENERIC.
1244 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
1245 * decl2.c (cp_write_global_declarations): Fix body test.
1246 Do not call cgraph_optimize.
1247 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
1248 * method.c (use_thunk): Register thunk with
1249 cgraph_finalize_function.
1250 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
1252 2009-07-17 Richard Guenther <rguenther@suse.de>
1254 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
1257 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
1258 Manuel López-Ibáñez <manu@gcc.gnu.org>
1261 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
1262 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
1263 call.c, cvt.c, mangle.c: Add location argument to
1264 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
1265 build_size_arg, build_fold_addr_expr, build_call_array,
1266 non_lvalue, size_diffop, fold_build1_initializer,
1267 fold_build2_initializer, fold_build3_initializer,
1268 fold_build_call_array, fold_build_call_array_initializer,
1269 fold_single_bit_test, omit_one_operand, omit_two_operands,
1270 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
1271 fold_indirect_ref, combine_comparisons, fold_builtin_*,
1272 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
1273 round_up, round_down.
1275 2009-07-16 Jason Merrill <jason@redhat.com>
1278 Split POD into "standard-layout" and "trivial" as per N2230,
1279 Support std::is_standard_layout and std::is_trivial traits.
1280 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
1282 (struct lang_type_class): Add non_std_layout.
1283 (CLASSTYPE_NON_STD_LAYOUT): New.
1284 * class.c (check_bases): Set it.
1285 (check_field_decls): Likewise.
1286 (check_bases_and_members): Likewise.
1287 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
1289 (cp_parser_trait_expr): Likewise.
1290 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
1292 (finish_trait_expr): Likewise.
1293 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
1294 (pod_type_p): Use them.
1295 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
1297 Adjust bits of the language that no longer refer to POD types.
1298 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
1299 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
1300 (build_x_va_arg): Likewise.
1301 (call_builtin_trap): Remove.
1302 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
1303 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
1304 (cp_finish_decl): Likewise.
1305 (check_previous_goto_1, check_goto): Adjust error.
1306 * typeck.c (build_class_member_access_expr): Check
1307 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
1309 2009-07-14 Taras Glek <tglek@mozilla.com>
1310 Rafael Espindola <espindola@google.com>
1312 * Make-lang.in: Added CP_PLUGIN_HEADERS and
1313 c.install-target to export cp-tree.h cxx-pretty-print.h
1314 name-lookup.h headers for plugins.
1316 2009-07-14 Jason Merrill <jason@redhat.com>
1319 * decl.c (decls_match): A non-extern-C declaration doesn't match
1320 a builtin extern-C declaration.
1323 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
1324 looking in used namespaces just because we found something on
1328 * semantics.c (perform_koenig_lookup): Handle empty template args.
1330 * call.c (build_over_call): Use can_trust_pointer_alignment.
1332 2009-07-14 Dodji Seketeli <dodji@redhat.com>
1336 * decl2.c (grokfield): Don't call set_underlying_type on typedef
1337 decls that are type names.
1339 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
1342 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
1343 front of qualified names.
1345 2009-07-12 Jason Merrill <jason@redhat.com>
1348 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
1351 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
1352 * tree.c (lvalue_p_1): Return it. Remove
1353 treat_class_rvalues_as_lvalues parm.
1354 (real_lvalue_p): Disallow pseudo-lvalues here.
1355 (lvalue_or_rvalue_with_address_p): New fn.
1356 * call.c (initialize_reference): Use it instead of real_lvalue_p.
1359 * init.c (build_new_1): Handle initializer list as array initializer.
1360 (build_vec_init): Likewise.
1361 * typeck.c (cp_build_modify_expr): Likewise.
1362 * typeck2.c (process_init_constructor_array): Error rather than abort
1363 if too many initializers.
1365 2009-07-10 Jakub Jelinek <jakub@redhat.com>
1368 * error.c (cp_print_error_function): Check for NULL block.
1370 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
1371 Jason Merrill <jason@redhat.com>
1373 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1374 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
1376 2009-07-09 Dodji Seketeli <dodji@redhat.com>
1379 * pt.c (type_unification_real): Use tsubst_template_arg instead
1380 of tsubst to substitute default template arguments.
1382 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1385 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
1387 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1390 2009-07-07 Jason Merrill <jason@redhat.com>
1393 * pt.c (tsubst_decl): Don't abort if we didn't change anything
1394 in a TEMPLATE_DECL's args.
1396 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
1398 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
1401 2009-07-07 Jason Merrill <jason@redhat.com>
1404 * decl.c (build_enumerator): Don't add enumerators for a
1405 scoped enum to the enclosing class.
1408 * decl.c (start_enum): Allow dependent underlying type.
1411 * decl.c (finish_enum): Finish scope even in a template.
1413 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
1415 * init.c: Replace %J by an explicit location. Update all calls.
1417 * typeck2.c: Likewise.
1419 * name-lookup.c: Likewise.
1421 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
1423 * decl.c: Replace %H by an explicit location. Update all calls.
1424 * except.c: Likewise.
1425 * semantics.c: Likewise.
1426 * parser.c: Likewise.
1428 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
1431 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
1432 append_type_to_template_for_access_check_1): Use
1433 RECORD_OR_UNION_CODE_P.
1435 2009-07-04 Jason Merrill <jason@redhat.com>
1437 * pt.c (retrieve_specialization): Don't get confused by a
1438 using-declaration that brings in another instance of this template
1441 * ptree.c (cxx_print_type): Fix logic.
1443 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
1446 * cp-tree.h (struct lang_decl_parm): New.
1447 (struct lang_decl): Add it.
1448 (LANG_DECL_PARM_CHECK): New.
1449 (DECL_PARM_INDEX): New.
1450 * decl2.c (parm_index): Remove.
1451 * lex.c (retrofit_lang_decl): Handle parms.
1452 (cxx_dup_lang_specific_decl): Likewise.
1453 * mangle.c (write_expression): Adjust.
1454 * tree.c (cp_tree_equal): Adjust.
1455 (decl_linkage): Only check DECL_COMDAT for functions and variables.
1456 * parser.c (cp_parser_parameter_declaration_list): Set
1458 * pt.c (iterative_hash_template_arg): Hash it.
1460 2009-07-03 Jason Merrill <jason@redhat.com>
1462 * cp-tree.h (struct lang_decl): Overhaul.
1463 (struct lang_decl_flags): Remove.
1464 (struct lang_decl_base): New.
1465 (struct lang_decl_min): New.
1466 (struct lang_decl_fn): New.
1467 (struct lang_decl_ns): New.
1468 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
1469 (LANG_DECL_MIN_CHECK): New.
1470 (LANG_DECL_FN_CHECK): New.
1471 (LANG_DECL_NS_CHECK): New.
1472 (STRIP_TEMPLATE): New.
1473 (NON_THUNK_FUNCTION_CHECK): Remove.
1474 (DECL_DECLARES_FUNCTION_P): New.
1476 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
1477 * decl.c (push_local_name, duplicate_decls): Adjust.
1478 * decl2.c (start_objects): Don't set u2sel.
1479 * semantics.c (finish_omp_threadprivate): Adjust.
1480 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
1481 (decl_cloned_function_p): Out-of-line implementation of macros.
1482 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
1483 * mangle.c (write_unqualified_name): Don't check function flags
1485 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
1486 * pt.c (build_template_decl): Don't set function flags.
1487 (check_default_tmpl_args): Check that it's a function.
1488 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
1491 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
1492 DECL_CLONED_FUNCTION.
1494 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
1495 * class.c (finish_struct_1): Adjust.
1496 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
1497 * search.c (lookup_field_1): Adjust.
1499 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
1500 * decl.c (finish_method): Don't add to it.
1501 * class.c (fixup_pending_inline): Remove.
1502 (fixup_inline_methods): Remove.
1503 (finish_struct_1): Don't call it.
1505 * error.c (dump_function_name): Handle null name.
1507 2009-07-02 Mark Mitchell <mark@codesourcery.com>
1509 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
1510 in arithmetic earlier and allow comparisions of NULL with
1511 pointers-to-members.
1513 2009-07-02 Jason Merrill <jason@redhat.com>
1515 Use hash tables for template specialization lookup.
1516 * pt.c (struct spec_entry): New type.
1517 (decl_specializations, type_specializations): New hash tables.
1518 (register_specialization, retrieve_specialization): Use them.
1519 (reregister_specialization, lookup_template_class): Use them.
1520 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
1521 (iterative_hash_template_arg): New.
1522 (init_template_processing): New
1523 (process_partial_specialization): Don't look to see if we already
1524 have this partial specialization.
1525 (maybe_process_partial_specialization): Handle reassigning
1526 full specializations when we get an explicit specialization
1527 of the partial instantiation.
1528 (tsubst_friend_function): Adjust specialization reassignment code.
1529 (instantiate_template): Only do one lookup.
1530 (instantiate_decl): Don't do any lookup.
1531 * cp-tree.h: Declare init_template_processing.
1532 * decl.c (duplicate_decls): Pass args to reregister_specialization.
1534 2009-07-01 Jason Merrill <jason@redhat.com>
1536 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
1538 * pt.c (register_specialization): Use duplicate_decls to merge
1539 the argument with a previous specialization.
1540 (check_explicit_specialization): Call register_specialization to
1541 merge the TEMPLATE_DECL with a previous version.
1542 (determine_specialization): Return the args even if fn is a template.
1544 2009-07-01 Ian Lance Taylor <iant@google.com>
1546 * g++spec.c (lang_specific_driver): Bump num_args by 1.
1548 2009-06-30 Jason Merrill <jason@redhat.com>
1551 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
1552 EXPR_PACK_EXPANSION.
1554 2009-06-29 Jason Merrill <jason@redhat.com>
1557 * error.c (dump_template_parms): Pass all args to
1558 count_non_default_template_args.
1559 (count_non_default_template_args): Pull out the inner ones.
1561 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
1563 * decl.c (duplicate_decls): Re-indent.
1565 2009-06-25 Ian Lance Taylor <iant@google.com>
1567 * call.c (avoid_sign_compare_warnings): New static function.
1568 (build_new_op): Call it.
1569 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
1570 TREE_NO_WARNING is set on either operand.
1572 2009-06-25 Ian Lance Taylor <iant@google.com>
1574 * g++spec.c (SKIPOPT): define.
1575 (lang_specific_driver): Handle -static-libstdc++. Only add
1576 LIBSTDCXX_STATIC if we add LIBSTDCXX.
1578 2009-06-25 Ian Lance Taylor <iant@google.com>
1580 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
1581 the second nor third operand has side effects.
1583 2009-06-25 Ian Lance Taylor <iant@google.com>
1585 * parser.c (cp_parser_binary_expression): Increment
1586 c_inhibit_evaluation_warnings while parsing the right hand side of
1587 "true || x" or "false && x".
1588 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
1589 if c_inhibit_evaluation_warnings is zero.
1591 2009-06-24 Jason Merrill <jason@redhat.com>
1593 * error.c (dump_decl): Do say "typedef" for the injected class name.
1595 * pt.c (lookup_template_class): Use currently_open_class,
1596 compare template args later.
1599 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
1600 * class.c (resolve_address_of_overloaded_function): Fix typo.
1602 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
1604 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
1605 * decl.c (finish_decl): Remove.
1606 (declare_global_var): Replace finish_decl with cp_finish_decl.
1607 (start_method): Same.
1608 * rtti.c (emit_tinfo_decl): Same.
1609 * pt.c (tsubst_expr): Same.
1610 (instantiate_decl): Same.
1611 * decl2.c (grokbitfield): Same.
1612 * name-lookup.c (pushdecl_top_level_1): Same.
1613 * cp-tree.h: Remove finish_decl.
1615 2009-06-16 David Edelsohn <edelsohn@gnu.org>
1617 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
1618 (lang_specific_driver): Always allocate extra argument.
1619 Add LIBSTDCXX_STATIC to arglist if defined and linking
1622 2009-06-16 Ian Lance Taylor <iant@google.com>
1624 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
1625 (cp/semantics.o): Depend upon gt-cp-semantics.h.
1627 2009-06-16 Ian Lance Taylor <iant@google.com>
1629 * parser.c (cp_unevaluated_operand): Define global variable.
1630 (cp_parser_question_colon_clause): Increment
1631 c_inhibit_evaluation_warnings when evaluating an expression which
1632 will never be executed.
1633 (cp_parser_decltype): Increment cp_unevaluated_operand and
1634 c_inhibit_evaluation_warnings, not skip_evaluation.
1635 (cp_parser_sizeof_operand): Likewise.
1636 (cp_parser_enclosed_template_argument_list): Save
1637 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1639 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
1640 Add unevaluated_operand and inhibit_evaluation_warnings fields.
1641 (cp_unevaluated_operand): Declare.
1642 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
1643 and c_inhibit_evaluation_warnings rather than skip_evaluation.
1644 (pop_from_top_level): Restore cp_unevaluated_operand and
1645 c_inhibit_evaluation_warnings rather than skip_evaluation.
1646 * class.c (build_base_path): Check cp_unevaluated_operand rather
1647 than skip_evaluation.
1648 * typeck.c (build_class_member_access_expr): Likewise.
1649 (cp_build_binary_op): Don't warn about bad shift counts if
1650 c_inhibit_evaluation_warnings is non-zero.
1651 * pt.c (coerce_template_parms): Save state of
1652 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1654 (tsubst_aggr_type): Likewise.
1655 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
1657 (tsubst_copy): Likewise.
1658 (tsubst): Set cp_unevaluated_operand and
1659 c_inhibit_evaluation_warnings, not skip_evaluation.
1660 (tsubst_copy_and_build): Likewise.
1661 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
1662 rather than skip_evaluation.
1663 * decl2.c (mark_used): Likewise.
1664 * semantics.c (finish_non_static_data_member): Likewise.
1665 * cvt.c (cp_convert_and_check): Check
1666 c_inhibit_evaluation_warnings rather than skip_evaluation.
1667 * mangle.c (write_type): Set cp_unevaluated_operand rather than
1670 2009-06-15 Ian Lance Taylor <iant@google.com>
1672 * parser.c (cp_parser_direct_declarator): Add braces around
1673 variables declared before label.
1675 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
1677 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
1678 * cp-tree.h (cxx_comdat_group): Change signature.
1679 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
1680 (cxx_comdat_group): Change signature.
1681 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
1683 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
1684 * method.c (use_thunk): Update call to make_decl_one_only.
1685 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
1687 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
1689 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
1690 (build_modify_expr): New arg.
1691 * semantics.c (finish_unary_op_expr): Pass location to
1693 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
1694 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
1695 c_sizeof_or_alignof_type.
1696 (build_array_ref): New argument.
1697 (build_compound_expr): Same.
1698 (build_const_cast): Same.
1699 (build_ptrmemfunc): Pass location to build_c_cast.
1700 * init.c (avoid_placement_new_aliasing): Pass location to
1702 (build_vec_delete_1): Pass location to cp_build_modify_expr,
1703 build_compound_expr.
1704 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1705 * decl.c (poplevel): Pass location to c_build_bind_expr.
1706 (finish_case_label): Pass location to build_case_label.
1707 (finish_constructor_body): Same.
1708 (finish_destructor_body): Pass location to build_stmt.
1709 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
1710 * call.c (build_new_op): Pass location to build_array_ref.
1711 (build_x_va_arg): Pass location to build_va_arg.
1712 * except.c (expand_end_catch_block): Pass location to
1714 * cp-tree.h (build_array_ref): New argument.
1715 (build_compound_expr): Same.
1716 (build_c_cast): Same.
1717 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
1718 (gimplify_switch_stmt): Same.
1719 * typeck2.c (split_nonconstant_init_1): Same.
1720 * pt.c (tsubst_copy): Same.
1721 * semantics.c (add_decl_expr): Same.
1722 (do_poplevel): Same.
1723 (push_cleanup): Same.
1724 (finish_goto_stmt): Same.
1725 (finish_expr_stmt): Same.
1726 (begin_if_stmt): Same.
1727 (begin_while_stmt): Same.
1728 (begin_do_stmt): Same.
1729 (finish_return_stmt): Same.
1730 (begin_for_stmt): Same.
1731 (finish_break_stmt): Same.
1732 (finish_continue_stmt): Same.
1733 (begin_switch_stmt): Same.
1734 (begin_try_block): Same.
1735 (begin_handler): Same.
1736 (finish_asm_stmt): Same.
1737 (finish_label_stmt): Same.
1738 (finish_stmt_expr_expr): Same.
1739 (finalize_nrv_r): Same.
1740 (finish_omp_atomic): Same.
1741 * name-lookup.c (do_using_directive): Same.
1742 * decl2.c (grok_array_decl): Same.
1743 * parser.c (cp_parser_cast_expression): Same.
1744 (cp_parser_selection_statement): Same.
1745 (cp_parser_implicitly_scoped_statement): Same.
1746 (cp_parser_objc_selector_expression): Same.
1747 (cp_parser_objc_synchronized_statement): Same.
1748 (cp_parser_objc_throw_statement): Same.
1749 (cp_parser_omp_critical): Same.
1750 (cp_parser_omp_master): Same.
1751 * typeck.c (build_function_call): Add location argument.
1752 * init.c: Add location argument to all build_decl calls.
1758 * semantics.c: Same.
1761 * cp-gimplify.c: Same.
1763 (cp_make_fname_decl): Add location argument. Pass location ot
1765 (finish_case_label): Same.
1766 * cp-tree.h (finish_case_label): Add location argument.
1767 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
1770 2009-06-09 Jason Merrill <jason@redhat.com>
1773 * decl2.c (mark_used): Return after complaining about deleted fn.
1775 2009-06-08 Jason Merrill <jason@redhat.com>
1777 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
1778 late-specified return type.
1780 2009-06-08 Jakub Jelinek <jakub@redhat.com>
1783 * call.c (check_dtor_name): Return false even if
1784 get_type_value (name) is error_mark_node.
1788 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
1789 on error_mark_node. Check for VLAs outside of function context
1790 before check whether to wrap bounds into a NOP_EXPR with
1793 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
1795 * repo.c (get_base_filename): Use aux_base_name rather than
1796 alternate temporary file during second compare debug compilation.
1797 (finish_repo): Skip during -fcompare-debug-second.
1799 2009-06-06 Ian Lance Taylor <iant@google.com>
1801 * parser.c (cp_parser_label_for_labeled_statement): Support
1802 attribute on labels if immediately followed by semicolon.
1803 * semantics.c (finish_label_stmt): Return new label.
1804 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
1806 2009-06-03 Ian Lance Taylor <iant@google.com>
1808 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
1811 2009-06-02 Mark Mitchell <mark@codesourcery.com>
1813 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
1815 2009-06-02 Jason Merrill <jason@redhat.com>
1819 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1821 * call.c (implicit_conversion): Allow init-list conversion to scalar
1822 during direct-initialization, too. Mark the conversion bad if it
1823 has too many levels of braces.
1824 (convert_like_real): And give a helpful error.
1828 * decl.c (cp_finish_decl): Handle auto deduction from ().
1829 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1830 with dependent type that is known to be a pointer.
1832 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
1835 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1836 specializations in an invalid namespace.
1838 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
1840 * error.c (print_instantiation_partial_context): Print column
1843 2009-05-29 Ian Lance Taylor <iant@google.com>
1845 * error.c (cp_printer): Don't use va_arg with enum type.
1847 2009-05-28 Dodji Seketeli <dodji@redhat.com>
1850 * cp-tree.h (canonical_type_variant): Remove this function declaration.
1851 (strip_typedefs): New function declaration.
1852 * tree.c (strip_typedefs): New function definition.
1853 (canonical_type_variant): Remove function definition.
1854 * cvt.c (convert_from_reference): No need to use
1855 canonical_type_variant.
1856 * typeck.c (cp_build_indirect_ref): Likewise.
1857 * error.c (dump_template_bindings): Use strip_typedefs instead of
1858 canonical_type_variant.
1859 * pt.c (convert_template_argument, unify): Likewise.
1860 * mangle.c (canonicalize_for_substitution): Don't use
1861 canonical_type_variant.
1863 2009-05-27 Jason Merrill <jason@redhat.com>
1865 * call.c (implicit_conversion): Handle conversion from
1866 initializer-list to scalar.
1867 (convert_like_real): Likewise. Avoid crashing on list
1868 initialization with bad conversions.
1869 (can_convert): Use LOOKUP_EXPLICIT.
1870 (can_convert_arg_bad): Add flags parm.
1871 * cp-tree.h: Adjust.
1872 * typeck.c (convert_for_assignment): Pass flags.
1874 2009-05-27 Ian Lance Taylor <iant@google.com>
1876 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1877 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1879 2009-05-26 Ian Lance Taylor <iant@google.com>
1881 * Make-lang.in (g++spec.o): Use $(COMPILER).
1882 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1883 (cc1plus$(exeext)): Likewise.
1885 2009-05-26 Dodji Seketeli <dodji@redhat.com>
1888 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1889 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1890 (get_types_needing_access_check): Declare new entry point.
1891 * pt.c (append_type_to_template_for_access_check_1,
1892 get_types_needing_access_check): New functions.
1893 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1894 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1895 get_types_needing_access_check, no more
1896 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1897 (instantiate_class_template): Set input_location to the source
1898 location of the most specialized template definition.
1899 Perform access check using the RECORD_TYPE of the template, not its
1900 associated most generic TEMPLATE_DECL.
1901 (append_type_to_template_for_access_check): Augment function
1902 comments. Use the new get_types_needing_access_check, not
1903 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1904 append_type_to_template_for_access_check_1 subroutine.
1906 2009-05-22 Jason Merrill <jason@redhat.com>
1909 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1910 arithmetic comparisons.
1911 (cp_common_type): Handle scoped enums.
1913 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1914 (add_builtin_candidate, add_builtin_candidates): Likewise.
1915 (convert_like_real): Likewise.
1916 * class.c (check_bitfield_decl): Likewise.
1917 * decl.c (check_static_variable_definition): Likewise.
1918 (compute_array_index_type): Likewise.
1919 * decl2.c (grokbitfield): Likewise.
1920 * init.c (build_new_1): Likewise.
1921 * pt.c (convert_nontype_argument): Likewise.
1922 (current_instantiation): Likewise.
1923 * tree.c (pod_type_p): Likewise.
1924 * typeck.c (build_static_cast_1): Likewise.
1925 (build_reinterpret_cast_1): Likewise.
1927 2009-05-22 Richard Guenther <rguenther@suse.de>
1930 * init.c (avoid_placement_new_aliasing): Remove.
1931 (build_new_1): Do not call it.
1933 2009-05-22 Mark Mitchell <mark@codesourcery.com>
1935 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1936 * semantics.c (expand_or_defer_fn): Similarly.
1938 2009-05-20 Ian Lance Taylor <iant@google.com>
1940 * parser.c (cp_parser_postfix_expression): Change args to a vec.
1941 Release it when done.
1942 (tree_vector): Define typedef. Define VEC functions.
1943 (cp_parser_parenthesized_expression_list): Change return type to
1944 vec. Change all callers.
1945 (cp_parser_new_expression): Change placement and initializer to
1946 vecs. Release them when done.
1947 (cp_parser_new_placement): Change return type to vec. Change all
1949 (cp_parser_new_initializer): Likewise.
1950 * typeck.c (build_function_call_vec): Just call
1951 cp_build_function_call_vec.
1952 (cp_build_function_call): Just build a vec and call
1953 cp_build_function_call_vec.
1954 (cp_build_function_call_vec): New function based on old
1955 cp_build_function_call.
1956 (convert_arguments): Remove nargs and argarray parameters. Change
1957 values to a vec. Change caller.
1958 (build_x_compound_expr_from_vec): New function.
1959 (cp_build_modify_expr): Build vec to pass to
1960 build_special_member_call.
1961 * call.c (struct z_candidate): Add first_arg field. Change args
1963 (convert_class_to_reference): Handle first argument separately.
1964 (add_candidate): Add first_arg parameter. Change args parameter
1965 to vec. Change all callers.
1966 (add_function_candidate, add_conv_candidate): Likewise.
1967 (add_template_candidate_real, add_template_candidate): Likewise.
1968 (add_template_conv_candidate): Likewise.
1969 (build_user_type_conversion_1): Handle first argument separately.
1970 (resolve_args): Change return type and parameter type to vecs.
1972 (perform_overload_resolution): Change args parameter to vec.
1974 (build_new_function_call, build_operator_new_call): Likewise.
1975 (add_candidates): Likewise.
1976 (build_op_call): New globally visible function, built from and
1977 replacing static function build_object_call.
1978 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
1980 (build_op_delete_call): Build vec to pass to
1981 cp_build_function_call_vec.
1982 (build_temp): Build vec to pass to build_special_member_call.
1983 (convert_like_real): Likewise.
1984 (perform_direct_initialization_if_possible): Likewise.
1985 (build_over_call): Handle first_arg field. Use build_call_array
1986 rather than build_call_list.
1987 (build_special_member_call): Change args parameter to vec. Change
1989 (build_new_method_call): Likewise.
1990 * init.c (expand_default_init): Change parms to vec.
1991 (build_raw_new_expr): Change placement and init to vecs. Change
1993 (build_new_1, build_new): Likewise.
1994 * class.c (resolve_address_of_overloaded_function): Build array to
1995 pass to fn_type_unification.
1996 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1997 build_new. For CALL_EXPR create a vec rather than a tree_list;
1998 expand a pack if necessary.
1999 (fn_type_unification): Change args parameter to const tree *. Add
2000 nargs parameter. Change all callers.
2001 (type_unification_real): Likewise.
2002 (unify): Build array to pass to type_unification_real.
2003 (get_bindings): Build array to pass to fn_type_unification.
2004 (any_type_dependent_arguments_p): Change args parameter to a vec.
2006 (make_args_non_dependent): Renamed from build_non_dependent_args.
2007 Change return type to void. Change parameter type to vec. Change
2009 (do_auto_deduction): Pass an array to type_unification_real.
2010 * semantics.c (perform_koenig_lookup): Change args to vec. Change
2012 (finish_call_expr): Change args to vec. Change all callers. Call
2013 build_op_call instead of passing CALL_EXPR to build_new_op.
2014 (cxx_omp_create_clause_info): Allocate vec to pass to
2015 build_special_member_call.
2016 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
2017 to vec. Change all callers.
2018 * name-lookup.c (lookup_function_nonclass): Likewise.
2019 (struct arg_lookup): Change args to vec.
2020 (arg_assoc_namespace): Handle args as a vec.
2021 (arg_assoc_args_vec): New static function.
2022 (lookup_arg_dependent): Change args parameter to vec. Change all
2024 * method.c (do_build_assign_ref): Allocate vec to pass to
2025 build_special_member_call.
2026 * except.c (build_throw): Likewise.
2027 * typeck2.c (build_functional_cast): Likewise.
2028 * cvt.c (ocp_convert): Likewise.
2029 * tree.c (build_min_non_dep_call_vec): Change last parameter to
2030 vec. Change all callers.
2031 * cp-tree.h: Update declarations.
2032 * name-lookup.h: Update declarations.
2034 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
2036 * typeck.c (default_conversion): Check targetm.promoted_type.
2037 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
2038 (grokparms): Check targetm.invalid_parameter_type.
2039 * cvt.c (ocp_convert): Check targetm.convert_to_type.
2040 (build_expr_type_conversion): Check targetm.promoted_type.
2042 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
2044 * typeck.c (build_binary_op): Allow % on integal vectors.
2046 2009-05-18 Jason Merrill <jason@redhat.com>
2048 Implement explicit conversions ops as specified in N2437.
2049 * decl.c (grokdeclarator): Handle explicit conversion ops.
2050 (check_initializer): Pass flags to store_init_value.
2051 * decl2.c (maybe_emit_vtables): Likewise.
2052 * init.c (expand_aggr_init_1): Likewise.
2053 * call.c (convert_class_to_reference): Take flags parm,
2054 check DECL_NONCONVERTING_P.
2055 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
2056 (add_builtin_candidates): Simplify getting type of conversion.
2057 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
2058 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
2059 (reference_binding): Take flags parm. Direct-initialize copy parm.
2060 (add_function_candidate): Direct-initialize the copy parm.
2061 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
2062 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
2063 (conditional_conversion): Likewise.
2064 (convert_like_real): Only complain about DECL_NONCONVERTING_P
2066 (perform_implicit_conversion_flags): Add flags parm to
2067 perform_implicit_conversion. Improve diagnostics.
2068 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
2069 (LOOKUP_COPY_PARM): New bit macro.
2070 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
2071 * typeck.c (convert_for_assignment): Take flags parm, pass it to
2072 perform_implicit_conversion_flags.
2073 (cp_build_modify_expr): Pass flags to convert_for_assignment.
2074 (convert_for_initialization): Likewise.
2075 * typeck2.c (store_init_value): Take flags parm, pass to
2077 (digest_init_flags): Add flags parm to digest_init.
2078 (digest_init_r): Take flags parm, pass to convert_for_initialization.
2079 (process_init_constructor_array): Pass it.
2080 (process_init_constructor_record): Likewise.
2081 (process_init_constructor_union): Likewise.
2083 2009-05-16 Jason Merrill <jason@redhat.com>
2086 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
2087 with a dependent type. Actually look up the destructor.
2088 * semantics.c (finish_id_expression): Fix logic.
2089 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
2091 * typeck.c (build_x_unary_op): Diagnose taking the address of a
2092 constructor or destructor.
2093 * tree.c (get_first_fn): Handle OFFSET_REF.
2095 2009-05-17 Joseph Myers <joseph@codesourcery.com>
2097 * tree.c (cxx_printable_name_internal): Allow consecutive
2098 translated and untranslated cached copies of the name of the
2101 2009-05-15 Ian Lance Taylor <iant@google.com>
2103 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
2104 cp_lvalue_kind. Change all uses.
2105 (enum base_access_flags): Rename from enum base_access. Change
2107 * parser.c (enum cp_parser_flags): Remove enum tag.
2109 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
2112 * call.c (build_new_op): Update calls to warn_logical_operator.
2114 2009-05-14 Ian Lance Taylor <iant@google.com>
2116 * class.c (layout_class_type): Change itk to unsigned int.
2117 * decl.c (finish_enum): Change itk to unsigned int.
2118 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
2121 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
2123 * decl.c (duplicate_decls): Preserve parameter attributes.
2125 2009-05-10 Jan Hubicka <jh@suse.cz>
2127 * decl2.c (cxx_callgraph_analyze_expr): Use
2128 cgraph_mark_address_taken.
2130 2009-05-10 Joseph Myers <joseph@codesourcery.com>
2132 * call.c (name_as_c_string): Call type_as_string_translate.
2133 Translate identifiers to locale character set.
2134 * cp-tree.h (lang_decl_name): Update prototype.
2135 (type_as_string_translate, decl_as_string_translate,
2136 cxx_printable_name_translate): Declare.
2137 * cxx-pretty-print.c (M_): Define.
2138 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
2139 English fragments for conditional translation with M_.
2140 * decl.c (grokdeclarator): Translate identifiers to locale
2141 character set for diagnostics.
2142 * error.c (M_): Define.
2143 (dump_template_bindings, dump_type, dump_aggr_type,
2144 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
2145 dump_function_decl, dump_template_parms, dump_expr,
2146 dump_binary_op, op_to_string, assop_to_string): Mark English
2147 fragments for conditional translation with M_.
2148 (type_as_string): Disable translation of identifiers.
2149 (type_as_string_translate): New.
2150 (expr_as_string): Disable translation of identifiers.
2151 (decl_as_string): Disable translation of identifiers.
2152 (decl_as_string_translate): New.
2153 (lang_decl_name): Add parameter translate.
2154 (args_to_string): Call type_as_string_translate.
2155 (cp_print_error_function): Call cxx_printable_name_translate.
2156 (print_instantiation_full_context,
2157 print_instantiation_partial_context): Call
2158 decl_as_string_translate.
2159 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
2160 identifier in diagnostic.
2161 * tree.c (cxx_printable_name): Change to
2162 cxx_printable_name_internal. Add parameter translate.
2163 (cxx_printable_name, cxx_printable_name_translate): New wrappers
2164 round cxx_printable_name_internal.
2166 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
2169 * call.c (build_call_a): Updated warn_deprecated_use call.
2170 (build_over_call): Likewise.
2171 * decl.c (grokdeclarator): Likewise.
2172 (grokparms): Likewise.
2173 * semantics.c (finish_id_expression): Likewise.
2174 * typeck.c (build_class_member_access_expr): Likewise.
2175 (finish_class_member_access_expr): Likewise.
2177 2009-05-06 Dodji Seketeli <dodji@redhat.com>
2180 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
2181 whole list of PARM_DECLs, just the current one.
2183 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
2186 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
2187 mangle_compound_literal): Remove unused declarations.
2188 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
2189 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
2190 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
2191 check_for_out_of_scope_variable, print_other_binding_stack,
2192 maybe_push_decl, cxx_mark_addressable, force_target_expr,
2193 build_target_expr_with_type, finish_case_label,
2194 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
2195 check_template_keyword, cxx_omp_predetermined_sharing,
2196 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
2197 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
2198 cxx_omp_privatize_by_reference): Rearrange the declarations line to
2199 match the comment that indicates the .c file which the functions are
2201 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
2202 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
2204 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
2206 * typeck.c (cp_build_compound_expr): Require RHS to have a known
2208 * class.c (resolve_address_of_overloaded_function): Use
2209 OVL_CURRENT for error message.
2210 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
2211 with them. Do not copy the node.
2213 2009-05-05 Jakub Jelinek <jakub@redhat.com>
2216 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
2217 set it from its operand's type after tsubst_expr.
2219 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2222 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
2223 canonical spelling for keywords.
2224 (cp_parser_attribute_list): Use the canonical spelling for
2225 keywords in attributes.
2227 2009-05-01 Joseph Myers <joseph@codesourcery.com>
2229 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
2230 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
2231 pp_cxx_new_expression, pp_cxx_delete_expression,
2232 pp_cxx_unary_expression, pp_cxx_assignment_operator,
2233 pp_cxx_assignment_expression, pp_cxx_expression,
2234 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
2235 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
2236 pp_cxx_exception_specification, pp_cxx_direct_declarator,
2237 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
2238 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
2239 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
2240 pp_cxx_declaration, pp_cxx_typeid_expression,
2241 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
2242 pp_cxx_trait_expression): Mostly use pp_string and
2243 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
2244 for non-identifiers. Mark English strings for translation.
2245 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
2246 * error.c (dump_template_parameter, dump_template_bindings,
2247 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
2248 dump_decl, dump_template_decl, dump_function_decl,
2249 dump_parameters, dump_exception_spec, dump_template_parms,
2250 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
2251 assop_to_string, args_to_string, cp_print_error_function,
2252 print_instantiation_full_context,
2253 print_instantiation_partial_context): Mostly use pp_string and
2254 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
2255 for non-identifiers. Mark English strings for translation.
2256 (dump_global_iord): Mark strings for translation; use longer
2257 strings instead of substituting single words.
2258 (function_category): Return a format string marked for
2259 translation, not a single word or phrase to substitute in a longer
2262 2009-04-28 Ben Elliston <bje@au.ibm.com>
2267 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2269 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2271 2009-04-27 Ian Lance Taylor <iant@google.com>
2273 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
2276 2009-04-27 Jakub Jelinek <jakub@redhat.com>
2279 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
2280 -Wunused-value if implicit.
2282 2009-04-24 Ian Lance Taylor <iant@google.com>
2284 * call.c (build_temp): Change 0 to enum constant.
2285 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
2287 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
2288 * decl2.c (constrain_visibility): Likewise.
2289 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
2290 (cp_parser_flags): Typedef to int rather than enum type.
2291 (cp_parser_expression_stack_entry): Change prec field to enum
2294 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
2297 2009-04-22 Dodji Seketeli <dodji@redhat.com>
2300 * parser.c (cp_parser_template_argument_list): Display an error
2301 when an ellipsis is not preceded by a parameter pack. Also, warn
2302 about variadic templates usage without -std=c++0x.
2304 2009-04-21 Taras Glek <tglek@mozilla.com>
2306 * cp-tree.h: Update GTY annotations to new syntax.
2308 * mangle.c: Likewise.
2309 * name-lookup.c: Likewise.
2310 * name-lookup.h: Likewise.
2311 * parser.c: Likewise.
2314 * semantics.c: Likewise.
2315 * typeck2.c: Likewise.
2317 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2320 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
2322 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2325 * typeck.c (check_for_casting_away_constness): We diagnose casting
2326 away any qualifiers not just constness.
2327 (casts_away_constness): Mention that it handles more than just
2330 2009-04-21 Joseph Myers <joseph@codesourcery.com>
2332 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
2333 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
2334 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
2335 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
2336 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
2337 cfns.gperf: Add copyright and license notices.
2338 * cfns.h: Regenerate.
2339 * ChangeLog, ChangeLog-2004: Correct dates.
2341 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2344 * tree.c (lvalue_p_1): Use const_tree.
2345 Use CONST_CAST_TREE to avoid warning.
2346 (lvalue_p): Returns bool, receives const_tree.
2348 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2351 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
2352 * error.c (pedwarn_cxx98): New.
2353 * cp-tree.h (pedwarn_cxx98): Declare.
2355 2009-04-20 Le-Chun Wu <lcwu@google.com>
2358 * init.c (build_vec_init): Set TREE_NO_WARNING on the
2359 compiler-generated INDIRECT_REF expression.
2361 2009-04-20 Ian Lance Taylor <iant@google.com>
2363 * typeck.c (build_function_call_vec): New function.
2364 (cp_build_function_call): Only pass first parameter to
2365 objc_rewrite_function_call.
2366 (build_modify_expr): Add rhs_origtype parameter. Change all
2368 * decl.c (finish_decl): Add origtype parameter. Change all
2370 * semantics.c (finish_call_expr): Pass VEC to
2371 resolve_overloaded_builtin.
2373 2009-04-20 Ian Lance Taylor <iant@google.com>
2375 * cp-tree.h (base_access): Change typedef to int.
2376 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
2377 (cp_parser_omp_threadprivate): Likewise.
2378 * pt.c (unify_pack_expansion): Add casts to enum type.
2380 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
2384 * call.c (build_new_op): Save the original codes of operands
2387 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
2389 * cp-tree.h: Remove the prototype for insert_block.
2390 * decl.c (insert_block): Remove.
2392 2009-04-16 Ian Lance Taylor <iant@google.com>
2394 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
2395 (tsubst_flags_t): Change typedef from enum type to int.
2397 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
2399 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
2400 instead of targetm.vector_opaque_p.
2402 2009-04-15 Le-Chun Wu <lcwu@google.com>
2405 * call.c (build_over_call): Set TREE_NO_WARNING on the
2406 compiler-generated INDIRECT_REF expression.
2407 * cvt.c (convert_to_void): Emit warning when stripping off
2410 2009-04-14 Diego Novillo <dnovillo@google.com>
2412 * parser.c (cp_parser_type_specifier_seq): Move call to
2413 invoke_plugin_callbacks ...
2414 (cp_parser_type_specifier_seq): ... here.
2416 2009-04-14 Le-Chun Wu <lcwu@google.com>
2418 * Make-lang.in: Modify dependencies of files including plugin.h.
2419 * decl.c (finish_function): Call invoke_plugin_callbacks.
2420 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
2422 2009-04-14 Jason Merrill <jason@redhat.com>
2425 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
2426 about shadowing by tentative parms.
2428 2009-04-13 Jason Merrill <jason@redhat.com>
2431 * call.c (build_over_call): Don't call memcpy if the target is
2432 the same as the source.
2434 2009-04-13 Jason Merrill <jason@redhat.com>
2437 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
2439 2009-04-12 Jason Merrill <jason@redhat.com>
2442 * call.c (joust): Don't crash on variadic fn.
2444 2009-04-10 Jason Merrill <jason@redhat.com>
2447 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
2448 if we see a close brace without an open brace.
2450 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
2452 * parser.c (cp_parser_class_specifier): Remove the unused
2453 has_trailing_semicolon.
2455 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
2458 * parser.c (cp_parser_check_template_parameters): Take a
2459 cp_declarator parameter.
2460 (cp_parser_elaborated_type_specifier): Update to
2461 cp_parser_check_template_parameters.
2462 (cp_parser_class_head): Likewise.
2463 (cp_parser_check_declarator_template_parameters): Likewise.
2464 (cp_parser_check_template_parameters): Handle first the non-error
2465 conditions. Give more accurate diagnostics if a declarator is
2468 2009-04-08 Jason Merrill <jason@redhat.com>
2471 * error.c (dump_aggr_type): Chase template typedefs if
2472 -fno-pretty-templates.
2474 2009-04-08 Dodji Seketeli <dodji@redhat.com>
2477 * parser.c (cp_parser_enumerator_definition): Make sure the
2478 initializer of the enumerator doesn't contain any bare parameter pack.
2480 2009-04-07 Jason Merrill <jason@redhat.com>
2483 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
2484 * call.c (joust): Complain about mismatched default arguments
2485 in extern "C" functions.
2486 * class.c (resolve_address_of_overloaded_function): Handle multiple
2487 extern "C" functions.
2488 * pt.c (resolve_overloaded_unification): Likewise.
2490 2009-04-07 Jason Merrill <jason@redhat.com>
2493 * error.c (dump_function_decl): Don't pretty-print templates
2494 if -fno-pretty-templates.
2495 (count_non_default_template_args): Print all args if
2496 -fno-pretty-templates.
2498 2009-04-06 Jason Merrill <jason@redhat.com>
2501 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
2502 the deduced template arguments give us the parameter types
2505 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
2506 Jason Merrill <jason@redhat.com>
2509 * error.c (count_non_default_template_args): New fn.
2510 (dump_template_parms): Call it.
2511 (dump_template_argument_list): Call it. Add parms parm.
2512 (dump_template_argument): Adjust call to dump_template_argument_list.
2513 (dump_type, dump_decl): Likewise.
2514 (dump_template_bindings): Refactor logic.
2516 2009-04-03 Jason Merrill <jason@redhat.com>
2519 * error.c (dump_template_bindings): Look through typedefs in
2521 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
2522 (find_typenames_r): Also collect typedefs.
2523 * pt.c (unify): Strip typedefs.
2526 * semantics.c (finish_id_expression): Don't assume a dependent
2527 member of the current instantiation isn't a valid integral
2528 constant expression. Check dependent_scope_p.
2529 * pt.c (dependent_scope_p): Check TYPE_P.
2530 (tsubst_copy): If args is null, just return.
2532 2009-04-02 Jason Merrill <jason@redhat.com>
2535 * error.c (find_typenames, find_typenames_r): New fns.
2536 (dump_function_decl): Call find_typenames.
2537 (dump_template_bindings): Print typenames as well.
2538 * pt.c (tsubst): Non-static.
2539 * cp-tree.h: Declare it.
2541 2009-04-02 Dodji Seketeli <dodji@redhat.com>
2544 * decl2.c (grokfield): when a typedef appears in a
2545 class, create the typedef variant type node for it.
2546 (save_template_attributes): Creating typedef variant type node
2547 here is now useless.
2548 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2549 anonymous, set the proper type name to all its type variants.
2550 (xref_basetypes) : Fixup the variant types after setting
2552 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2553 set_underlying_type function to install typedef variant types.
2554 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2556 (append_type_to_template_for_access_check): New entry points.
2557 * semantics.c (check_accessibility_of_qualified_id):
2558 When a typedef that is a member of a class appears in a template,
2559 add it to the template. It will be ...
2560 * class.c (finish_struct_bits): Split type variant fixup into ...
2561 (fixup_type_variants): A new entry point.
2562 * pt.c (instantiate_class_template, instantiate_template ): ... access
2563 checked at template instantiation time.
2564 (resolve_type_name_type): The type name should be the name of the
2566 (retrieve_specialization): Specializations of template typedefs aren't
2567 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
2568 (append_type_to_template_for_access_check): New entry point.
2569 (tsubst_decl): For typedefs, build the variant type from the correct
2571 (get_class_bindings): Fix function comment.
2572 (perform_typedefs_access_check): New entry point.
2574 2009-03-31 Jason Merrill <jason@redhat.com>
2577 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
2578 extern "C" declarations.
2581 * semantics.c (finish_non_static_data_member): Allow such references
2582 without an associated object in sizeof/decltype/alignof.
2584 * ptree.c (cxx_print_decl): Pretty-print full name of
2586 (cxx_print_type): Pretty-print full name of class.
2588 * decl.c (grokdeclarator): Reject pointer to qualified function
2591 PR c++/37806, core issue 547
2592 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
2594 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
2596 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
2597 * decl.c (groktypename): Add is_template_arg parameter.
2598 (grokdeclarator): Allow function cv-quals on a template type arg.
2599 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
2600 is_template_arg argument in calls to groktypename.
2601 * cp-tree.h: Adjust prototype.
2602 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
2603 FUNCTION_TYPE printing.
2605 * mangle.c (write_expression): Mangle dependent name as
2608 PR c++/38030, 38850, 39070
2609 * pt.c (type_dependent_expression_p_push): New fn.
2610 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
2611 substitution makes the call non-dependent. Preserve koenig_p.
2612 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
2613 for non-dependent calls.
2614 * semantics.c (finish_call_expr): Revert earlier changes.
2615 * cp-tree.h: Revert change to finish_call_expr prototype.
2617 2009-03-29 Joseph Myers <joseph@codesourcery.com>
2619 PR preprocessor/34695
2620 * cp-tree.h (cp_cpp_error): Remove.
2621 * error.c (cp_cpp_error): Remove.
2622 * parser.c (cp_lexer_new_main): Set done_lexing instead of
2623 client_diagnostic and error callback.
2625 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
2627 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2628 * cp/cp-objcp-common.c (cxx_staticp): Remove.
2629 * cp/cp-tree.h (cxx_staticp): Remove.
2631 2009-03-28 Jakub Jelinek <jakub@redhat.com>
2634 * parser.c (cp_parser_postfix_expression): Don't call
2635 warning_if_disallowed_function_p.
2637 2009-03-27 Jan Hubicka <jh@suse.cz>
2639 * except.c (choose_personality_routine): Set terminate_node to abort
2640 for java exceptions.
2642 2009-03-27 Dodji Seketeli <dodji@redhat.com>
2643 Jakub Jelinek <jakub@redhat.com>
2646 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
2647 (cp_function_decl_explicit_p): New prototype.
2648 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
2650 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
2653 * parser.c (cp_parser_elaborated_type_specifier): If we have a
2654 typename tag and don't have either a TYPE_DECL or a
2655 TEMPLATE_ID_EXPR, set the type to NULL.
2657 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2660 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
2663 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2666 * decl.c (check_array_designated_initializer): Handle error_mark_node.
2668 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2671 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2673 2009-03-26 Andrew Haley <aph@redhat.com>
2676 * decl2.c (possibly_inlined_p): If java exceptions are in use
2677 don't inline a decl unless it is explicitly marked inline.
2678 * lex.c: (pragma_java_exceptions): New variable.
2679 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
2680 * cp-tree.h (pragma_java_exceptions): Declare new variable.
2682 2009-03-24 Jason Merrill <jason@redhat.com>
2685 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
2687 2009-03-23 Jakub Jelinek <jakub@redhat.com>
2690 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
2691 code if iter is the second operand.
2692 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
2693 argument. If it is set, don't build the toplevel expression with
2694 build_x_binary_op, but build2.
2695 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
2697 (cp_parser_omp_for_cond): Don't assume the first operand of the
2698 comparison must be decl.
2700 2009-03-23 Jason Merrill <jason@redhat.com>
2703 * pt.c (make_fnparm_pack): Split out from...
2704 (instantiate_decl): ...here.
2705 (tsubst_pack_expansion): Handle being called in a late-specified
2709 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
2712 2009-03-20 Jason Merrill <jason@redhat.com>
2715 * parser.c (cp_parser_direct_declarator): In a template, wrap
2716 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
2717 * pt.c (tsubst): Preserve it in a partial instantiation.
2718 (dependent_type_p_r): Don't check value_dependent_expression_p.
2719 * decl.c (compute_array_index_type): Don't check
2720 value_dependent_expression_p if TREE_SIDE_EFFECTS.
2723 * typeck2.c (check_narrowing): Don't complain about loss of
2724 precision when converting a floating-point constant.
2726 2009-03-19 Jakub Jelinek <jakub@redhat.com>
2729 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
2730 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
2732 2009-03-18 Jakub Jelinek <jakub@redhat.com>
2734 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
2735 (eof_token): Adjust.
2737 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
2740 * parser.c (cp_parser_explicit_specialization): Don't skip the
2741 rest of the specialization when begin_specialization returns
2744 2009-03-17 Jason Merrill <jason@redhat.com>
2746 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
2747 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
2748 * pt.c (check_explicit_specialization): Likewise.
2749 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
2750 local specialization.
2751 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
2752 * decl2.c (parm_index): New fn.
2753 * semantics.c (finish_decltype_type): Don't use describable_type.
2754 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
2755 Give a sorry for unsupported codes rather than crash. Mangle
2756 conversions with other than 1 operand. New mangling for PARM_DECL.
2757 * operators.def (ALIGNOF_EXPR): Mangle as "az".
2759 2009-03-17 Jing Yu <jingyu@google.com>
2762 * method.c (use_thunk): Change is_thunk from crtl to cfun.
2764 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2767 * semantics.c (check_trait_type): New.
2768 (finish_trait_expr): Use it.
2770 2009-03-17 Jakub Jelinek <jakub@redhat.com>
2772 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
2773 instead of calling imported_module_or_decl debug hook if
2774 building_stmt_tree ().
2775 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
2776 is a NAMESPACE_DECL.
2779 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
2780 hook at function scope.
2783 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
2786 2009-03-09 Jakub Jelinek <jakub@redhat.com>
2789 * semantics.c (finish_switch_cond): Don't call get_unwidened.
2790 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
2791 instead of TREE_TYPE (cond).
2793 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
2796 * parser.c (cp_parser_late_parsing_default_args): Continue
2797 the loop when cp_parser_assignment_expression returns
2800 2009-03-07 Jason Merrill <jason@redhat.com>
2803 * init.c (build_new_1): Don't use a VLA type.
2804 (build_vec_init): Handle getting a pointer for BASE.
2806 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
2809 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
2810 when mangling symbols.
2812 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2815 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
2817 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
2819 * decl.c (record_builtin_java_type): Use canonicalized integer
2822 2009-03-04 Jason Merrill <jason@redhat.com>
2825 * class.c (is_really_empty_class): New fn.
2826 * cp-tree.h: Declare it.
2827 * cp-objcp-common.c (cp_expr_size): Use it.
2830 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2831 * parser.c (cp_parser_postfix_expression): Call it for
2833 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2834 (get_first_fn): Likewise.
2840 * decl.c (make_typename_type): Do look inside currently open classes.
2841 * parser.c (cp_parser_lookup_name): Likewise.
2842 (cp_parser_template_name): Likewise.
2843 * pt.c (dependent_scope_p): New function.
2844 * cp-tree.h: Declare it.
2845 * class.c (currently_open_class): Return fast if T isn't a class.
2847 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
2850 * parser.c (cp_parser_mem_initializer): Return error_mark_node
2851 if cp_parser_mem_initializer_id returns error_mark_node.
2853 2009-02-24 Richard Guenther <rguenther@suse.de>
2856 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2859 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
2862 * pt.c (coerce_template_template_parms): Return 0 if parameter
2865 2009-02-23 Jason Merrill <jason@redhat.com>
2867 * pt.c (unify): Call maybe_adjust_types_for_deduction when
2868 deducing from an initializer list.
2870 2009-02-20 Jason Merrill <jason@redhat.com>
2873 * decl.c (grokdeclarator): Handle ~identifier.
2875 2009-02-19 Jakub Jelinek <jakub@redhat.com>
2878 * decl2.c (determine_visibility): If visibility changed and
2879 DECL_RTL has been already set, call make_decl_rtl to update symbol
2882 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
2885 * cp-tree.h (maybe_commonize_var): New.
2887 * decl.c (maybe_commonize_var): Make it extern.
2889 * decl2.c (finish_anon_union): Call maybe_commonize_var.
2891 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
2894 * parser.c (cp_parser_enum_specifier): Apply all attributes.
2896 2009-02-18 Jason Merrill <jason@redhat.com>
2898 * cfns.h: Tweak pathname for cfns.gperf.
2900 2009-02-13 Jason Merrill <jason@redhat.com>
2903 * semantics.c (finish_call_expr): Change koenig_p parm to int.
2904 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2905 * cp-tree.h: Adjust prototype.
2906 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2908 2009-02-12 Jason Merrill <jason@redhat.com>
2911 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2913 2009-02-11 Jason Merrill <jason@redhat.com>
2916 * decl2.c (cp_write_global_declarations):
2917 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2920 * init.c (build_value_init_noctor): Split out from...
2921 (build_value_init): ...here.
2922 (expand_aggr_init_1): Handle value-initialization.
2923 * cp-tree.h: Add declaration.
2924 * class.c (type_has_user_provided_constructor):
2925 Handle non-class arguments.
2927 2009-02-10 Jason Merrill <jason@redhat.com>
2930 * class.c (defaultable_fn_p): Handle ... properly.
2933 * tree.c (lvalue_p_1): Condition rvalue ref handling on
2934 treat_class_rvalues_as_lvalues, too.
2936 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2939 * typeck.c (build_x_array_ref): New.
2940 * cp-tree.h: Declare it.
2941 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2943 2009-02-09 Jason Merrill <jason@redhat.com>
2946 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2947 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2948 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2949 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2950 for build_value_init TARGET_EXPR.
2951 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2953 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
2957 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2959 2009-02-04 Jakub Jelinek <jakub@redhat.com>
2962 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2963 remove ./dt operator.
2964 * mangle.c (write_expression): Handle COMPONENT_REF after handling
2965 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2966 write_string ("dt") instead of using operators.def.
2968 2009-02-03 Jason Merrill <jason@redhat.com>
2970 * typeck.c (cp_build_unary_op): Only complain about taking address
2971 of main if pedantic.
2973 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2976 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2979 * typeck2.c (digest_init_r): Don't call process_init_constructor
2982 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
2985 * pt.c (convert_nontype_argument_function): Expect expr to be an
2989 * typeck.c (merge_types): Call resolve_typename_type if only
2990 one type is a typename.
2992 2009-02-02 Jason Merrill <jason@redhat.com>
2995 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
2998 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
3001 * parser.c (cp_parser_pure_specifier): If there are no tokens left
3002 do not call cp_lexer_consume_token.
3004 2009-01-30 Jakub Jelinek <jakub@redhat.com>
3007 * parser.c (cp_parser_already_scoped_statement): Handle __label__
3010 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3013 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
3015 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
3018 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
3020 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
3022 * typeck.c (invalid_nonstatic_memfn_p): Use
3023 DECL_NONSTATIC_MEMBER_FUNCTION_P.
3025 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
3028 * call.c (build_over_call): If convert_for_arg_passing returns
3029 error_mark_node unconditionally return it.
3031 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
3033 * class.c (check_field_decls): Also inherit packed for bitfields
3034 regardless of their type.
3036 2009-01-22 Dodji Seketeli <dodji@redhat.com>
3039 * decl2.c (grokfield): Reverting changes of PR c++/26693
3040 (save_template_attributes): Likewise.
3041 * decl.c (grokdeclarator): Likewise.
3042 * name-lookup.c (pushdecl_maybe_friend): Likewise.
3043 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
3044 (append_type_to_template_for_access_check): Likewise.
3045 * semantics.c (check_accessibility_of_qualified_id): Likewise.
3046 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
3048 (resolve_type_name_type): Likewise.
3049 (append_type_to_template_for_access_check): Likewise.
3051 2009-01-21 Dodji Seketeli <dodji@redhat.com>
3054 * decl2.c (grokfield): when a typedef appears in a
3055 class, create the typedef variant type node for it.
3056 (save_template_attributes): Creating typedef variant type node
3057 here is now useless.
3058 * decl.c (grokdeclarator): If the typedef'ed struct/class was
3059 anonymous, set the proper type name to all its type variants.
3060 * name-lookup.c (pushdecl_maybe_friend): Reuse the
3061 set_underlying_type function to install typedef variant types.
3062 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
3064 (append_type_to_template_for_access_check): New entry points.
3065 * semantics.c (check_accessibility_of_qualified_id):
3066 When a typedef that is a member of a class appears in a template,
3067 add it to the template. It will be ...
3068 * pt.c (instantiate_class_template, instantiate_template ): ... access
3069 checked at template instantiation time.
3070 (tsubst): Handle the case of being called with NULL args.
3071 (resolve_type_name_type): The type name should be the name of the
3073 (append_type_to_template_for_access_check): New entry point.
3075 2009-01-19 Jason Merrill <jason@redhat.com>
3078 * parser.c (cp_parser_unqualified_id): In a template,
3080 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
3082 2009-01-16 Jason Merrill <jason@redhat.com>
3085 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
3086 * init.c (build_new): Don't call describable_type unless we
3090 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
3093 * search.c (protected_accessible_p): N doesn't vary.
3095 2009-01-15 Jason Merrill <jason@redhat.com>
3098 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
3099 accept hidden friends.
3101 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
3104 * decl.c (grokdeclarator): Check for a non namespace/class context.
3106 2009-01-15 Jason Merrill <jason@redhat.com>
3110 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
3111 a function isn't necessarily an lvalue. Take tree, not const_tree.
3112 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
3113 * typeck.c (lvalue_or_else): Likewise.
3114 * cp-tree.h: Adjust prototypes.
3116 2009-01-15 Steve Ellcey <sje@cup.hp.com>
3119 * pt.c (tsubst): Check for NULL args.
3121 2009-01-15 Dodji Seketeli <dodji@redhat.com>
3124 * name-lookup.c (pushtag): Don't create members to types that are not
3127 2009-01-14 Nick Clifton <nickc@redhat.com>
3130 * parser.c: Pass cp_id_kind computed in
3131 cp_parser_postfix_dot_deref_expression to
3132 cp_parser_primary_expression.
3134 2009-01-13 Jakub Jelinek <jakub@redhat.com>
3137 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
3138 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
3141 2009-01-12 Jason Merrill <jason@redhat.com>
3142 Steve Ellcey <sje@cup.hp.com>
3145 * name-lookup.c (lookup_name_real): Keep looking past a hidden
3148 2009-01-12 Dodji Seketeli <dodji@redhat.com>
3151 * pt.c (parameter_of_template_p): New function.
3152 * cp-tree.h: Declare it.
3153 * name-lookup.c (binding_to_template_parms_of_scope_p): New
3155 (outer_binding): Take template parameters in account when looking for
3158 2009-01-12 Jason Merrill <jason@redhat.com>
3161 * tree.c (pod_type_p): Return 1 for structs created by the back end.
3163 2009-01-12 Jakub Jelinek <jakub@redhat.com>
3166 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
3167 offsetof member-designator, handle it as `[0].'.
3170 * decl.c (start_function): If grokdeclarator hasn't returned
3171 FUNCTION_DECL nor error_mark_node, issue diagnostics.
3173 2009-01-11 Jakub Jelinek <jakub@redhat.com>
3176 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
3177 (gimplify_if_stmt): ... this.
3178 (cp_gimplify_expr): Don't handle IF_STMT here.
3179 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
3181 2009-01-10 Andrew Pinski <pinskia@gmail.com>
3184 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
3187 * typeck2.c (build_functional_cast): Check for reference type and NULL
3190 2009-01-09 Steve Ellcey <sje@cup.hp.com>
3192 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
3194 2009-01-09 Jakub Jelinek <jakub@redhat.com>
3197 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
3199 2009-01-09 John F. Carr <jfc@mit.edu>
3202 * parser.c (cp_parser_class_specifier): Clear
3203 parser->in_unbraced_linkage_specification_p while parsing class
3206 2009-01-07 Jakub Jelinek <jakub@redhat.com>
3209 * semantics.c (finish_goto_stmt): Convert destination to
3212 2009-01-06 Jason Merrill <jason@redhat.com>
3219 * pt.c (check_default_tmpl_args): Don't complain about
3220 out-of-order parameter packs in the enclosing class
3221 or parameter packs after default args.
3222 (coerce_template_parms): If we have more than one
3223 parameter pack, don't flatten argument packs.
3224 (template_args_equal): Handle argument packs.
3225 (comp_template_args): Don't flatten argument packs.
3226 (check_instantiated_arg): Split out from...
3227 (check_instantiated_args): Here. Handle arg packs.
3228 (convert_template_argument): Just check that nontype argument
3229 packs have the right type.
3231 2009-01-05 Dodji Seketeli <dodji@redhat.com>
3234 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
3236 2009-01-05 Jason Merrill <jason@redhat.com>
3239 * typeck2.c (process_init_constructor_union): Handle union with
3242 * mangle.c (write_expression): Remove mangling for zero-operand
3246 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
3250 * class.c (defaultable_fn_p): Only operator== can be a copy
3251 assignment operator.
3253 2009-01-02 Jason Merrill <jason@redhat.com>
3256 * typeck2.c (process_init_constructor_union): Handle excess
3258 (process_init_constructor_record): Likewise.
3261 * typeck2.c (digest_init_r): Don't use process_init_constructor
3262 for non-aggregate classes.
3265 Copyright (C) 2009 Free Software Foundation, Inc.
3267 Copying and distribution of this file, with or without modification,
3268 are permitted in any medium without royalty provided the copyright
3269 notice and this notice are preserved.