1 2009-08-10 Jason Merrill <jason@redhat.com>
3 Implement DR 757: It's OK for a decl to use a type without linkage
4 so long as the decl is defined in the current translation unit.
5 * decl2.c (no_linkage_decls): New vector.
6 (mark_used): Add decls that use types with no linkage.
7 (cp_write_global_declarations): Check that they are defined.
8 (decl_defined_p, no_linkage_error): New fns.
9 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
10 (struct lang_decl_base): Add flag.
11 * decl.c (grokfndecl): Don't check type linkage.
12 (grokvardecl): If the type has no linkage, just make sure
13 DECL_LANG_SPECIFIC is set.
14 * pt.c (check_instantiated_arg): Don't check type linkage.
15 * name-lookup.c (is_local_extern): New fn.
16 * name-lookup.h: Declare it.
18 2009-08-05 Jason Merrill <jason@redhat.com>
21 * init.c (build_vec_init): Evaluate the initializer before
22 starting the initialization try block.
24 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
27 * typeck.c (convert_for_assignment): Do not warn for any boolean
28 variant. Use explicit location.
30 2009-08-04 Dodji Seketeli <dodji@redhat.com>
33 * pt.c (tsubst_default_argument): Let access checks of the
34 default argument happen in the context of the current function.
36 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
39 * call.c (build_new_op): Only try prefix operator if -fpermissive,
42 2009-08-04 Dodji Seketeli <dodji@redhat.com>
45 * error.c (lang_decl_name): Print qualified names for decls
48 2009-08-03 Jason Merrill <jason@redhat.com>
49 Jakub Jelinek <jakub@redhat.com>
52 * init.c (build_vec_init): Look through a TARGET_EXPR around a
55 2009-07-31 Jason Merrill <jason@redhat.com>
56 Douglas Gregor <doug.gregor@gmail.com>
58 Remove implicit binding of lvalues to rvalue references (N2831)
59 * call.c (convert_class_to_reference): Binding an lvalue to an
60 rvalue reference is bad. If the user-defined conversion is bad,
61 set bad_p before merging conversions.
62 (maybe_handle_ref_bind): Don't push down bad_p.
63 (reference_binding): Binding an lvalue to an rvalue reference is bad.
64 (convert_like_real): Give a helpful error about binding lvalue
66 (reference_related_p): No longer static.
67 * typeck.c (build_typed_address): New.
68 (build_static_cast_1): Add static_cast from lvalue to &&.
71 2009-07-31 Jason Merrill <jason@redhat.com>
73 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
74 Do direct binding of "rvalues" in memory to rvalue references.
75 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
77 * typeck.c (build_static_cast_1): Do direct binding of memory
78 "rvalues" to rvalue references.
79 * cvt.c (cp_fold_convert): New.
80 * cp-tree.h: Declare it.
82 2009-07-31 Jason Merrill <jason@redhat.com>
84 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
85 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
87 2009-07-29 Jason Merrill <jason@redhat.com>
90 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
91 * error.c (count_non_default_template_args): Pass it.
92 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
94 2009-07-29 Richard Guenther <rguenther@suse.de>
97 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
100 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
103 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
104 with a qualified return type.
106 2009-07-24 Jason Merrill <jason@redhat.com>
109 * call.c (build_op_delete_call): If this is for a new-expression
110 and the op delete is deleted, do nothing.
113 * call.c (compare_ics): Give list-initialization of std::init_list
114 priority over conversion to scalar, too.
116 2009-07-22 Jason Merrill <jason@redhat.com>
118 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
119 (needs_fake_anon): New.
120 (write_name): Check it.
121 (write_nested_name): Add a fake anonymous namespace scope if true.
122 * name-lookup.c (get_anonymous_namespace_name): No longer static.
123 * rtti.c, cp-tree.h: Adjust.
125 2009-07-22 Richard Guenther <rguenther@suse.de>
128 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
130 (cp_genericize_r): ... genericization stage.
131 (cp_genericize): Adjust.
133 2009-07-21 Jason Merrill <jason@redhat.com>
136 * call.c (reference_binding): Implement binding to { }.
137 (initialize_reference): Binding temporary to non-const && is fine.
138 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
140 * decl.c (reshape_init_r): { T } is not an aggregate initializer
143 2009-07-17 Richard Guenther <rguenther@suse.de>
146 * decl.c (finish_function): Do not emit unused result warnings
148 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
149 c_warn_unused_result_pass.
150 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
151 * optimize.c (clone_body): Clone in GENERIC.
152 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
153 * decl2.c (cp_write_global_declarations): Fix body test.
154 Do not call cgraph_optimize.
155 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
156 * method.c (use_thunk): Register thunk with
157 cgraph_finalize_function.
158 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
160 2009-07-17 Richard Guenther <rguenther@suse.de>
162 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
165 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
166 Manuel López-Ibáñez <manu@gcc.gnu.org>
169 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
170 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
171 call.c, cvt.c, mangle.c: Add location argument to
172 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
173 build_size_arg, build_fold_addr_expr, build_call_array,
174 non_lvalue, size_diffop, fold_build1_initializer,
175 fold_build2_initializer, fold_build3_initializer,
176 fold_build_call_array, fold_build_call_array_initializer,
177 fold_single_bit_test, omit_one_operand, omit_two_operands,
178 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
179 fold_indirect_ref, combine_comparisons, fold_builtin_*,
180 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
181 round_up, round_down.
183 2009-07-16 Jason Merrill <jason@redhat.com>
186 Split POD into "standard-layout" and "trivial" as per N2230,
187 Support std::is_standard_layout and std::is_trivial traits.
188 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
190 (struct lang_type_class): Add non_std_layout.
191 (CLASSTYPE_NON_STD_LAYOUT): New.
192 * class.c (check_bases): Set it.
193 (check_field_decls): Likewise.
194 (check_bases_and_members): Likewise.
195 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
197 (cp_parser_trait_expr): Likewise.
198 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
200 (finish_trait_expr): Likewise.
201 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
202 (pod_type_p): Use them.
203 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
205 Adjust bits of the language that no longer refer to POD types.
206 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
207 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
208 (build_x_va_arg): Likewise.
209 (call_builtin_trap): Remove.
210 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
211 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
212 (cp_finish_decl): Likewise.
213 (check_previous_goto_1, check_goto): Adjust error.
214 * typeck.c (build_class_member_access_expr): Check
215 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
217 2009-07-14 Taras Glek <tglek@mozilla.com>
218 Rafael Espindola <espindola@google.com>
220 * Make-lang.in: Added CP_PLUGIN_HEADERS and
221 c.install-target to export cp-tree.h cxx-pretty-print.h
222 name-lookup.h headers for plugins.
224 2009-07-14 Jason Merrill <jason@redhat.com>
227 * decl.c (decls_match): A non-extern-C declaration doesn't match
228 a builtin extern-C declaration.
231 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
232 looking in used namespaces just because we found something on
236 * semantics.c (perform_koenig_lookup): Handle empty template args.
238 * call.c (build_over_call): Use can_trust_pointer_alignment.
240 2009-07-14 Dodji Seketeli <dodji@redhat.com>
244 * decl2.c (grokfield): Don't call set_underlying_type on typedef
245 decls that are type names.
247 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
250 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
251 front of qualified names.
253 2009-07-12 Jason Merrill <jason@redhat.com>
256 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
259 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
260 * tree.c (lvalue_p_1): Return it. Remove
261 treat_class_rvalues_as_lvalues parm.
262 (real_lvalue_p): Disallow pseudo-lvalues here.
263 (lvalue_or_rvalue_with_address_p): New fn.
264 * call.c (initialize_reference): Use it instead of real_lvalue_p.
267 * init.c (build_new_1): Handle initializer list as array initializer.
268 (build_vec_init): Likewise.
269 * typeck.c (cp_build_modify_expr): Likewise.
270 * typeck2.c (process_init_constructor_array): Error rather than abort
271 if too many initializers.
273 2009-07-10 Jakub Jelinek <jakub@redhat.com>
276 * error.c (cp_print_error_function): Check for NULL block.
278 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
279 Jason Merrill <jason@redhat.com>
281 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
282 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
284 2009-07-09 Dodji Seketeli <dodji@redhat.com>
287 * pt.c (type_unification_real): Use tsubst_template_arg instead
288 of tsubst to substitute default template arguments.
290 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
293 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
295 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
298 2009-07-07 Jason Merrill <jason@redhat.com>
301 * pt.c (tsubst_decl): Don't abort if we didn't change anything
302 in a TEMPLATE_DECL's args.
304 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
306 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
309 2009-07-07 Jason Merrill <jason@redhat.com>
312 * decl.c (build_enumerator): Don't add enumerators for a
313 scoped enum to the enclosing class.
316 * decl.c (start_enum): Allow dependent underlying type.
319 * decl.c (finish_enum): Finish scope even in a template.
321 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
323 * init.c: Replace %J by an explicit location. Update all calls.
325 * typeck2.c: Likewise.
327 * name-lookup.c: Likewise.
329 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
331 * decl.c: Replace %H by an explicit location. Update all calls.
332 * except.c: Likewise.
333 * semantics.c: Likewise.
334 * parser.c: Likewise.
336 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
339 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
340 append_type_to_template_for_access_check_1): Use
341 RECORD_OR_UNION_CODE_P.
343 2009-07-04 Jason Merrill <jason@redhat.com>
345 * pt.c (retrieve_specialization): Don't get confused by a
346 using-declaration that brings in another instance of this template
349 * ptree.c (cxx_print_type): Fix logic.
351 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
354 * cp-tree.h (struct lang_decl_parm): New.
355 (struct lang_decl): Add it.
356 (LANG_DECL_PARM_CHECK): New.
357 (DECL_PARM_INDEX): New.
358 * decl2.c (parm_index): Remove.
359 * lex.c (retrofit_lang_decl): Handle parms.
360 (cxx_dup_lang_specific_decl): Likewise.
361 * mangle.c (write_expression): Adjust.
362 * tree.c (cp_tree_equal): Adjust.
363 (decl_linkage): Only check DECL_COMDAT for functions and variables.
364 * parser.c (cp_parser_parameter_declaration_list): Set
366 * pt.c (iterative_hash_template_arg): Hash it.
368 2009-07-03 Jason Merrill <jason@redhat.com>
370 * cp-tree.h (struct lang_decl): Overhaul.
371 (struct lang_decl_flags): Remove.
372 (struct lang_decl_base): New.
373 (struct lang_decl_min): New.
374 (struct lang_decl_fn): New.
375 (struct lang_decl_ns): New.
376 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
377 (LANG_DECL_MIN_CHECK): New.
378 (LANG_DECL_FN_CHECK): New.
379 (LANG_DECL_NS_CHECK): New.
380 (STRIP_TEMPLATE): New.
381 (NON_THUNK_FUNCTION_CHECK): Remove.
382 (DECL_DECLARES_FUNCTION_P): New.
384 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
385 * decl.c (push_local_name, duplicate_decls): Adjust.
386 * decl2.c (start_objects): Don't set u2sel.
387 * semantics.c (finish_omp_threadprivate): Adjust.
388 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
389 (decl_cloned_function_p): Out-of-line implementation of macros.
390 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
391 * mangle.c (write_unqualified_name): Don't check function flags
393 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
394 * pt.c (build_template_decl): Don't set function flags.
395 (check_default_tmpl_args): Check that it's a function.
396 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
399 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
400 DECL_CLONED_FUNCTION.
402 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
403 * class.c (finish_struct_1): Adjust.
404 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
405 * search.c (lookup_field_1): Adjust.
407 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
408 * decl.c (finish_method): Don't add to it.
409 * class.c (fixup_pending_inline): Remove.
410 (fixup_inline_methods): Remove.
411 (finish_struct_1): Don't call it.
413 * error.c (dump_function_name): Handle null name.
415 2009-07-02 Mark Mitchell <mark@codesourcery.com>
417 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
418 in arithmetic earlier and allow comparisions of NULL with
421 2009-07-02 Jason Merrill <jason@redhat.com>
423 Use hash tables for template specialization lookup.
424 * pt.c (struct spec_entry): New type.
425 (decl_specializations, type_specializations): New hash tables.
426 (register_specialization, retrieve_specialization): Use them.
427 (reregister_specialization, lookup_template_class): Use them.
428 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
429 (iterative_hash_template_arg): New.
430 (init_template_processing): New
431 (process_partial_specialization): Don't look to see if we already
432 have this partial specialization.
433 (maybe_process_partial_specialization): Handle reassigning
434 full specializations when we get an explicit specialization
435 of the partial instantiation.
436 (tsubst_friend_function): Adjust specialization reassignment code.
437 (instantiate_template): Only do one lookup.
438 (instantiate_decl): Don't do any lookup.
439 * cp-tree.h: Declare init_template_processing.
440 * decl.c (duplicate_decls): Pass args to reregister_specialization.
442 2009-07-01 Jason Merrill <jason@redhat.com>
444 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
446 * pt.c (register_specialization): Use duplicate_decls to merge
447 the argument with a previous specialization.
448 (check_explicit_specialization): Call register_specialization to
449 merge the TEMPLATE_DECL with a previous version.
450 (determine_specialization): Return the args even if fn is a template.
452 2009-07-01 Ian Lance Taylor <iant@google.com>
454 * g++spec.c (lang_specific_driver): Bump num_args by 1.
456 2009-06-30 Jason Merrill <jason@redhat.com>
459 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
462 2009-06-29 Jason Merrill <jason@redhat.com>
465 * error.c (dump_template_parms): Pass all args to
466 count_non_default_template_args.
467 (count_non_default_template_args): Pull out the inner ones.
469 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
471 * decl.c (duplicate_decls): Re-indent.
473 2009-06-25 Ian Lance Taylor <iant@google.com>
475 * call.c (avoid_sign_compare_warnings): New static function.
476 (build_new_op): Call it.
477 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
478 TREE_NO_WARNING is set on either operand.
480 2009-06-25 Ian Lance Taylor <iant@google.com>
482 * g++spec.c (SKIPOPT): define.
483 (lang_specific_driver): Handle -static-libstdc++. Only add
484 LIBSTDCXX_STATIC if we add LIBSTDCXX.
486 2009-06-25 Ian Lance Taylor <iant@google.com>
488 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
489 the second nor third operand has side effects.
491 2009-06-25 Ian Lance Taylor <iant@google.com>
493 * parser.c (cp_parser_binary_expression): Increment
494 c_inhibit_evaluation_warnings while parsing the right hand side of
495 "true || x" or "false && x".
496 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
497 if c_inhibit_evaluation_warnings is zero.
499 2009-06-24 Jason Merrill <jason@redhat.com>
501 * error.c (dump_decl): Do say "typedef" for the injected class name.
503 * pt.c (lookup_template_class): Use currently_open_class,
504 compare template args later.
507 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
508 * class.c (resolve_address_of_overloaded_function): Fix typo.
510 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
512 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
513 * decl.c (finish_decl): Remove.
514 (declare_global_var): Replace finish_decl with cp_finish_decl.
515 (start_method): Same.
516 * rtti.c (emit_tinfo_decl): Same.
517 * pt.c (tsubst_expr): Same.
518 (instantiate_decl): Same.
519 * decl2.c (grokbitfield): Same.
520 * name-lookup.c (pushdecl_top_level_1): Same.
521 * cp-tree.h: Remove finish_decl.
523 2009-06-16 David Edelsohn <edelsohn@gnu.org>
525 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
526 (lang_specific_driver): Always allocate extra argument.
527 Add LIBSTDCXX_STATIC to arglist if defined and linking
530 2009-06-16 Ian Lance Taylor <iant@google.com>
532 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
533 (cp/semantics.o): Depend upon gt-cp-semantics.h.
535 2009-06-16 Ian Lance Taylor <iant@google.com>
537 * parser.c (cp_unevaluated_operand): Define global variable.
538 (cp_parser_question_colon_clause): Increment
539 c_inhibit_evaluation_warnings when evaluating an expression which
540 will never be executed.
541 (cp_parser_decltype): Increment cp_unevaluated_operand and
542 c_inhibit_evaluation_warnings, not skip_evaluation.
543 (cp_parser_sizeof_operand): Likewise.
544 (cp_parser_enclosed_template_argument_list): Save
545 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
547 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
548 Add unevaluated_operand and inhibit_evaluation_warnings fields.
549 (cp_unevaluated_operand): Declare.
550 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
551 and c_inhibit_evaluation_warnings rather than skip_evaluation.
552 (pop_from_top_level): Restore cp_unevaluated_operand and
553 c_inhibit_evaluation_warnings rather than skip_evaluation.
554 * class.c (build_base_path): Check cp_unevaluated_operand rather
555 than skip_evaluation.
556 * typeck.c (build_class_member_access_expr): Likewise.
557 (cp_build_binary_op): Don't warn about bad shift counts if
558 c_inhibit_evaluation_warnings is non-zero.
559 * pt.c (coerce_template_parms): Save state of
560 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
562 (tsubst_aggr_type): Likewise.
563 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
565 (tsubst_copy): Likewise.
566 (tsubst): Set cp_unevaluated_operand and
567 c_inhibit_evaluation_warnings, not skip_evaluation.
568 (tsubst_copy_and_build): Likewise.
569 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
570 rather than skip_evaluation.
571 * decl2.c (mark_used): Likewise.
572 * semantics.c (finish_non_static_data_member): Likewise.
573 * cvt.c (cp_convert_and_check): Check
574 c_inhibit_evaluation_warnings rather than skip_evaluation.
575 * mangle.c (write_type): Set cp_unevaluated_operand rather than
578 2009-06-15 Ian Lance Taylor <iant@google.com>
580 * parser.c (cp_parser_direct_declarator): Add braces around
581 variables declared before label.
583 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
585 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
586 * cp-tree.h (cxx_comdat_group): Change signature.
587 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
588 (cxx_comdat_group): Change signature.
589 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
591 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
592 * method.c (use_thunk): Update call to make_decl_one_only.
593 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
595 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
597 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
598 (build_modify_expr): New arg.
599 * semantics.c (finish_unary_op_expr): Pass location to
601 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
602 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
603 c_sizeof_or_alignof_type.
604 (build_array_ref): New argument.
605 (build_compound_expr): Same.
606 (build_const_cast): Same.
607 (build_ptrmemfunc): Pass location to build_c_cast.
608 * init.c (avoid_placement_new_aliasing): Pass location to
610 (build_vec_delete_1): Pass location to cp_build_modify_expr,
612 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
613 * decl.c (poplevel): Pass location to c_build_bind_expr.
614 (finish_case_label): Pass location to build_case_label.
615 (finish_constructor_body): Same.
616 (finish_destructor_body): Pass location to build_stmt.
617 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
618 * call.c (build_new_op): Pass location to build_array_ref.
619 (build_x_va_arg): Pass location to build_va_arg.
620 * except.c (expand_end_catch_block): Pass location to
622 * cp-tree.h (build_array_ref): New argument.
623 (build_compound_expr): Same.
624 (build_c_cast): Same.
625 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
626 (gimplify_switch_stmt): Same.
627 * typeck2.c (split_nonconstant_init_1): Same.
628 * pt.c (tsubst_copy): Same.
629 * semantics.c (add_decl_expr): Same.
631 (push_cleanup): Same.
632 (finish_goto_stmt): Same.
633 (finish_expr_stmt): Same.
634 (begin_if_stmt): Same.
635 (begin_while_stmt): Same.
636 (begin_do_stmt): Same.
637 (finish_return_stmt): Same.
638 (begin_for_stmt): Same.
639 (finish_break_stmt): Same.
640 (finish_continue_stmt): Same.
641 (begin_switch_stmt): Same.
642 (begin_try_block): Same.
643 (begin_handler): Same.
644 (finish_asm_stmt): Same.
645 (finish_label_stmt): Same.
646 (finish_stmt_expr_expr): Same.
647 (finalize_nrv_r): Same.
648 (finish_omp_atomic): Same.
649 * name-lookup.c (do_using_directive): Same.
650 * decl2.c (grok_array_decl): Same.
651 * parser.c (cp_parser_cast_expression): Same.
652 (cp_parser_selection_statement): Same.
653 (cp_parser_implicitly_scoped_statement): Same.
654 (cp_parser_objc_selector_expression): Same.
655 (cp_parser_objc_synchronized_statement): Same.
656 (cp_parser_objc_throw_statement): Same.
657 (cp_parser_omp_critical): Same.
658 (cp_parser_omp_master): Same.
659 * typeck.c (build_function_call): Add location argument.
660 * init.c: Add location argument to all build_decl calls.
669 * cp-gimplify.c: Same.
671 (cp_make_fname_decl): Add location argument. Pass location ot
673 (finish_case_label): Same.
674 * cp-tree.h (finish_case_label): Add location argument.
675 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
678 2009-06-09 Jason Merrill <jason@redhat.com>
681 * decl2.c (mark_used): Return after complaining about deleted fn.
683 2009-06-08 Jason Merrill <jason@redhat.com>
685 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
686 late-specified return type.
688 2009-06-08 Jakub Jelinek <jakub@redhat.com>
691 * call.c (check_dtor_name): Return false even if
692 get_type_value (name) is error_mark_node.
696 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
697 on error_mark_node. Check for VLAs outside of function context
698 before check whether to wrap bounds into a NOP_EXPR with
701 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
703 * repo.c (get_base_filename): Use aux_base_name rather than
704 alternate temporary file during second compare debug compilation.
705 (finish_repo): Skip during -fcompare-debug-second.
707 2009-06-06 Ian Lance Taylor <iant@google.com>
709 * parser.c (cp_parser_label_for_labeled_statement): Support
710 attribute on labels if immediately followed by semicolon.
711 * semantics.c (finish_label_stmt): Return new label.
712 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
714 2009-06-03 Ian Lance Taylor <iant@google.com>
716 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
719 2009-06-02 Mark Mitchell <mark@codesourcery.com>
721 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
723 2009-06-02 Jason Merrill <jason@redhat.com>
727 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
729 * call.c (implicit_conversion): Allow init-list conversion to scalar
730 during direct-initialization, too. Mark the conversion bad if it
731 has too many levels of braces.
732 (convert_like_real): And give a helpful error.
736 * decl.c (cp_finish_decl): Handle auto deduction from ().
737 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
738 with dependent type that is known to be a pointer.
740 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
743 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
744 specializations in an invalid namespace.
746 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
748 * error.c (print_instantiation_partial_context): Print column
751 2009-05-29 Ian Lance Taylor <iant@google.com>
753 * error.c (cp_printer): Don't use va_arg with enum type.
755 2009-05-28 Dodji Seketeli <dodji@redhat.com>
758 * cp-tree.h (canonical_type_variant): Remove this function declaration.
759 (strip_typedefs): New function declaration.
760 * tree.c (strip_typedefs): New function definition.
761 (canonical_type_variant): Remove function definition.
762 * cvt.c (convert_from_reference): No need to use
763 canonical_type_variant.
764 * typeck.c (cp_build_indirect_ref): Likewise.
765 * error.c (dump_template_bindings): Use strip_typedefs instead of
766 canonical_type_variant.
767 * pt.c (convert_template_argument, unify): Likewise.
768 * mangle.c (canonicalize_for_substitution): Don't use
769 canonical_type_variant.
771 2009-05-27 Jason Merrill <jason@redhat.com>
773 * call.c (implicit_conversion): Handle conversion from
774 initializer-list to scalar.
775 (convert_like_real): Likewise. Avoid crashing on list
776 initialization with bad conversions.
777 (can_convert): Use LOOKUP_EXPLICIT.
778 (can_convert_arg_bad): Add flags parm.
780 * typeck.c (convert_for_assignment): Pass flags.
782 2009-05-27 Ian Lance Taylor <iant@google.com>
784 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
785 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
787 2009-05-26 Ian Lance Taylor <iant@google.com>
789 * Make-lang.in (g++spec.o): Use $(COMPILER).
790 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
791 (cc1plus$(exeext)): Likewise.
793 2009-05-26 Dodji Seketeli <dodji@redhat.com>
796 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
797 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
798 (get_types_needing_access_check): Declare new entry point.
799 * pt.c (append_type_to_template_for_access_check_1,
800 get_types_needing_access_check): New functions.
801 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
802 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
803 get_types_needing_access_check, no more
804 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
805 (instantiate_class_template): Set input_location to the source
806 location of the most specialized template definition.
807 Perform access check using the RECORD_TYPE of the template, not its
808 associated most generic TEMPLATE_DECL.
809 (append_type_to_template_for_access_check): Augment function
810 comments. Use the new get_types_needing_access_check, not
811 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
812 append_type_to_template_for_access_check_1 subroutine.
814 2009-05-22 Jason Merrill <jason@redhat.com>
817 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
818 arithmetic comparisons.
819 (cp_common_type): Handle scoped enums.
821 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
822 (add_builtin_candidate, add_builtin_candidates): Likewise.
823 (convert_like_real): Likewise.
824 * class.c (check_bitfield_decl): Likewise.
825 * decl.c (check_static_variable_definition): Likewise.
826 (compute_array_index_type): Likewise.
827 * decl2.c (grokbitfield): Likewise.
828 * init.c (build_new_1): Likewise.
829 * pt.c (convert_nontype_argument): Likewise.
830 (current_instantiation): Likewise.
831 * tree.c (pod_type_p): Likewise.
832 * typeck.c (build_static_cast_1): Likewise.
833 (build_reinterpret_cast_1): Likewise.
835 2009-05-22 Richard Guenther <rguenther@suse.de>
838 * init.c (avoid_placement_new_aliasing): Remove.
839 (build_new_1): Do not call it.
841 2009-05-22 Mark Mitchell <mark@codesourcery.com>
843 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
844 * semantics.c (expand_or_defer_fn): Similarly.
846 2009-05-20 Ian Lance Taylor <iant@google.com>
848 * parser.c (cp_parser_postfix_expression): Change args to a vec.
849 Release it when done.
850 (tree_vector): Define typedef. Define VEC functions.
851 (cp_parser_parenthesized_expression_list): Change return type to
852 vec. Change all callers.
853 (cp_parser_new_expression): Change placement and initializer to
854 vecs. Release them when done.
855 (cp_parser_new_placement): Change return type to vec. Change all
857 (cp_parser_new_initializer): Likewise.
858 * typeck.c (build_function_call_vec): Just call
859 cp_build_function_call_vec.
860 (cp_build_function_call): Just build a vec and call
861 cp_build_function_call_vec.
862 (cp_build_function_call_vec): New function based on old
863 cp_build_function_call.
864 (convert_arguments): Remove nargs and argarray parameters. Change
865 values to a vec. Change caller.
866 (build_x_compound_expr_from_vec): New function.
867 (cp_build_modify_expr): Build vec to pass to
868 build_special_member_call.
869 * call.c (struct z_candidate): Add first_arg field. Change args
871 (convert_class_to_reference): Handle first argument separately.
872 (add_candidate): Add first_arg parameter. Change args parameter
873 to vec. Change all callers.
874 (add_function_candidate, add_conv_candidate): Likewise.
875 (add_template_candidate_real, add_template_candidate): Likewise.
876 (add_template_conv_candidate): Likewise.
877 (build_user_type_conversion_1): Handle first argument separately.
878 (resolve_args): Change return type and parameter type to vecs.
880 (perform_overload_resolution): Change args parameter to vec.
882 (build_new_function_call, build_operator_new_call): Likewise.
883 (add_candidates): Likewise.
884 (build_op_call): New globally visible function, built from and
885 replacing static function build_object_call.
886 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
888 (build_op_delete_call): Build vec to pass to
889 cp_build_function_call_vec.
890 (build_temp): Build vec to pass to build_special_member_call.
891 (convert_like_real): Likewise.
892 (perform_direct_initialization_if_possible): Likewise.
893 (build_over_call): Handle first_arg field. Use build_call_array
894 rather than build_call_list.
895 (build_special_member_call): Change args parameter to vec. Change
897 (build_new_method_call): Likewise.
898 * init.c (expand_default_init): Change parms to vec.
899 (build_raw_new_expr): Change placement and init to vecs. Change
901 (build_new_1, build_new): Likewise.
902 * class.c (resolve_address_of_overloaded_function): Build array to
903 pass to fn_type_unification.
904 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
905 build_new. For CALL_EXPR create a vec rather than a tree_list;
906 expand a pack if necessary.
907 (fn_type_unification): Change args parameter to const tree *. Add
908 nargs parameter. Change all callers.
909 (type_unification_real): Likewise.
910 (unify): Build array to pass to type_unification_real.
911 (get_bindings): Build array to pass to fn_type_unification.
912 (any_type_dependent_arguments_p): Change args parameter to a vec.
914 (make_args_non_dependent): Renamed from build_non_dependent_args.
915 Change return type to void. Change parameter type to vec. Change
917 (do_auto_deduction): Pass an array to type_unification_real.
918 * semantics.c (perform_koenig_lookup): Change args to vec. Change
920 (finish_call_expr): Change args to vec. Change all callers. Call
921 build_op_call instead of passing CALL_EXPR to build_new_op.
922 (cxx_omp_create_clause_info): Allocate vec to pass to
923 build_special_member_call.
924 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
925 to vec. Change all callers.
926 * name-lookup.c (lookup_function_nonclass): Likewise.
927 (struct arg_lookup): Change args to vec.
928 (arg_assoc_namespace): Handle args as a vec.
929 (arg_assoc_args_vec): New static function.
930 (lookup_arg_dependent): Change args parameter to vec. Change all
932 * method.c (do_build_assign_ref): Allocate vec to pass to
933 build_special_member_call.
934 * except.c (build_throw): Likewise.
935 * typeck2.c (build_functional_cast): Likewise.
936 * cvt.c (ocp_convert): Likewise.
937 * tree.c (build_min_non_dep_call_vec): Change last parameter to
938 vec. Change all callers.
939 * cp-tree.h: Update declarations.
940 * name-lookup.h: Update declarations.
942 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
944 * typeck.c (default_conversion): Check targetm.promoted_type.
945 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
946 (grokparms): Check targetm.invalid_parameter_type.
947 * cvt.c (ocp_convert): Check targetm.convert_to_type.
948 (build_expr_type_conversion): Check targetm.promoted_type.
950 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
952 * typeck.c (build_binary_op): Allow % on integal vectors.
954 2009-05-18 Jason Merrill <jason@redhat.com>
956 Implement explicit conversions ops as specified in N2437.
957 * decl.c (grokdeclarator): Handle explicit conversion ops.
958 (check_initializer): Pass flags to store_init_value.
959 * decl2.c (maybe_emit_vtables): Likewise.
960 * init.c (expand_aggr_init_1): Likewise.
961 * call.c (convert_class_to_reference): Take flags parm,
962 check DECL_NONCONVERTING_P.
963 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
964 (add_builtin_candidates): Simplify getting type of conversion.
965 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
966 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
967 (reference_binding): Take flags parm. Direct-initialize copy parm.
968 (add_function_candidate): Direct-initialize the copy parm.
969 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
970 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
971 (conditional_conversion): Likewise.
972 (convert_like_real): Only complain about DECL_NONCONVERTING_P
974 (perform_implicit_conversion_flags): Add flags parm to
975 perform_implicit_conversion. Improve diagnostics.
976 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
977 (LOOKUP_COPY_PARM): New bit macro.
978 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
979 * typeck.c (convert_for_assignment): Take flags parm, pass it to
980 perform_implicit_conversion_flags.
981 (cp_build_modify_expr): Pass flags to convert_for_assignment.
982 (convert_for_initialization): Likewise.
983 * typeck2.c (store_init_value): Take flags parm, pass to
985 (digest_init_flags): Add flags parm to digest_init.
986 (digest_init_r): Take flags parm, pass to convert_for_initialization.
987 (process_init_constructor_array): Pass it.
988 (process_init_constructor_record): Likewise.
989 (process_init_constructor_union): Likewise.
991 2009-05-16 Jason Merrill <jason@redhat.com>
994 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
995 with a dependent type. Actually look up the destructor.
996 * semantics.c (finish_id_expression): Fix logic.
997 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
999 * typeck.c (build_x_unary_op): Diagnose taking the address of a
1000 constructor or destructor.
1001 * tree.c (get_first_fn): Handle OFFSET_REF.
1003 2009-05-17 Joseph Myers <joseph@codesourcery.com>
1005 * tree.c (cxx_printable_name_internal): Allow consecutive
1006 translated and untranslated cached copies of the name of the
1009 2009-05-15 Ian Lance Taylor <iant@google.com>
1011 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1012 cp_lvalue_kind. Change all uses.
1013 (enum base_access_flags): Rename from enum base_access. Change
1015 * parser.c (enum cp_parser_flags): Remove enum tag.
1017 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
1020 * call.c (build_new_op): Update calls to warn_logical_operator.
1022 2009-05-14 Ian Lance Taylor <iant@google.com>
1024 * class.c (layout_class_type): Change itk to unsigned int.
1025 * decl.c (finish_enum): Change itk to unsigned int.
1026 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
1029 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
1031 * decl.c (duplicate_decls): Preserve parameter attributes.
1033 2009-05-10 Jan Hubicka <jh@suse.cz>
1035 * decl2.c (cxx_callgraph_analyze_expr): Use
1036 cgraph_mark_address_taken.
1038 2009-05-10 Joseph Myers <joseph@codesourcery.com>
1040 * call.c (name_as_c_string): Call type_as_string_translate.
1041 Translate identifiers to locale character set.
1042 * cp-tree.h (lang_decl_name): Update prototype.
1043 (type_as_string_translate, decl_as_string_translate,
1044 cxx_printable_name_translate): Declare.
1045 * cxx-pretty-print.c (M_): Define.
1046 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1047 English fragments for conditional translation with M_.
1048 * decl.c (grokdeclarator): Translate identifiers to locale
1049 character set for diagnostics.
1050 * error.c (M_): Define.
1051 (dump_template_bindings, dump_type, dump_aggr_type,
1052 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1053 dump_function_decl, dump_template_parms, dump_expr,
1054 dump_binary_op, op_to_string, assop_to_string): Mark English
1055 fragments for conditional translation with M_.
1056 (type_as_string): Disable translation of identifiers.
1057 (type_as_string_translate): New.
1058 (expr_as_string): Disable translation of identifiers.
1059 (decl_as_string): Disable translation of identifiers.
1060 (decl_as_string_translate): New.
1061 (lang_decl_name): Add parameter translate.
1062 (args_to_string): Call type_as_string_translate.
1063 (cp_print_error_function): Call cxx_printable_name_translate.
1064 (print_instantiation_full_context,
1065 print_instantiation_partial_context): Call
1066 decl_as_string_translate.
1067 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1068 identifier in diagnostic.
1069 * tree.c (cxx_printable_name): Change to
1070 cxx_printable_name_internal. Add parameter translate.
1071 (cxx_printable_name, cxx_printable_name_translate): New wrappers
1072 round cxx_printable_name_internal.
1074 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
1077 * call.c (build_call_a): Updated warn_deprecated_use call.
1078 (build_over_call): Likewise.
1079 * decl.c (grokdeclarator): Likewise.
1080 (grokparms): Likewise.
1081 * semantics.c (finish_id_expression): Likewise.
1082 * typeck.c (build_class_member_access_expr): Likewise.
1083 (finish_class_member_access_expr): Likewise.
1085 2009-05-06 Dodji Seketeli <dodji@redhat.com>
1088 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1089 whole list of PARM_DECLs, just the current one.
1091 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
1094 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1095 mangle_compound_literal): Remove unused declarations.
1096 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1097 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1098 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1099 check_for_out_of_scope_variable, print_other_binding_stack,
1100 maybe_push_decl, cxx_mark_addressable, force_target_expr,
1101 build_target_expr_with_type, finish_case_label,
1102 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1103 check_template_keyword, cxx_omp_predetermined_sharing,
1104 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1105 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1106 cxx_omp_privatize_by_reference): Rearrange the declarations line to
1107 match the comment that indicates the .c file which the functions are
1109 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1110 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1112 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
1114 * typeck.c (cp_build_compound_expr): Require RHS to have a known
1116 * class.c (resolve_address_of_overloaded_function): Use
1117 OVL_CURRENT for error message.
1118 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1119 with them. Do not copy the node.
1121 2009-05-05 Jakub Jelinek <jakub@redhat.com>
1124 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1125 set it from its operand's type after tsubst_expr.
1127 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1130 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
1131 canonical spelling for keywords.
1132 (cp_parser_attribute_list): Use the canonical spelling for
1133 keywords in attributes.
1135 2009-05-01 Joseph Myers <joseph@codesourcery.com>
1137 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1138 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1139 pp_cxx_new_expression, pp_cxx_delete_expression,
1140 pp_cxx_unary_expression, pp_cxx_assignment_operator,
1141 pp_cxx_assignment_expression, pp_cxx_expression,
1142 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1143 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1144 pp_cxx_exception_specification, pp_cxx_direct_declarator,
1145 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1146 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1147 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1148 pp_cxx_declaration, pp_cxx_typeid_expression,
1149 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1150 pp_cxx_trait_expression): Mostly use pp_string and
1151 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1152 for non-identifiers. Mark English strings for translation.
1153 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1154 * error.c (dump_template_parameter, dump_template_bindings,
1155 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1156 dump_decl, dump_template_decl, dump_function_decl,
1157 dump_parameters, dump_exception_spec, dump_template_parms,
1158 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1159 assop_to_string, args_to_string, cp_print_error_function,
1160 print_instantiation_full_context,
1161 print_instantiation_partial_context): Mostly use pp_string and
1162 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1163 for non-identifiers. Mark English strings for translation.
1164 (dump_global_iord): Mark strings for translation; use longer
1165 strings instead of substituting single words.
1166 (function_category): Return a format string marked for
1167 translation, not a single word or phrase to substitute in a longer
1170 2009-04-28 Ben Elliston <bje@au.ibm.com>
1175 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1177 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1179 2009-04-27 Ian Lance Taylor <iant@google.com>
1181 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1184 2009-04-27 Jakub Jelinek <jakub@redhat.com>
1187 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1188 -Wunused-value if implicit.
1190 2009-04-24 Ian Lance Taylor <iant@google.com>
1192 * call.c (build_temp): Change 0 to enum constant.
1193 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1195 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1196 * decl2.c (constrain_visibility): Likewise.
1197 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1198 (cp_parser_flags): Typedef to int rather than enum type.
1199 (cp_parser_expression_stack_entry): Change prec field to enum
1202 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1205 2009-04-22 Dodji Seketeli <dodji@redhat.com>
1208 * parser.c (cp_parser_template_argument_list): Display an error
1209 when an ellipsis is not preceded by a parameter pack. Also, warn
1210 about variadic templates usage without -std=c++0x.
1212 2009-04-21 Taras Glek <tglek@mozilla.com>
1214 * cp-tree.h: Update GTY annotations to new syntax.
1216 * mangle.c: Likewise.
1217 * name-lookup.c: Likewise.
1218 * name-lookup.h: Likewise.
1219 * parser.c: Likewise.
1222 * semantics.c: Likewise.
1223 * typeck2.c: Likewise.
1225 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1228 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1230 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1233 * typeck.c (check_for_casting_away_constness): We diagnose casting
1234 away any qualifiers not just constness.
1235 (casts_away_constness): Mention that it handles more than just
1238 2009-04-21 Joseph Myers <joseph@codesourcery.com>
1240 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
1241 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
1242 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
1243 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1244 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
1245 cfns.gperf: Add copyright and license notices.
1246 * cfns.h: Regenerate.
1247 * ChangeLog, ChangeLog-2004: Correct dates.
1249 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1252 * tree.c (lvalue_p_1): Use const_tree.
1253 Use CONST_CAST_TREE to avoid warning.
1254 (lvalue_p): Returns bool, receives const_tree.
1256 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1259 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
1260 * error.c (pedwarn_cxx98): New.
1261 * cp-tree.h (pedwarn_cxx98): Declare.
1263 2009-04-20 Le-Chun Wu <lcwu@google.com>
1266 * init.c (build_vec_init): Set TREE_NO_WARNING on the
1267 compiler-generated INDIRECT_REF expression.
1269 2009-04-20 Ian Lance Taylor <iant@google.com>
1271 * typeck.c (build_function_call_vec): New function.
1272 (cp_build_function_call): Only pass first parameter to
1273 objc_rewrite_function_call.
1274 (build_modify_expr): Add rhs_origtype parameter. Change all
1276 * decl.c (finish_decl): Add origtype parameter. Change all
1278 * semantics.c (finish_call_expr): Pass VEC to
1279 resolve_overloaded_builtin.
1281 2009-04-20 Ian Lance Taylor <iant@google.com>
1283 * cp-tree.h (base_access): Change typedef to int.
1284 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
1285 (cp_parser_omp_threadprivate): Likewise.
1286 * pt.c (unify_pack_expansion): Add casts to enum type.
1288 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
1292 * call.c (build_new_op): Save the original codes of operands
1295 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
1297 * cp-tree.h: Remove the prototype for insert_block.
1298 * decl.c (insert_block): Remove.
1300 2009-04-16 Ian Lance Taylor <iant@google.com>
1302 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
1303 (tsubst_flags_t): Change typedef from enum type to int.
1305 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
1307 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
1308 instead of targetm.vector_opaque_p.
1310 2009-04-15 Le-Chun Wu <lcwu@google.com>
1313 * call.c (build_over_call): Set TREE_NO_WARNING on the
1314 compiler-generated INDIRECT_REF expression.
1315 * cvt.c (convert_to_void): Emit warning when stripping off
1318 2009-04-14 Diego Novillo <dnovillo@google.com>
1320 * parser.c (cp_parser_type_specifier_seq): Move call to
1321 invoke_plugin_callbacks ...
1322 (cp_parser_type_specifier_seq): ... here.
1324 2009-04-14 Le-Chun Wu <lcwu@google.com>
1326 * Make-lang.in: Modify dependencies of files including plugin.h.
1327 * decl.c (finish_function): Call invoke_plugin_callbacks.
1328 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
1330 2009-04-14 Jason Merrill <jason@redhat.com>
1333 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
1334 about shadowing by tentative parms.
1336 2009-04-13 Jason Merrill <jason@redhat.com>
1339 * call.c (build_over_call): Don't call memcpy if the target is
1340 the same as the source.
1342 2009-04-13 Jason Merrill <jason@redhat.com>
1345 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1347 2009-04-12 Jason Merrill <jason@redhat.com>
1350 * call.c (joust): Don't crash on variadic fn.
1352 2009-04-10 Jason Merrill <jason@redhat.com>
1355 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1356 if we see a close brace without an open brace.
1358 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
1360 * parser.c (cp_parser_class_specifier): Remove the unused
1361 has_trailing_semicolon.
1363 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
1366 * parser.c (cp_parser_check_template_parameters): Take a
1367 cp_declarator parameter.
1368 (cp_parser_elaborated_type_specifier): Update to
1369 cp_parser_check_template_parameters.
1370 (cp_parser_class_head): Likewise.
1371 (cp_parser_check_declarator_template_parameters): Likewise.
1372 (cp_parser_check_template_parameters): Handle first the non-error
1373 conditions. Give more accurate diagnostics if a declarator is
1376 2009-04-08 Jason Merrill <jason@redhat.com>
1379 * error.c (dump_aggr_type): Chase template typedefs if
1380 -fno-pretty-templates.
1382 2009-04-08 Dodji Seketeli <dodji@redhat.com>
1385 * parser.c (cp_parser_enumerator_definition): Make sure the
1386 initializer of the enumerator doesn't contain any bare parameter pack.
1388 2009-04-07 Jason Merrill <jason@redhat.com>
1391 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1392 * call.c (joust): Complain about mismatched default arguments
1393 in extern "C" functions.
1394 * class.c (resolve_address_of_overloaded_function): Handle multiple
1395 extern "C" functions.
1396 * pt.c (resolve_overloaded_unification): Likewise.
1398 2009-04-07 Jason Merrill <jason@redhat.com>
1401 * error.c (dump_function_decl): Don't pretty-print templates
1402 if -fno-pretty-templates.
1403 (count_non_default_template_args): Print all args if
1404 -fno-pretty-templates.
1406 2009-04-06 Jason Merrill <jason@redhat.com>
1409 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
1410 the deduced template arguments give us the parameter types
1413 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
1414 Jason Merrill <jason@redhat.com>
1417 * error.c (count_non_default_template_args): New fn.
1418 (dump_template_parms): Call it.
1419 (dump_template_argument_list): Call it. Add parms parm.
1420 (dump_template_argument): Adjust call to dump_template_argument_list.
1421 (dump_type, dump_decl): Likewise.
1422 (dump_template_bindings): Refactor logic.
1424 2009-04-03 Jason Merrill <jason@redhat.com>
1427 * error.c (dump_template_bindings): Look through typedefs in
1429 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
1430 (find_typenames_r): Also collect typedefs.
1431 * pt.c (unify): Strip typedefs.
1434 * semantics.c (finish_id_expression): Don't assume a dependent
1435 member of the current instantiation isn't a valid integral
1436 constant expression. Check dependent_scope_p.
1437 * pt.c (dependent_scope_p): Check TYPE_P.
1438 (tsubst_copy): If args is null, just return.
1440 2009-04-02 Jason Merrill <jason@redhat.com>
1443 * error.c (find_typenames, find_typenames_r): New fns.
1444 (dump_function_decl): Call find_typenames.
1445 (dump_template_bindings): Print typenames as well.
1446 * pt.c (tsubst): Non-static.
1447 * cp-tree.h: Declare it.
1449 2009-04-02 Dodji Seketeli <dodji@redhat.com>
1452 * decl2.c (grokfield): when a typedef appears in a
1453 class, create the typedef variant type node for it.
1454 (save_template_attributes): Creating typedef variant type node
1455 here is now useless.
1456 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1457 anonymous, set the proper type name to all its type variants.
1458 (xref_basetypes) : Fixup the variant types after setting
1460 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1461 set_underlying_type function to install typedef variant types.
1462 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1464 (append_type_to_template_for_access_check): New entry points.
1465 * semantics.c (check_accessibility_of_qualified_id):
1466 When a typedef that is a member of a class appears in a template,
1467 add it to the template. It will be ...
1468 * class.c (finish_struct_bits): Split type variant fixup into ...
1469 (fixup_type_variants): A new entry point.
1470 * pt.c (instantiate_class_template, instantiate_template ): ... access
1471 checked at template instantiation time.
1472 (resolve_type_name_type): The type name should be the name of the
1474 (retrieve_specialization): Specializations of template typedefs aren't
1475 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
1476 (append_type_to_template_for_access_check): New entry point.
1477 (tsubst_decl): For typedefs, build the variant type from the correct
1479 (get_class_bindings): Fix function comment.
1480 (perform_typedefs_access_check): New entry point.
1482 2009-03-31 Jason Merrill <jason@redhat.com>
1485 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
1486 extern "C" declarations.
1489 * semantics.c (finish_non_static_data_member): Allow such references
1490 without an associated object in sizeof/decltype/alignof.
1492 * ptree.c (cxx_print_decl): Pretty-print full name of
1494 (cxx_print_type): Pretty-print full name of class.
1496 * decl.c (grokdeclarator): Reject pointer to qualified function
1499 PR c++/37806, core issue 547
1500 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
1502 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
1504 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
1505 * decl.c (groktypename): Add is_template_arg parameter.
1506 (grokdeclarator): Allow function cv-quals on a template type arg.
1507 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
1508 is_template_arg argument in calls to groktypename.
1509 * cp-tree.h: Adjust prototype.
1510 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
1511 FUNCTION_TYPE printing.
1513 * mangle.c (write_expression): Mangle dependent name as
1516 PR c++/38030, 38850, 39070
1517 * pt.c (type_dependent_expression_p_push): New fn.
1518 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
1519 substitution makes the call non-dependent. Preserve koenig_p.
1520 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
1521 for non-dependent calls.
1522 * semantics.c (finish_call_expr): Revert earlier changes.
1523 * cp-tree.h: Revert change to finish_call_expr prototype.
1525 2009-03-29 Joseph Myers <joseph@codesourcery.com>
1527 PR preprocessor/34695
1528 * cp-tree.h (cp_cpp_error): Remove.
1529 * error.c (cp_cpp_error): Remove.
1530 * parser.c (cp_lexer_new_main): Set done_lexing instead of
1531 client_diagnostic and error callback.
1533 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
1535 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1536 * cp/cp-objcp-common.c (cxx_staticp): Remove.
1537 * cp/cp-tree.h (cxx_staticp): Remove.
1539 2009-03-28 Jakub Jelinek <jakub@redhat.com>
1542 * parser.c (cp_parser_postfix_expression): Don't call
1543 warning_if_disallowed_function_p.
1545 2009-03-27 Jan Hubicka <jh@suse.cz>
1547 * except.c (choose_personality_routine): Set terminate_node to abort
1548 for java exceptions.
1550 2009-03-27 Dodji Seketeli <dodji@redhat.com>
1551 Jakub Jelinek <jakub@redhat.com>
1554 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
1555 (cp_function_decl_explicit_p): New prototype.
1556 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
1558 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
1561 * parser.c (cp_parser_elaborated_type_specifier): If we have a
1562 typename tag and don't have either a TYPE_DECL or a
1563 TEMPLATE_ID_EXPR, set the type to NULL.
1565 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1568 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
1571 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1574 * decl.c (check_array_designated_initializer): Handle error_mark_node.
1576 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1579 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1581 2009-03-26 Andrew Haley <aph@redhat.com>
1584 * decl2.c (possibly_inlined_p): If java exceptions are in use
1585 don't inline a decl unless it is explicitly marked inline.
1586 * lex.c: (pragma_java_exceptions): New variable.
1587 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
1588 * cp-tree.h (pragma_java_exceptions): Declare new variable.
1590 2009-03-24 Jason Merrill <jason@redhat.com>
1593 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
1595 2009-03-23 Jakub Jelinek <jakub@redhat.com>
1598 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
1599 code if iter is the second operand.
1600 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
1601 argument. If it is set, don't build the toplevel expression with
1602 build_x_binary_op, but build2.
1603 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
1605 (cp_parser_omp_for_cond): Don't assume the first operand of the
1606 comparison must be decl.
1608 2009-03-23 Jason Merrill <jason@redhat.com>
1611 * pt.c (make_fnparm_pack): Split out from...
1612 (instantiate_decl): ...here.
1613 (tsubst_pack_expansion): Handle being called in a late-specified
1617 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
1620 2009-03-20 Jason Merrill <jason@redhat.com>
1623 * parser.c (cp_parser_direct_declarator): In a template, wrap
1624 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
1625 * pt.c (tsubst): Preserve it in a partial instantiation.
1626 (dependent_type_p_r): Don't check value_dependent_expression_p.
1627 * decl.c (compute_array_index_type): Don't check
1628 value_dependent_expression_p if TREE_SIDE_EFFECTS.
1631 * typeck2.c (check_narrowing): Don't complain about loss of
1632 precision when converting a floating-point constant.
1634 2009-03-19 Jakub Jelinek <jakub@redhat.com>
1637 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
1638 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
1640 2009-03-18 Jakub Jelinek <jakub@redhat.com>
1642 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
1643 (eof_token): Adjust.
1645 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
1648 * parser.c (cp_parser_explicit_specialization): Don't skip the
1649 rest of the specialization when begin_specialization returns
1652 2009-03-17 Jason Merrill <jason@redhat.com>
1654 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
1655 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
1656 * pt.c (check_explicit_specialization): Likewise.
1657 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
1658 local specialization.
1659 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
1660 * decl2.c (parm_index): New fn.
1661 * semantics.c (finish_decltype_type): Don't use describable_type.
1662 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
1663 Give a sorry for unsupported codes rather than crash. Mangle
1664 conversions with other than 1 operand. New mangling for PARM_DECL.
1665 * operators.def (ALIGNOF_EXPR): Mangle as "az".
1667 2009-03-17 Jing Yu <jingyu@google.com>
1670 * method.c (use_thunk): Change is_thunk from crtl to cfun.
1672 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
1675 * semantics.c (check_trait_type): New.
1676 (finish_trait_expr): Use it.
1678 2009-03-17 Jakub Jelinek <jakub@redhat.com>
1680 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
1681 instead of calling imported_module_or_decl debug hook if
1682 building_stmt_tree ().
1683 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
1684 is a NAMESPACE_DECL.
1687 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
1688 hook at function scope.
1691 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
1694 2009-03-09 Jakub Jelinek <jakub@redhat.com>
1697 * semantics.c (finish_switch_cond): Don't call get_unwidened.
1698 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
1699 instead of TREE_TYPE (cond).
1701 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
1704 * parser.c (cp_parser_late_parsing_default_args): Continue
1705 the loop when cp_parser_assignment_expression returns
1708 2009-03-07 Jason Merrill <jason@redhat.com>
1711 * init.c (build_new_1): Don't use a VLA type.
1712 (build_vec_init): Handle getting a pointer for BASE.
1714 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
1717 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1718 when mangling symbols.
1720 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1723 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1725 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
1727 * decl.c (record_builtin_java_type): Use canonicalized integer
1730 2009-03-04 Jason Merrill <jason@redhat.com>
1733 * class.c (is_really_empty_class): New fn.
1734 * cp-tree.h: Declare it.
1735 * cp-objcp-common.c (cp_expr_size): Use it.
1738 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
1739 * parser.c (cp_parser_postfix_expression): Call it for
1741 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
1742 (get_first_fn): Likewise.
1748 * decl.c (make_typename_type): Do look inside currently open classes.
1749 * parser.c (cp_parser_lookup_name): Likewise.
1750 (cp_parser_template_name): Likewise.
1751 * pt.c (dependent_scope_p): New function.
1752 * cp-tree.h: Declare it.
1753 * class.c (currently_open_class): Return fast if T isn't a class.
1755 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
1758 * parser.c (cp_parser_mem_initializer): Return error_mark_node
1759 if cp_parser_mem_initializer_id returns error_mark_node.
1761 2009-02-24 Richard Guenther <rguenther@suse.de>
1764 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
1767 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
1770 * pt.c (coerce_template_template_parms): Return 0 if parameter
1773 2009-02-23 Jason Merrill <jason@redhat.com>
1775 * pt.c (unify): Call maybe_adjust_types_for_deduction when
1776 deducing from an initializer list.
1778 2009-02-20 Jason Merrill <jason@redhat.com>
1781 * decl.c (grokdeclarator): Handle ~identifier.
1783 2009-02-19 Jakub Jelinek <jakub@redhat.com>
1786 * decl2.c (determine_visibility): If visibility changed and
1787 DECL_RTL has been already set, call make_decl_rtl to update symbol
1790 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
1793 * cp-tree.h (maybe_commonize_var): New.
1795 * decl.c (maybe_commonize_var): Make it extern.
1797 * decl2.c (finish_anon_union): Call maybe_commonize_var.
1799 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
1802 * parser.c (cp_parser_enum_specifier): Apply all attributes.
1804 2009-02-18 Jason Merrill <jason@redhat.com>
1806 * cfns.h: Tweak pathname for cfns.gperf.
1808 2009-02-13 Jason Merrill <jason@redhat.com>
1811 * semantics.c (finish_call_expr): Change koenig_p parm to int.
1812 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
1813 * cp-tree.h: Adjust prototype.
1814 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
1816 2009-02-12 Jason Merrill <jason@redhat.com>
1819 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
1821 2009-02-11 Jason Merrill <jason@redhat.com>
1824 * decl2.c (cp_write_global_declarations):
1825 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
1828 * init.c (build_value_init_noctor): Split out from...
1829 (build_value_init): ...here.
1830 (expand_aggr_init_1): Handle value-initialization.
1831 * cp-tree.h: Add declaration.
1832 * class.c (type_has_user_provided_constructor):
1833 Handle non-class arguments.
1835 2009-02-10 Jason Merrill <jason@redhat.com>
1838 * class.c (defaultable_fn_p): Handle ... properly.
1841 * tree.c (lvalue_p_1): Condition rvalue ref handling on
1842 treat_class_rvalues_as_lvalues, too.
1844 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
1847 * typeck.c (build_x_array_ref): New.
1848 * cp-tree.h: Declare it.
1849 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
1851 2009-02-09 Jason Merrill <jason@redhat.com>
1854 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
1855 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
1856 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
1857 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
1858 for build_value_init TARGET_EXPR.
1859 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
1861 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
1865 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
1867 2009-02-04 Jakub Jelinek <jakub@redhat.com>
1870 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
1871 remove ./dt operator.
1872 * mangle.c (write_expression): Handle COMPONENT_REF after handling
1873 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
1874 write_string ("dt") instead of using operators.def.
1876 2009-02-03 Jason Merrill <jason@redhat.com>
1878 * typeck.c (cp_build_unary_op): Only complain about taking address
1879 of main if pedantic.
1881 2009-02-03 Jakub Jelinek <jakub@redhat.com>
1884 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
1887 * typeck2.c (digest_init_r): Don't call process_init_constructor
1890 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
1893 * pt.c (convert_nontype_argument_function): Expect expr to be an
1897 * typeck.c (merge_types): Call resolve_typename_type if only
1898 one type is a typename.
1900 2009-02-02 Jason Merrill <jason@redhat.com>
1903 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
1906 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
1909 * parser.c (cp_parser_pure_specifier): If there are no tokens left
1910 do not call cp_lexer_consume_token.
1912 2009-01-30 Jakub Jelinek <jakub@redhat.com>
1915 * parser.c (cp_parser_already_scoped_statement): Handle __label__
1918 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1921 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
1923 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1926 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
1928 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1930 * typeck.c (invalid_nonstatic_memfn_p): Use
1931 DECL_NONSTATIC_MEMBER_FUNCTION_P.
1933 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
1936 * call.c (build_over_call): If convert_for_arg_passing returns
1937 error_mark_node unconditionally return it.
1939 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
1941 * class.c (check_field_decls): Also inherit packed for bitfields
1942 regardless of their type.
1944 2009-01-22 Dodji Seketeli <dodji@redhat.com>
1947 * decl2.c (grokfield): Reverting changes of PR c++/26693
1948 (save_template_attributes): Likewise.
1949 * decl.c (grokdeclarator): Likewise.
1950 * name-lookup.c (pushdecl_maybe_friend): Likewise.
1951 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
1952 (append_type_to_template_for_access_check): Likewise.
1953 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1954 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
1956 (resolve_type_name_type): Likewise.
1957 (append_type_to_template_for_access_check): Likewise.
1959 2009-01-21 Dodji Seketeli <dodji@redhat.com>
1962 * decl2.c (grokfield): when a typedef appears in a
1963 class, create the typedef variant type node for it.
1964 (save_template_attributes): Creating typedef variant type node
1965 here is now useless.
1966 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1967 anonymous, set the proper type name to all its type variants.
1968 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1969 set_underlying_type function to install typedef variant types.
1970 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1972 (append_type_to_template_for_access_check): New entry points.
1973 * semantics.c (check_accessibility_of_qualified_id):
1974 When a typedef that is a member of a class appears in a template,
1975 add it to the template. It will be ...
1976 * pt.c (instantiate_class_template, instantiate_template ): ... access
1977 checked at template instantiation time.
1978 (tsubst): Handle the case of being called with NULL args.
1979 (resolve_type_name_type): The type name should be the name of the
1981 (append_type_to_template_for_access_check): New entry point.
1983 2009-01-19 Jason Merrill <jason@redhat.com>
1986 * parser.c (cp_parser_unqualified_id): In a template,
1988 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
1990 2009-01-16 Jason Merrill <jason@redhat.com>
1993 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
1994 * init.c (build_new): Don't call describable_type unless we
1998 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2001 * search.c (protected_accessible_p): N doesn't vary.
2003 2009-01-15 Jason Merrill <jason@redhat.com>
2006 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2007 accept hidden friends.
2009 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2012 * decl.c (grokdeclarator): Check for a non namespace/class context.
2014 2009-01-15 Jason Merrill <jason@redhat.com>
2018 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
2019 a function isn't necessarily an lvalue. Take tree, not const_tree.
2020 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2021 * typeck.c (lvalue_or_else): Likewise.
2022 * cp-tree.h: Adjust prototypes.
2024 2009-01-15 Steve Ellcey <sje@cup.hp.com>
2027 * pt.c (tsubst): Check for NULL args.
2029 2009-01-15 Dodji Seketeli <dodji@redhat.com>
2032 * name-lookup.c (pushtag): Don't create members to types that are not
2035 2009-01-14 Nick Clifton <nickc@redhat.com>
2038 * parser.c: Pass cp_id_kind computed in
2039 cp_parser_postfix_dot_deref_expression to
2040 cp_parser_primary_expression.
2042 2009-01-13 Jakub Jelinek <jakub@redhat.com>
2045 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2046 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2049 2009-01-12 Jason Merrill <jason@redhat.com>
2050 Steve Ellcey <sje@cup.hp.com>
2053 * name-lookup.c (lookup_name_real): Keep looking past a hidden
2056 2009-01-12 Dodji Seketeli <dodji@redhat.com>
2059 * pt.c (parameter_of_template_p): New function.
2060 * cp-tree.h: Declare it.
2061 * name-lookup.c (binding_to_template_parms_of_scope_p): New
2063 (outer_binding): Take template parameters in account when looking for
2066 2009-01-12 Jason Merrill <jason@redhat.com>
2069 * tree.c (pod_type_p): Return 1 for structs created by the back end.
2071 2009-01-12 Jakub Jelinek <jakub@redhat.com>
2074 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2075 offsetof member-designator, handle it as `[0].'.
2078 * decl.c (start_function): If grokdeclarator hasn't returned
2079 FUNCTION_DECL nor error_mark_node, issue diagnostics.
2081 2009-01-11 Jakub Jelinek <jakub@redhat.com>
2084 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2085 (gimplify_if_stmt): ... this.
2086 (cp_gimplify_expr): Don't handle IF_STMT here.
2087 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2089 2009-01-10 Andrew Pinski <pinskia@gmail.com>
2092 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2095 * typeck2.c (build_functional_cast): Check for reference type and NULL
2098 2009-01-09 Steve Ellcey <sje@cup.hp.com>
2100 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2102 2009-01-09 Jakub Jelinek <jakub@redhat.com>
2105 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2107 2009-01-09 John F. Carr <jfc@mit.edu>
2110 * parser.c (cp_parser_class_specifier): Clear
2111 parser->in_unbraced_linkage_specification_p while parsing class
2114 2009-01-07 Jakub Jelinek <jakub@redhat.com>
2117 * semantics.c (finish_goto_stmt): Convert destination to
2120 2009-01-06 Jason Merrill <jason@redhat.com>
2127 * pt.c (check_default_tmpl_args): Don't complain about
2128 out-of-order parameter packs in the enclosing class
2129 or parameter packs after default args.
2130 (coerce_template_parms): If we have more than one
2131 parameter pack, don't flatten argument packs.
2132 (template_args_equal): Handle argument packs.
2133 (comp_template_args): Don't flatten argument packs.
2134 (check_instantiated_arg): Split out from...
2135 (check_instantiated_args): Here. Handle arg packs.
2136 (convert_template_argument): Just check that nontype argument
2137 packs have the right type.
2139 2009-01-05 Dodji Seketeli <dodji@redhat.com>
2142 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2144 2009-01-05 Jason Merrill <jason@redhat.com>
2147 * typeck2.c (process_init_constructor_union): Handle union with
2150 * mangle.c (write_expression): Remove mangling for zero-operand
2154 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2158 * class.c (defaultable_fn_p): Only operator== can be a copy
2159 assignment operator.
2161 2009-01-02 Jason Merrill <jason@redhat.com>
2164 * typeck2.c (process_init_constructor_union): Handle excess
2166 (process_init_constructor_record): Likewise.
2169 * typeck2.c (digest_init_r): Don't use process_init_constructor
2170 for non-aggregate classes.
2173 Copyright (C) 2009 Free Software Foundation, Inc.
2175 Copying and distribution of this file, with or without modification,
2176 are permitted in any medium without royalty provided the copyright
2177 notice and this notice are preserved.