1 2009-09-03 Jason Merrill <jason@redhat.com>
3 * class.c (currently_open_class): Make sure we're dealing with the
6 * cp-tree.h (enum overload_flags): Remove OP_FLAG.
7 * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
9 * name-lookup.c (is_class_level): Remove.
10 (push_binding_level, leave_scope, resume_scope): Adjust.
11 (pushlevel_class): Adjust.
12 (poplevel_class): Make sure we're on class_binding_level.
14 * decl.c (grokmethod): Rename from start_method.
15 (finish_method): Remove.
17 * parser.c (cp_parser_save_member_function_body): Adjust.
19 2009-09-03 Doug Kwan <dougkwan@google.com>
21 * tree.c (cp_fix_function_decl_p): New.
22 (cp_free_lang_data): New.
24 2009-09-03 Diego Novillo <dnovillo@google.com>
26 * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
27 * decl2.c: Include pointer-set.h.
28 (collect_candidates_for_java_method_aliases): New.
29 (cp_write_global_declarations): Call it.
30 Add local variable CANDIDATES. If set, call
31 build_java_method_aliases.
32 (build_java_method_aliases): Add argument CANDIDATES.
33 Use it to determine if FNDECL should get a hidden alias.
34 * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
35 * cp-tree.h (cp_free_lang_data): Declare.
37 2009-09-03 Richard Guenther <rguenther@suse.de>
39 * method.c (use_thunk): Use cgraph_finalize_function to hand
40 off thunks to the cgraph.
41 * semantics.c (emit_associated_thunks): Do not emit thunks
42 for really extern functions.
44 2009-09-03 Diego Novillo <dnovillo@google.com>
46 * cp-lang.c (lang_hooks): Remove const qualifier.
48 2009-09-02 Jason Merrill <jason@redhat.com>
50 * semantics.c (describable_type): Don't pretend to be in a template.
52 * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
54 2009-09-01 Alexandre Oliva <aoliva@redhat.com>
56 * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
57 * cp-lang.c (cxx_dwarf_name): Pass it.
58 * error.c (count_non_default_template_args): Take flags as
59 argument. Adjust all callers. Skip counting of default
60 arguments if the new flag is given.
62 2009-09-01 Dodji Seketeli <dodji@redhat.com>
65 * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
68 2009-09-01 Richard Guenther <rguenther@suse.de>
70 * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
71 * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
73 2009-09-01 Richard Guenther <rguenther@suse.de>
75 * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
77 2009-08-31 Dodji Seketeli <dodji@redhat.com>
80 * cp-tree.h (get_template_info): Parameter should be const.
81 (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
82 (get_template_argument_pack_elems,
83 get_primary_template_innermost_parameters,
84 get_template_innermost_arguments, template_template_parameter_p):
86 * pt.c (get_template_argument_pack_elems,
87 get_template_innermost_parameters, get_template_innermost_arguments,
88 template_template_parameter_p):
89 ... New C++ front end implementation of new language hooks.
90 (primary_template_instantiation_p): New private helper.
91 (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
93 (get_template_info): Const-ify parameter.
94 * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
95 LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
96 LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
97 LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
98 interfaces for the C++ front-end.
100 2009-08-31 Jason Merrill <jason@redhat.com>
103 * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
104 type-specifier-seq before we commit.
106 2009-08-28 Richard Guenther <rguenther@suse.de>
109 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
112 2009-08-27 Richard Guenther <rguenther@suse.de>
114 * class.c (build_vtbl_ref_1): Remove excess vertical space.
115 * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
116 tracked by $(TREE_H).
117 * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
119 2009-08-26 Jason Merrill <jason@redhat.com>
121 * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
122 if we're contextually converting to bool.
123 (build_conditional_expr): Likewise.
124 * typeck.c (condition_conversion): Likewise.
126 * call.c (build_conditional_expr): Fix logic errors.
127 (build_new_op): Remove dead COND_EXPR handling.
129 2009-08-24 Jason Merrill <jason@redhat.com>
131 * cp-tree.h (DECL_DEFERRED_FN): Remove.
132 (struct lang_decl_fn): Remove deferred flag.
133 * class.c (build_clone): Don't set it.
134 * decl2.c (note_vague_linkage_fn): Don't check or set it.
135 (mark_used): Don't check it.
136 * method.c (make_thunk, make_alias_for): Don't set it.
138 * decl2.c (mark_used): Streamline logic.
143 * cp-tree.h (DECL_ODR_USED): New macro.
144 (struct lang_decl_base): Add odr_used flag.
145 * decl.c (duplicate_decls): Propagate it. Use it for error.
146 * pt.c (register_specialization): Use it for error.
147 * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
148 (cp_write_global_declarations): Use it for error.
149 (tree_used_ok): Remove.
150 * cp-tree.h: Remove tree_used_ok.
151 * call.c (build_call_a): Don't call it.
152 * init.c (build_offset_ref): Likewise.
154 2009-08-21 Jakub Jelinek <jakub@redhat.com>
157 * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
160 2009-08-19 Jason Merrill <jason@redhat.com>
164 * decl2.c (mark_used): Increment function_depth during synthesis.
165 * parser.c (cp_parser_default_argument): Not here.
167 2009-08-19 Jakub Jelinek <jakub@redhat.com>
169 * method.c (use_thunk): Call free_after_compilation after
170 assemble_end_function.
172 2009-08-17 Richard Guenther <rguenther@suse.de>
174 * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
176 (finish_enum): Keep variant chain intact.
177 * tree.c (cp_build_reference_type): Likewise.
179 2009-08-16 Jason Merrill <jason@redhat.com>
181 Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
182 and VAR_DECL, so mark_used only has effect the first time.
183 * decl2.c (mark_used): Just return if TREE_USED is already set.
184 Don't set TREE_USED if cp_unevaluated_operand is set.
185 (tree_used_ok): New fn.
186 * init.c (build_offset_ref): Check it instead of TREE_USED.
187 * call.c (build_call_a): Likewise.
188 * cp-tree.h: Declare it.
189 (DECL_NO_LINKAGE_CHECKED): No longer needed.
190 (struct lang_decl_base): Remove no_linkage_checked bitfield.
192 * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
194 * decl2.c (mark_used): It's ok to synthesize for default args now.
196 2009-08-10 Jason Merrill <jason@redhat.com>
198 Implement DR 757: It's OK for a decl to use a type without linkage
199 so long as the decl is defined in the current translation unit.
200 * decl2.c (no_linkage_decls): New vector.
201 (mark_used): Add decls that use types with no linkage.
202 (cp_write_global_declarations): Check that they are defined.
203 (decl_defined_p, no_linkage_error): New fns.
204 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
205 (struct lang_decl_base): Add flag.
206 * decl.c (grokfndecl): Don't check type linkage.
207 (grokvardecl): If the type has no linkage, just make sure
208 DECL_LANG_SPECIFIC is set.
209 * pt.c (check_instantiated_arg): Don't check type linkage.
210 * name-lookup.c (is_local_extern): New fn.
211 * name-lookup.h: Declare it.
213 2009-08-05 Jason Merrill <jason@redhat.com>
216 * init.c (build_vec_init): Evaluate the initializer before
217 starting the initialization try block.
219 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
222 * typeck.c (convert_for_assignment): Do not warn for any boolean
223 variant. Use explicit location.
225 2009-08-04 Dodji Seketeli <dodji@redhat.com>
228 * pt.c (tsubst_default_argument): Let access checks of the
229 default argument happen in the context of the current function.
231 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
234 * call.c (build_new_op): Only try prefix operator if -fpermissive,
235 otherwise just error.
237 2009-08-04 Dodji Seketeli <dodji@redhat.com>
240 * error.c (lang_decl_name): Print qualified names for decls
243 2009-08-03 Jason Merrill <jason@redhat.com>
244 Jakub Jelinek <jakub@redhat.com>
247 * init.c (build_vec_init): Look through a TARGET_EXPR around a
250 2009-07-31 Jason Merrill <jason@redhat.com>
251 Douglas Gregor <doug.gregor@gmail.com>
253 Remove implicit binding of lvalues to rvalue references (N2831)
254 * call.c (convert_class_to_reference): Binding an lvalue to an
255 rvalue reference is bad. If the user-defined conversion is bad,
256 set bad_p before merging conversions.
257 (maybe_handle_ref_bind): Don't push down bad_p.
258 (reference_binding): Binding an lvalue to an rvalue reference is bad.
259 (convert_like_real): Give a helpful error about binding lvalue
261 (reference_related_p): No longer static.
262 * typeck.c (build_typed_address): New.
263 (build_static_cast_1): Add static_cast from lvalue to &&.
266 2009-07-31 Jason Merrill <jason@redhat.com>
268 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
269 Do direct binding of "rvalues" in memory to rvalue references.
270 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
272 * typeck.c (build_static_cast_1): Do direct binding of memory
273 "rvalues" to rvalue references.
274 * cvt.c (cp_fold_convert): New.
275 * cp-tree.h: Declare it.
277 2009-07-31 Jason Merrill <jason@redhat.com>
279 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
280 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
282 2009-07-29 Jason Merrill <jason@redhat.com>
285 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
286 * error.c (count_non_default_template_args): Pass it.
287 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
289 2009-07-29 Richard Guenther <rguenther@suse.de>
292 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
295 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
298 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
299 with a qualified return type.
301 2009-07-24 Jason Merrill <jason@redhat.com>
304 * call.c (build_op_delete_call): If this is for a new-expression
305 and the op delete is deleted, do nothing.
308 * call.c (compare_ics): Give list-initialization of std::init_list
309 priority over conversion to scalar, too.
311 2009-07-22 Jason Merrill <jason@redhat.com>
313 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
314 (needs_fake_anon): New.
315 (write_name): Check it.
316 (write_nested_name): Add a fake anonymous namespace scope if true.
317 * name-lookup.c (get_anonymous_namespace_name): No longer static.
318 * rtti.c, cp-tree.h: Adjust.
320 2009-07-22 Richard Guenther <rguenther@suse.de>
323 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
325 (cp_genericize_r): ... genericization stage.
326 (cp_genericize): Adjust.
328 2009-07-21 Jason Merrill <jason@redhat.com>
331 * call.c (reference_binding): Implement binding to { }.
332 (initialize_reference): Binding temporary to non-const && is fine.
333 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
335 * decl.c (reshape_init_r): { T } is not an aggregate initializer
338 2009-07-17 Richard Guenther <rguenther@suse.de>
341 * decl.c (finish_function): Do not emit unused result warnings
343 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
344 c_warn_unused_result_pass.
345 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
346 * optimize.c (clone_body): Clone in GENERIC.
347 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
348 * decl2.c (cp_write_global_declarations): Fix body test.
349 Do not call cgraph_optimize.
350 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
351 * method.c (use_thunk): Register thunk with
352 cgraph_finalize_function.
353 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
355 2009-07-17 Richard Guenther <rguenther@suse.de>
357 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
360 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
361 Manuel López-Ibáñez <manu@gcc.gnu.org>
364 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
365 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
366 call.c, cvt.c, mangle.c: Add location argument to
367 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
368 build_size_arg, build_fold_addr_expr, build_call_array,
369 non_lvalue, size_diffop, fold_build1_initializer,
370 fold_build2_initializer, fold_build3_initializer,
371 fold_build_call_array, fold_build_call_array_initializer,
372 fold_single_bit_test, omit_one_operand, omit_two_operands,
373 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
374 fold_indirect_ref, combine_comparisons, fold_builtin_*,
375 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
376 round_up, round_down.
378 2009-07-16 Jason Merrill <jason@redhat.com>
381 Split POD into "standard-layout" and "trivial" as per N2230,
382 Support std::is_standard_layout and std::is_trivial traits.
383 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
385 (struct lang_type_class): Add non_std_layout.
386 (CLASSTYPE_NON_STD_LAYOUT): New.
387 * class.c (check_bases): Set it.
388 (check_field_decls): Likewise.
389 (check_bases_and_members): Likewise.
390 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
392 (cp_parser_trait_expr): Likewise.
393 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
395 (finish_trait_expr): Likewise.
396 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
397 (pod_type_p): Use them.
398 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
400 Adjust bits of the language that no longer refer to POD types.
401 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
402 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
403 (build_x_va_arg): Likewise.
404 (call_builtin_trap): Remove.
405 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
406 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
407 (cp_finish_decl): Likewise.
408 (check_previous_goto_1, check_goto): Adjust error.
409 * typeck.c (build_class_member_access_expr): Check
410 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
412 2009-07-14 Taras Glek <tglek@mozilla.com>
413 Rafael Espindola <espindola@google.com>
415 * Make-lang.in: Added CP_PLUGIN_HEADERS and
416 c.install-target to export cp-tree.h cxx-pretty-print.h
417 name-lookup.h headers for plugins.
419 2009-07-14 Jason Merrill <jason@redhat.com>
422 * decl.c (decls_match): A non-extern-C declaration doesn't match
423 a builtin extern-C declaration.
426 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
427 looking in used namespaces just because we found something on
431 * semantics.c (perform_koenig_lookup): Handle empty template args.
433 * call.c (build_over_call): Use can_trust_pointer_alignment.
435 2009-07-14 Dodji Seketeli <dodji@redhat.com>
439 * decl2.c (grokfield): Don't call set_underlying_type on typedef
440 decls that are type names.
442 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
445 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
446 front of qualified names.
448 2009-07-12 Jason Merrill <jason@redhat.com>
451 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
454 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
455 * tree.c (lvalue_p_1): Return it. Remove
456 treat_class_rvalues_as_lvalues parm.
457 (real_lvalue_p): Disallow pseudo-lvalues here.
458 (lvalue_or_rvalue_with_address_p): New fn.
459 * call.c (initialize_reference): Use it instead of real_lvalue_p.
462 * init.c (build_new_1): Handle initializer list as array initializer.
463 (build_vec_init): Likewise.
464 * typeck.c (cp_build_modify_expr): Likewise.
465 * typeck2.c (process_init_constructor_array): Error rather than abort
466 if too many initializers.
468 2009-07-10 Jakub Jelinek <jakub@redhat.com>
471 * error.c (cp_print_error_function): Check for NULL block.
473 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
474 Jason Merrill <jason@redhat.com>
476 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
477 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
479 2009-07-09 Dodji Seketeli <dodji@redhat.com>
482 * pt.c (type_unification_real): Use tsubst_template_arg instead
483 of tsubst to substitute default template arguments.
485 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
488 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
490 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
493 2009-07-07 Jason Merrill <jason@redhat.com>
496 * pt.c (tsubst_decl): Don't abort if we didn't change anything
497 in a TEMPLATE_DECL's args.
499 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
501 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
504 2009-07-07 Jason Merrill <jason@redhat.com>
507 * decl.c (build_enumerator): Don't add enumerators for a
508 scoped enum to the enclosing class.
511 * decl.c (start_enum): Allow dependent underlying type.
514 * decl.c (finish_enum): Finish scope even in a template.
516 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
518 * init.c: Replace %J by an explicit location. Update all calls.
520 * typeck2.c: Likewise.
522 * name-lookup.c: Likewise.
524 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
526 * decl.c: Replace %H by an explicit location. Update all calls.
527 * except.c: Likewise.
528 * semantics.c: Likewise.
529 * parser.c: Likewise.
531 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
534 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
535 append_type_to_template_for_access_check_1): Use
536 RECORD_OR_UNION_CODE_P.
538 2009-07-04 Jason Merrill <jason@redhat.com>
540 * pt.c (retrieve_specialization): Don't get confused by a
541 using-declaration that brings in another instance of this template
544 * ptree.c (cxx_print_type): Fix logic.
546 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
549 * cp-tree.h (struct lang_decl_parm): New.
550 (struct lang_decl): Add it.
551 (LANG_DECL_PARM_CHECK): New.
552 (DECL_PARM_INDEX): New.
553 * decl2.c (parm_index): Remove.
554 * lex.c (retrofit_lang_decl): Handle parms.
555 (cxx_dup_lang_specific_decl): Likewise.
556 * mangle.c (write_expression): Adjust.
557 * tree.c (cp_tree_equal): Adjust.
558 (decl_linkage): Only check DECL_COMDAT for functions and variables.
559 * parser.c (cp_parser_parameter_declaration_list): Set
561 * pt.c (iterative_hash_template_arg): Hash it.
563 2009-07-03 Jason Merrill <jason@redhat.com>
565 * cp-tree.h (struct lang_decl): Overhaul.
566 (struct lang_decl_flags): Remove.
567 (struct lang_decl_base): New.
568 (struct lang_decl_min): New.
569 (struct lang_decl_fn): New.
570 (struct lang_decl_ns): New.
571 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
572 (LANG_DECL_MIN_CHECK): New.
573 (LANG_DECL_FN_CHECK): New.
574 (LANG_DECL_NS_CHECK): New.
575 (STRIP_TEMPLATE): New.
576 (NON_THUNK_FUNCTION_CHECK): Remove.
577 (DECL_DECLARES_FUNCTION_P): New.
579 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
580 * decl.c (push_local_name, duplicate_decls): Adjust.
581 * decl2.c (start_objects): Don't set u2sel.
582 * semantics.c (finish_omp_threadprivate): Adjust.
583 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
584 (decl_cloned_function_p): Out-of-line implementation of macros.
585 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
586 * mangle.c (write_unqualified_name): Don't check function flags
588 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
589 * pt.c (build_template_decl): Don't set function flags.
590 (check_default_tmpl_args): Check that it's a function.
591 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
594 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
595 DECL_CLONED_FUNCTION.
597 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
598 * class.c (finish_struct_1): Adjust.
599 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
600 * search.c (lookup_field_1): Adjust.
602 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
603 * decl.c (finish_method): Don't add to it.
604 * class.c (fixup_pending_inline): Remove.
605 (fixup_inline_methods): Remove.
606 (finish_struct_1): Don't call it.
608 * error.c (dump_function_name): Handle null name.
610 2009-07-02 Mark Mitchell <mark@codesourcery.com>
612 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
613 in arithmetic earlier and allow comparisions of NULL with
616 2009-07-02 Jason Merrill <jason@redhat.com>
618 Use hash tables for template specialization lookup.
619 * pt.c (struct spec_entry): New type.
620 (decl_specializations, type_specializations): New hash tables.
621 (register_specialization, retrieve_specialization): Use them.
622 (reregister_specialization, lookup_template_class): Use them.
623 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
624 (iterative_hash_template_arg): New.
625 (init_template_processing): New
626 (process_partial_specialization): Don't look to see if we already
627 have this partial specialization.
628 (maybe_process_partial_specialization): Handle reassigning
629 full specializations when we get an explicit specialization
630 of the partial instantiation.
631 (tsubst_friend_function): Adjust specialization reassignment code.
632 (instantiate_template): Only do one lookup.
633 (instantiate_decl): Don't do any lookup.
634 * cp-tree.h: Declare init_template_processing.
635 * decl.c (duplicate_decls): Pass args to reregister_specialization.
637 2009-07-01 Jason Merrill <jason@redhat.com>
639 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
641 * pt.c (register_specialization): Use duplicate_decls to merge
642 the argument with a previous specialization.
643 (check_explicit_specialization): Call register_specialization to
644 merge the TEMPLATE_DECL with a previous version.
645 (determine_specialization): Return the args even if fn is a template.
647 2009-07-01 Ian Lance Taylor <iant@google.com>
649 * g++spec.c (lang_specific_driver): Bump num_args by 1.
651 2009-06-30 Jason Merrill <jason@redhat.com>
654 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
657 2009-06-29 Jason Merrill <jason@redhat.com>
660 * error.c (dump_template_parms): Pass all args to
661 count_non_default_template_args.
662 (count_non_default_template_args): Pull out the inner ones.
664 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
666 * decl.c (duplicate_decls): Re-indent.
668 2009-06-25 Ian Lance Taylor <iant@google.com>
670 * call.c (avoid_sign_compare_warnings): New static function.
671 (build_new_op): Call it.
672 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
673 TREE_NO_WARNING is set on either operand.
675 2009-06-25 Ian Lance Taylor <iant@google.com>
677 * g++spec.c (SKIPOPT): define.
678 (lang_specific_driver): Handle -static-libstdc++. Only add
679 LIBSTDCXX_STATIC if we add LIBSTDCXX.
681 2009-06-25 Ian Lance Taylor <iant@google.com>
683 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
684 the second nor third operand has side effects.
686 2009-06-25 Ian Lance Taylor <iant@google.com>
688 * parser.c (cp_parser_binary_expression): Increment
689 c_inhibit_evaluation_warnings while parsing the right hand side of
690 "true || x" or "false && x".
691 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
692 if c_inhibit_evaluation_warnings is zero.
694 2009-06-24 Jason Merrill <jason@redhat.com>
696 * error.c (dump_decl): Do say "typedef" for the injected class name.
698 * pt.c (lookup_template_class): Use currently_open_class,
699 compare template args later.
702 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
703 * class.c (resolve_address_of_overloaded_function): Fix typo.
705 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
707 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
708 * decl.c (finish_decl): Remove.
709 (declare_global_var): Replace finish_decl with cp_finish_decl.
710 (start_method): Same.
711 * rtti.c (emit_tinfo_decl): Same.
712 * pt.c (tsubst_expr): Same.
713 (instantiate_decl): Same.
714 * decl2.c (grokbitfield): Same.
715 * name-lookup.c (pushdecl_top_level_1): Same.
716 * cp-tree.h: Remove finish_decl.
718 2009-06-16 David Edelsohn <edelsohn@gnu.org>
720 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
721 (lang_specific_driver): Always allocate extra argument.
722 Add LIBSTDCXX_STATIC to arglist if defined and linking
725 2009-06-16 Ian Lance Taylor <iant@google.com>
727 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
728 (cp/semantics.o): Depend upon gt-cp-semantics.h.
730 2009-06-16 Ian Lance Taylor <iant@google.com>
732 * parser.c (cp_unevaluated_operand): Define global variable.
733 (cp_parser_question_colon_clause): Increment
734 c_inhibit_evaluation_warnings when evaluating an expression which
735 will never be executed.
736 (cp_parser_decltype): Increment cp_unevaluated_operand and
737 c_inhibit_evaluation_warnings, not skip_evaluation.
738 (cp_parser_sizeof_operand): Likewise.
739 (cp_parser_enclosed_template_argument_list): Save
740 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
742 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
743 Add unevaluated_operand and inhibit_evaluation_warnings fields.
744 (cp_unevaluated_operand): Declare.
745 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
746 and c_inhibit_evaluation_warnings rather than skip_evaluation.
747 (pop_from_top_level): Restore cp_unevaluated_operand and
748 c_inhibit_evaluation_warnings rather than skip_evaluation.
749 * class.c (build_base_path): Check cp_unevaluated_operand rather
750 than skip_evaluation.
751 * typeck.c (build_class_member_access_expr): Likewise.
752 (cp_build_binary_op): Don't warn about bad shift counts if
753 c_inhibit_evaluation_warnings is non-zero.
754 * pt.c (coerce_template_parms): Save state of
755 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
757 (tsubst_aggr_type): Likewise.
758 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
760 (tsubst_copy): Likewise.
761 (tsubst): Set cp_unevaluated_operand and
762 c_inhibit_evaluation_warnings, not skip_evaluation.
763 (tsubst_copy_and_build): Likewise.
764 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
765 rather than skip_evaluation.
766 * decl2.c (mark_used): Likewise.
767 * semantics.c (finish_non_static_data_member): Likewise.
768 * cvt.c (cp_convert_and_check): Check
769 c_inhibit_evaluation_warnings rather than skip_evaluation.
770 * mangle.c (write_type): Set cp_unevaluated_operand rather than
773 2009-06-15 Ian Lance Taylor <iant@google.com>
775 * parser.c (cp_parser_direct_declarator): Add braces around
776 variables declared before label.
778 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
780 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
781 * cp-tree.h (cxx_comdat_group): Change signature.
782 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
783 (cxx_comdat_group): Change signature.
784 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
786 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
787 * method.c (use_thunk): Update call to make_decl_one_only.
788 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
790 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
792 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
793 (build_modify_expr): New arg.
794 * semantics.c (finish_unary_op_expr): Pass location to
796 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
797 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
798 c_sizeof_or_alignof_type.
799 (build_array_ref): New argument.
800 (build_compound_expr): Same.
801 (build_const_cast): Same.
802 (build_ptrmemfunc): Pass location to build_c_cast.
803 * init.c (avoid_placement_new_aliasing): Pass location to
805 (build_vec_delete_1): Pass location to cp_build_modify_expr,
807 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
808 * decl.c (poplevel): Pass location to c_build_bind_expr.
809 (finish_case_label): Pass location to build_case_label.
810 (finish_constructor_body): Same.
811 (finish_destructor_body): Pass location to build_stmt.
812 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
813 * call.c (build_new_op): Pass location to build_array_ref.
814 (build_x_va_arg): Pass location to build_va_arg.
815 * except.c (expand_end_catch_block): Pass location to
817 * cp-tree.h (build_array_ref): New argument.
818 (build_compound_expr): Same.
819 (build_c_cast): Same.
820 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
821 (gimplify_switch_stmt): Same.
822 * typeck2.c (split_nonconstant_init_1): Same.
823 * pt.c (tsubst_copy): Same.
824 * semantics.c (add_decl_expr): Same.
826 (push_cleanup): Same.
827 (finish_goto_stmt): Same.
828 (finish_expr_stmt): Same.
829 (begin_if_stmt): Same.
830 (begin_while_stmt): Same.
831 (begin_do_stmt): Same.
832 (finish_return_stmt): Same.
833 (begin_for_stmt): Same.
834 (finish_break_stmt): Same.
835 (finish_continue_stmt): Same.
836 (begin_switch_stmt): Same.
837 (begin_try_block): Same.
838 (begin_handler): Same.
839 (finish_asm_stmt): Same.
840 (finish_label_stmt): Same.
841 (finish_stmt_expr_expr): Same.
842 (finalize_nrv_r): Same.
843 (finish_omp_atomic): Same.
844 * name-lookup.c (do_using_directive): Same.
845 * decl2.c (grok_array_decl): Same.
846 * parser.c (cp_parser_cast_expression): Same.
847 (cp_parser_selection_statement): Same.
848 (cp_parser_implicitly_scoped_statement): Same.
849 (cp_parser_objc_selector_expression): Same.
850 (cp_parser_objc_synchronized_statement): Same.
851 (cp_parser_objc_throw_statement): Same.
852 (cp_parser_omp_critical): Same.
853 (cp_parser_omp_master): Same.
854 * typeck.c (build_function_call): Add location argument.
855 * init.c: Add location argument to all build_decl calls.
864 * cp-gimplify.c: Same.
866 (cp_make_fname_decl): Add location argument. Pass location ot
868 (finish_case_label): Same.
869 * cp-tree.h (finish_case_label): Add location argument.
870 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
873 2009-06-09 Jason Merrill <jason@redhat.com>
876 * decl2.c (mark_used): Return after complaining about deleted fn.
878 2009-06-08 Jason Merrill <jason@redhat.com>
880 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
881 late-specified return type.
883 2009-06-08 Jakub Jelinek <jakub@redhat.com>
886 * call.c (check_dtor_name): Return false even if
887 get_type_value (name) is error_mark_node.
891 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
892 on error_mark_node. Check for VLAs outside of function context
893 before check whether to wrap bounds into a NOP_EXPR with
896 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
898 * repo.c (get_base_filename): Use aux_base_name rather than
899 alternate temporary file during second compare debug compilation.
900 (finish_repo): Skip during -fcompare-debug-second.
902 2009-06-06 Ian Lance Taylor <iant@google.com>
904 * parser.c (cp_parser_label_for_labeled_statement): Support
905 attribute on labels if immediately followed by semicolon.
906 * semantics.c (finish_label_stmt): Return new label.
907 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
909 2009-06-03 Ian Lance Taylor <iant@google.com>
911 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
914 2009-06-02 Mark Mitchell <mark@codesourcery.com>
916 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
918 2009-06-02 Jason Merrill <jason@redhat.com>
922 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
924 * call.c (implicit_conversion): Allow init-list conversion to scalar
925 during direct-initialization, too. Mark the conversion bad if it
926 has too many levels of braces.
927 (convert_like_real): And give a helpful error.
931 * decl.c (cp_finish_decl): Handle auto deduction from ().
932 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
933 with dependent type that is known to be a pointer.
935 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
938 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
939 specializations in an invalid namespace.
941 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
943 * error.c (print_instantiation_partial_context): Print column
946 2009-05-29 Ian Lance Taylor <iant@google.com>
948 * error.c (cp_printer): Don't use va_arg with enum type.
950 2009-05-28 Dodji Seketeli <dodji@redhat.com>
953 * cp-tree.h (canonical_type_variant): Remove this function declaration.
954 (strip_typedefs): New function declaration.
955 * tree.c (strip_typedefs): New function definition.
956 (canonical_type_variant): Remove function definition.
957 * cvt.c (convert_from_reference): No need to use
958 canonical_type_variant.
959 * typeck.c (cp_build_indirect_ref): Likewise.
960 * error.c (dump_template_bindings): Use strip_typedefs instead of
961 canonical_type_variant.
962 * pt.c (convert_template_argument, unify): Likewise.
963 * mangle.c (canonicalize_for_substitution): Don't use
964 canonical_type_variant.
966 2009-05-27 Jason Merrill <jason@redhat.com>
968 * call.c (implicit_conversion): Handle conversion from
969 initializer-list to scalar.
970 (convert_like_real): Likewise. Avoid crashing on list
971 initialization with bad conversions.
972 (can_convert): Use LOOKUP_EXPLICIT.
973 (can_convert_arg_bad): Add flags parm.
975 * typeck.c (convert_for_assignment): Pass flags.
977 2009-05-27 Ian Lance Taylor <iant@google.com>
979 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
980 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
982 2009-05-26 Ian Lance Taylor <iant@google.com>
984 * Make-lang.in (g++spec.o): Use $(COMPILER).
985 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
986 (cc1plus$(exeext)): Likewise.
988 2009-05-26 Dodji Seketeli <dodji@redhat.com>
991 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
992 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
993 (get_types_needing_access_check): Declare new entry point.
994 * pt.c (append_type_to_template_for_access_check_1,
995 get_types_needing_access_check): New functions.
996 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
997 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
998 get_types_needing_access_check, no more
999 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1000 (instantiate_class_template): Set input_location to the source
1001 location of the most specialized template definition.
1002 Perform access check using the RECORD_TYPE of the template, not its
1003 associated most generic TEMPLATE_DECL.
1004 (append_type_to_template_for_access_check): Augment function
1005 comments. Use the new get_types_needing_access_check, not
1006 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1007 append_type_to_template_for_access_check_1 subroutine.
1009 2009-05-22 Jason Merrill <jason@redhat.com>
1012 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1013 arithmetic comparisons.
1014 (cp_common_type): Handle scoped enums.
1016 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1017 (add_builtin_candidate, add_builtin_candidates): Likewise.
1018 (convert_like_real): Likewise.
1019 * class.c (check_bitfield_decl): Likewise.
1020 * decl.c (check_static_variable_definition): Likewise.
1021 (compute_array_index_type): Likewise.
1022 * decl2.c (grokbitfield): Likewise.
1023 * init.c (build_new_1): Likewise.
1024 * pt.c (convert_nontype_argument): Likewise.
1025 (current_instantiation): Likewise.
1026 * tree.c (pod_type_p): Likewise.
1027 * typeck.c (build_static_cast_1): Likewise.
1028 (build_reinterpret_cast_1): Likewise.
1030 2009-05-22 Richard Guenther <rguenther@suse.de>
1033 * init.c (avoid_placement_new_aliasing): Remove.
1034 (build_new_1): Do not call it.
1036 2009-05-22 Mark Mitchell <mark@codesourcery.com>
1038 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1039 * semantics.c (expand_or_defer_fn): Similarly.
1041 2009-05-20 Ian Lance Taylor <iant@google.com>
1043 * parser.c (cp_parser_postfix_expression): Change args to a vec.
1044 Release it when done.
1045 (tree_vector): Define typedef. Define VEC functions.
1046 (cp_parser_parenthesized_expression_list): Change return type to
1047 vec. Change all callers.
1048 (cp_parser_new_expression): Change placement and initializer to
1049 vecs. Release them when done.
1050 (cp_parser_new_placement): Change return type to vec. Change all
1052 (cp_parser_new_initializer): Likewise.
1053 * typeck.c (build_function_call_vec): Just call
1054 cp_build_function_call_vec.
1055 (cp_build_function_call): Just build a vec and call
1056 cp_build_function_call_vec.
1057 (cp_build_function_call_vec): New function based on old
1058 cp_build_function_call.
1059 (convert_arguments): Remove nargs and argarray parameters. Change
1060 values to a vec. Change caller.
1061 (build_x_compound_expr_from_vec): New function.
1062 (cp_build_modify_expr): Build vec to pass to
1063 build_special_member_call.
1064 * call.c (struct z_candidate): Add first_arg field. Change args
1066 (convert_class_to_reference): Handle first argument separately.
1067 (add_candidate): Add first_arg parameter. Change args parameter
1068 to vec. Change all callers.
1069 (add_function_candidate, add_conv_candidate): Likewise.
1070 (add_template_candidate_real, add_template_candidate): Likewise.
1071 (add_template_conv_candidate): Likewise.
1072 (build_user_type_conversion_1): Handle first argument separately.
1073 (resolve_args): Change return type and parameter type to vecs.
1075 (perform_overload_resolution): Change args parameter to vec.
1077 (build_new_function_call, build_operator_new_call): Likewise.
1078 (add_candidates): Likewise.
1079 (build_op_call): New globally visible function, built from and
1080 replacing static function build_object_call.
1081 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
1083 (build_op_delete_call): Build vec to pass to
1084 cp_build_function_call_vec.
1085 (build_temp): Build vec to pass to build_special_member_call.
1086 (convert_like_real): Likewise.
1087 (perform_direct_initialization_if_possible): Likewise.
1088 (build_over_call): Handle first_arg field. Use build_call_array
1089 rather than build_call_list.
1090 (build_special_member_call): Change args parameter to vec. Change
1092 (build_new_method_call): Likewise.
1093 * init.c (expand_default_init): Change parms to vec.
1094 (build_raw_new_expr): Change placement and init to vecs. Change
1096 (build_new_1, build_new): Likewise.
1097 * class.c (resolve_address_of_overloaded_function): Build array to
1098 pass to fn_type_unification.
1099 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1100 build_new. For CALL_EXPR create a vec rather than a tree_list;
1101 expand a pack if necessary.
1102 (fn_type_unification): Change args parameter to const tree *. Add
1103 nargs parameter. Change all callers.
1104 (type_unification_real): Likewise.
1105 (unify): Build array to pass to type_unification_real.
1106 (get_bindings): Build array to pass to fn_type_unification.
1107 (any_type_dependent_arguments_p): Change args parameter to a vec.
1109 (make_args_non_dependent): Renamed from build_non_dependent_args.
1110 Change return type to void. Change parameter type to vec. Change
1112 (do_auto_deduction): Pass an array to type_unification_real.
1113 * semantics.c (perform_koenig_lookup): Change args to vec. Change
1115 (finish_call_expr): Change args to vec. Change all callers. Call
1116 build_op_call instead of passing CALL_EXPR to build_new_op.
1117 (cxx_omp_create_clause_info): Allocate vec to pass to
1118 build_special_member_call.
1119 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1120 to vec. Change all callers.
1121 * name-lookup.c (lookup_function_nonclass): Likewise.
1122 (struct arg_lookup): Change args to vec.
1123 (arg_assoc_namespace): Handle args as a vec.
1124 (arg_assoc_args_vec): New static function.
1125 (lookup_arg_dependent): Change args parameter to vec. Change all
1127 * method.c (do_build_assign_ref): Allocate vec to pass to
1128 build_special_member_call.
1129 * except.c (build_throw): Likewise.
1130 * typeck2.c (build_functional_cast): Likewise.
1131 * cvt.c (ocp_convert): Likewise.
1132 * tree.c (build_min_non_dep_call_vec): Change last parameter to
1133 vec. Change all callers.
1134 * cp-tree.h: Update declarations.
1135 * name-lookup.h: Update declarations.
1137 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
1139 * typeck.c (default_conversion): Check targetm.promoted_type.
1140 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1141 (grokparms): Check targetm.invalid_parameter_type.
1142 * cvt.c (ocp_convert): Check targetm.convert_to_type.
1143 (build_expr_type_conversion): Check targetm.promoted_type.
1145 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
1147 * typeck.c (build_binary_op): Allow % on integal vectors.
1149 2009-05-18 Jason Merrill <jason@redhat.com>
1151 Implement explicit conversions ops as specified in N2437.
1152 * decl.c (grokdeclarator): Handle explicit conversion ops.
1153 (check_initializer): Pass flags to store_init_value.
1154 * decl2.c (maybe_emit_vtables): Likewise.
1155 * init.c (expand_aggr_init_1): Likewise.
1156 * call.c (convert_class_to_reference): Take flags parm,
1157 check DECL_NONCONVERTING_P.
1158 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1159 (add_builtin_candidates): Simplify getting type of conversion.
1160 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
1161 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1162 (reference_binding): Take flags parm. Direct-initialize copy parm.
1163 (add_function_candidate): Direct-initialize the copy parm.
1164 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1165 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1166 (conditional_conversion): Likewise.
1167 (convert_like_real): Only complain about DECL_NONCONVERTING_P
1169 (perform_implicit_conversion_flags): Add flags parm to
1170 perform_implicit_conversion. Improve diagnostics.
1171 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1172 (LOOKUP_COPY_PARM): New bit macro.
1173 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1174 * typeck.c (convert_for_assignment): Take flags parm, pass it to
1175 perform_implicit_conversion_flags.
1176 (cp_build_modify_expr): Pass flags to convert_for_assignment.
1177 (convert_for_initialization): Likewise.
1178 * typeck2.c (store_init_value): Take flags parm, pass to
1180 (digest_init_flags): Add flags parm to digest_init.
1181 (digest_init_r): Take flags parm, pass to convert_for_initialization.
1182 (process_init_constructor_array): Pass it.
1183 (process_init_constructor_record): Likewise.
1184 (process_init_constructor_union): Likewise.
1186 2009-05-16 Jason Merrill <jason@redhat.com>
1189 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1190 with a dependent type. Actually look up the destructor.
1191 * semantics.c (finish_id_expression): Fix logic.
1192 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1194 * typeck.c (build_x_unary_op): Diagnose taking the address of a
1195 constructor or destructor.
1196 * tree.c (get_first_fn): Handle OFFSET_REF.
1198 2009-05-17 Joseph Myers <joseph@codesourcery.com>
1200 * tree.c (cxx_printable_name_internal): Allow consecutive
1201 translated and untranslated cached copies of the name of the
1204 2009-05-15 Ian Lance Taylor <iant@google.com>
1206 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1207 cp_lvalue_kind. Change all uses.
1208 (enum base_access_flags): Rename from enum base_access. Change
1210 * parser.c (enum cp_parser_flags): Remove enum tag.
1212 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
1215 * call.c (build_new_op): Update calls to warn_logical_operator.
1217 2009-05-14 Ian Lance Taylor <iant@google.com>
1219 * class.c (layout_class_type): Change itk to unsigned int.
1220 * decl.c (finish_enum): Change itk to unsigned int.
1221 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
1224 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
1226 * decl.c (duplicate_decls): Preserve parameter attributes.
1228 2009-05-10 Jan Hubicka <jh@suse.cz>
1230 * decl2.c (cxx_callgraph_analyze_expr): Use
1231 cgraph_mark_address_taken.
1233 2009-05-10 Joseph Myers <joseph@codesourcery.com>
1235 * call.c (name_as_c_string): Call type_as_string_translate.
1236 Translate identifiers to locale character set.
1237 * cp-tree.h (lang_decl_name): Update prototype.
1238 (type_as_string_translate, decl_as_string_translate,
1239 cxx_printable_name_translate): Declare.
1240 * cxx-pretty-print.c (M_): Define.
1241 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1242 English fragments for conditional translation with M_.
1243 * decl.c (grokdeclarator): Translate identifiers to locale
1244 character set for diagnostics.
1245 * error.c (M_): Define.
1246 (dump_template_bindings, dump_type, dump_aggr_type,
1247 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1248 dump_function_decl, dump_template_parms, dump_expr,
1249 dump_binary_op, op_to_string, assop_to_string): Mark English
1250 fragments for conditional translation with M_.
1251 (type_as_string): Disable translation of identifiers.
1252 (type_as_string_translate): New.
1253 (expr_as_string): Disable translation of identifiers.
1254 (decl_as_string): Disable translation of identifiers.
1255 (decl_as_string_translate): New.
1256 (lang_decl_name): Add parameter translate.
1257 (args_to_string): Call type_as_string_translate.
1258 (cp_print_error_function): Call cxx_printable_name_translate.
1259 (print_instantiation_full_context,
1260 print_instantiation_partial_context): Call
1261 decl_as_string_translate.
1262 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1263 identifier in diagnostic.
1264 * tree.c (cxx_printable_name): Change to
1265 cxx_printable_name_internal. Add parameter translate.
1266 (cxx_printable_name, cxx_printable_name_translate): New wrappers
1267 round cxx_printable_name_internal.
1269 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
1272 * call.c (build_call_a): Updated warn_deprecated_use call.
1273 (build_over_call): Likewise.
1274 * decl.c (grokdeclarator): Likewise.
1275 (grokparms): Likewise.
1276 * semantics.c (finish_id_expression): Likewise.
1277 * typeck.c (build_class_member_access_expr): Likewise.
1278 (finish_class_member_access_expr): Likewise.
1280 2009-05-06 Dodji Seketeli <dodji@redhat.com>
1283 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1284 whole list of PARM_DECLs, just the current one.
1286 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
1289 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1290 mangle_compound_literal): Remove unused declarations.
1291 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1292 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1293 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1294 check_for_out_of_scope_variable, print_other_binding_stack,
1295 maybe_push_decl, cxx_mark_addressable, force_target_expr,
1296 build_target_expr_with_type, finish_case_label,
1297 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1298 check_template_keyword, cxx_omp_predetermined_sharing,
1299 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1300 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1301 cxx_omp_privatize_by_reference): Rearrange the declarations line to
1302 match the comment that indicates the .c file which the functions are
1304 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1305 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1307 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
1309 * typeck.c (cp_build_compound_expr): Require RHS to have a known
1311 * class.c (resolve_address_of_overloaded_function): Use
1312 OVL_CURRENT for error message.
1313 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1314 with them. Do not copy the node.
1316 2009-05-05 Jakub Jelinek <jakub@redhat.com>
1319 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1320 set it from its operand's type after tsubst_expr.
1322 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1325 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
1326 canonical spelling for keywords.
1327 (cp_parser_attribute_list): Use the canonical spelling for
1328 keywords in attributes.
1330 2009-05-01 Joseph Myers <joseph@codesourcery.com>
1332 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1333 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1334 pp_cxx_new_expression, pp_cxx_delete_expression,
1335 pp_cxx_unary_expression, pp_cxx_assignment_operator,
1336 pp_cxx_assignment_expression, pp_cxx_expression,
1337 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1338 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1339 pp_cxx_exception_specification, pp_cxx_direct_declarator,
1340 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1341 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1342 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1343 pp_cxx_declaration, pp_cxx_typeid_expression,
1344 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1345 pp_cxx_trait_expression): Mostly use pp_string and
1346 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1347 for non-identifiers. Mark English strings for translation.
1348 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1349 * error.c (dump_template_parameter, dump_template_bindings,
1350 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1351 dump_decl, dump_template_decl, dump_function_decl,
1352 dump_parameters, dump_exception_spec, dump_template_parms,
1353 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1354 assop_to_string, args_to_string, cp_print_error_function,
1355 print_instantiation_full_context,
1356 print_instantiation_partial_context): Mostly use pp_string and
1357 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1358 for non-identifiers. Mark English strings for translation.
1359 (dump_global_iord): Mark strings for translation; use longer
1360 strings instead of substituting single words.
1361 (function_category): Return a format string marked for
1362 translation, not a single word or phrase to substitute in a longer
1365 2009-04-28 Ben Elliston <bje@au.ibm.com>
1370 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1372 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1374 2009-04-27 Ian Lance Taylor <iant@google.com>
1376 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1379 2009-04-27 Jakub Jelinek <jakub@redhat.com>
1382 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1383 -Wunused-value if implicit.
1385 2009-04-24 Ian Lance Taylor <iant@google.com>
1387 * call.c (build_temp): Change 0 to enum constant.
1388 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1390 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1391 * decl2.c (constrain_visibility): Likewise.
1392 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1393 (cp_parser_flags): Typedef to int rather than enum type.
1394 (cp_parser_expression_stack_entry): Change prec field to enum
1397 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1400 2009-04-22 Dodji Seketeli <dodji@redhat.com>
1403 * parser.c (cp_parser_template_argument_list): Display an error
1404 when an ellipsis is not preceded by a parameter pack. Also, warn
1405 about variadic templates usage without -std=c++0x.
1407 2009-04-21 Taras Glek <tglek@mozilla.com>
1409 * cp-tree.h: Update GTY annotations to new syntax.
1411 * mangle.c: Likewise.
1412 * name-lookup.c: Likewise.
1413 * name-lookup.h: Likewise.
1414 * parser.c: Likewise.
1417 * semantics.c: Likewise.
1418 * typeck2.c: Likewise.
1420 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1423 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1425 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1428 * typeck.c (check_for_casting_away_constness): We diagnose casting
1429 away any qualifiers not just constness.
1430 (casts_away_constness): Mention that it handles more than just
1433 2009-04-21 Joseph Myers <joseph@codesourcery.com>
1435 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
1436 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
1437 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
1438 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1439 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
1440 cfns.gperf: Add copyright and license notices.
1441 * cfns.h: Regenerate.
1442 * ChangeLog, ChangeLog-2004: Correct dates.
1444 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1447 * tree.c (lvalue_p_1): Use const_tree.
1448 Use CONST_CAST_TREE to avoid warning.
1449 (lvalue_p): Returns bool, receives const_tree.
1451 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1454 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
1455 * error.c (pedwarn_cxx98): New.
1456 * cp-tree.h (pedwarn_cxx98): Declare.
1458 2009-04-20 Le-Chun Wu <lcwu@google.com>
1461 * init.c (build_vec_init): Set TREE_NO_WARNING on the
1462 compiler-generated INDIRECT_REF expression.
1464 2009-04-20 Ian Lance Taylor <iant@google.com>
1466 * typeck.c (build_function_call_vec): New function.
1467 (cp_build_function_call): Only pass first parameter to
1468 objc_rewrite_function_call.
1469 (build_modify_expr): Add rhs_origtype parameter. Change all
1471 * decl.c (finish_decl): Add origtype parameter. Change all
1473 * semantics.c (finish_call_expr): Pass VEC to
1474 resolve_overloaded_builtin.
1476 2009-04-20 Ian Lance Taylor <iant@google.com>
1478 * cp-tree.h (base_access): Change typedef to int.
1479 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
1480 (cp_parser_omp_threadprivate): Likewise.
1481 * pt.c (unify_pack_expansion): Add casts to enum type.
1483 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
1487 * call.c (build_new_op): Save the original codes of operands
1490 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
1492 * cp-tree.h: Remove the prototype for insert_block.
1493 * decl.c (insert_block): Remove.
1495 2009-04-16 Ian Lance Taylor <iant@google.com>
1497 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
1498 (tsubst_flags_t): Change typedef from enum type to int.
1500 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
1502 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
1503 instead of targetm.vector_opaque_p.
1505 2009-04-15 Le-Chun Wu <lcwu@google.com>
1508 * call.c (build_over_call): Set TREE_NO_WARNING on the
1509 compiler-generated INDIRECT_REF expression.
1510 * cvt.c (convert_to_void): Emit warning when stripping off
1513 2009-04-14 Diego Novillo <dnovillo@google.com>
1515 * parser.c (cp_parser_type_specifier_seq): Move call to
1516 invoke_plugin_callbacks ...
1517 (cp_parser_type_specifier_seq): ... here.
1519 2009-04-14 Le-Chun Wu <lcwu@google.com>
1521 * Make-lang.in: Modify dependencies of files including plugin.h.
1522 * decl.c (finish_function): Call invoke_plugin_callbacks.
1523 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
1525 2009-04-14 Jason Merrill <jason@redhat.com>
1528 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
1529 about shadowing by tentative parms.
1531 2009-04-13 Jason Merrill <jason@redhat.com>
1534 * call.c (build_over_call): Don't call memcpy if the target is
1535 the same as the source.
1537 2009-04-13 Jason Merrill <jason@redhat.com>
1540 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1542 2009-04-12 Jason Merrill <jason@redhat.com>
1545 * call.c (joust): Don't crash on variadic fn.
1547 2009-04-10 Jason Merrill <jason@redhat.com>
1550 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1551 if we see a close brace without an open brace.
1553 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
1555 * parser.c (cp_parser_class_specifier): Remove the unused
1556 has_trailing_semicolon.
1558 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
1561 * parser.c (cp_parser_check_template_parameters): Take a
1562 cp_declarator parameter.
1563 (cp_parser_elaborated_type_specifier): Update to
1564 cp_parser_check_template_parameters.
1565 (cp_parser_class_head): Likewise.
1566 (cp_parser_check_declarator_template_parameters): Likewise.
1567 (cp_parser_check_template_parameters): Handle first the non-error
1568 conditions. Give more accurate diagnostics if a declarator is
1571 2009-04-08 Jason Merrill <jason@redhat.com>
1574 * error.c (dump_aggr_type): Chase template typedefs if
1575 -fno-pretty-templates.
1577 2009-04-08 Dodji Seketeli <dodji@redhat.com>
1580 * parser.c (cp_parser_enumerator_definition): Make sure the
1581 initializer of the enumerator doesn't contain any bare parameter pack.
1583 2009-04-07 Jason Merrill <jason@redhat.com>
1586 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1587 * call.c (joust): Complain about mismatched default arguments
1588 in extern "C" functions.
1589 * class.c (resolve_address_of_overloaded_function): Handle multiple
1590 extern "C" functions.
1591 * pt.c (resolve_overloaded_unification): Likewise.
1593 2009-04-07 Jason Merrill <jason@redhat.com>
1596 * error.c (dump_function_decl): Don't pretty-print templates
1597 if -fno-pretty-templates.
1598 (count_non_default_template_args): Print all args if
1599 -fno-pretty-templates.
1601 2009-04-06 Jason Merrill <jason@redhat.com>
1604 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
1605 the deduced template arguments give us the parameter types
1608 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
1609 Jason Merrill <jason@redhat.com>
1612 * error.c (count_non_default_template_args): New fn.
1613 (dump_template_parms): Call it.
1614 (dump_template_argument_list): Call it. Add parms parm.
1615 (dump_template_argument): Adjust call to dump_template_argument_list.
1616 (dump_type, dump_decl): Likewise.
1617 (dump_template_bindings): Refactor logic.
1619 2009-04-03 Jason Merrill <jason@redhat.com>
1622 * error.c (dump_template_bindings): Look through typedefs in
1624 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
1625 (find_typenames_r): Also collect typedefs.
1626 * pt.c (unify): Strip typedefs.
1629 * semantics.c (finish_id_expression): Don't assume a dependent
1630 member of the current instantiation isn't a valid integral
1631 constant expression. Check dependent_scope_p.
1632 * pt.c (dependent_scope_p): Check TYPE_P.
1633 (tsubst_copy): If args is null, just return.
1635 2009-04-02 Jason Merrill <jason@redhat.com>
1638 * error.c (find_typenames, find_typenames_r): New fns.
1639 (dump_function_decl): Call find_typenames.
1640 (dump_template_bindings): Print typenames as well.
1641 * pt.c (tsubst): Non-static.
1642 * cp-tree.h: Declare it.
1644 2009-04-02 Dodji Seketeli <dodji@redhat.com>
1647 * decl2.c (grokfield): when a typedef appears in a
1648 class, create the typedef variant type node for it.
1649 (save_template_attributes): Creating typedef variant type node
1650 here is now useless.
1651 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1652 anonymous, set the proper type name to all its type variants.
1653 (xref_basetypes) : Fixup the variant types after setting
1655 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1656 set_underlying_type function to install typedef variant types.
1657 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1659 (append_type_to_template_for_access_check): New entry points.
1660 * semantics.c (check_accessibility_of_qualified_id):
1661 When a typedef that is a member of a class appears in a template,
1662 add it to the template. It will be ...
1663 * class.c (finish_struct_bits): Split type variant fixup into ...
1664 (fixup_type_variants): A new entry point.
1665 * pt.c (instantiate_class_template, instantiate_template ): ... access
1666 checked at template instantiation time.
1667 (resolve_type_name_type): The type name should be the name of the
1669 (retrieve_specialization): Specializations of template typedefs aren't
1670 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
1671 (append_type_to_template_for_access_check): New entry point.
1672 (tsubst_decl): For typedefs, build the variant type from the correct
1674 (get_class_bindings): Fix function comment.
1675 (perform_typedefs_access_check): New entry point.
1677 2009-03-31 Jason Merrill <jason@redhat.com>
1680 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
1681 extern "C" declarations.
1684 * semantics.c (finish_non_static_data_member): Allow such references
1685 without an associated object in sizeof/decltype/alignof.
1687 * ptree.c (cxx_print_decl): Pretty-print full name of
1689 (cxx_print_type): Pretty-print full name of class.
1691 * decl.c (grokdeclarator): Reject pointer to qualified function
1694 PR c++/37806, core issue 547
1695 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
1697 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
1699 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
1700 * decl.c (groktypename): Add is_template_arg parameter.
1701 (grokdeclarator): Allow function cv-quals on a template type arg.
1702 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
1703 is_template_arg argument in calls to groktypename.
1704 * cp-tree.h: Adjust prototype.
1705 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
1706 FUNCTION_TYPE printing.
1708 * mangle.c (write_expression): Mangle dependent name as
1711 PR c++/38030, 38850, 39070
1712 * pt.c (type_dependent_expression_p_push): New fn.
1713 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
1714 substitution makes the call non-dependent. Preserve koenig_p.
1715 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
1716 for non-dependent calls.
1717 * semantics.c (finish_call_expr): Revert earlier changes.
1718 * cp-tree.h: Revert change to finish_call_expr prototype.
1720 2009-03-29 Joseph Myers <joseph@codesourcery.com>
1722 PR preprocessor/34695
1723 * cp-tree.h (cp_cpp_error): Remove.
1724 * error.c (cp_cpp_error): Remove.
1725 * parser.c (cp_lexer_new_main): Set done_lexing instead of
1726 client_diagnostic and error callback.
1728 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
1730 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1731 * cp/cp-objcp-common.c (cxx_staticp): Remove.
1732 * cp/cp-tree.h (cxx_staticp): Remove.
1734 2009-03-28 Jakub Jelinek <jakub@redhat.com>
1737 * parser.c (cp_parser_postfix_expression): Don't call
1738 warning_if_disallowed_function_p.
1740 2009-03-27 Jan Hubicka <jh@suse.cz>
1742 * except.c (choose_personality_routine): Set terminate_node to abort
1743 for java exceptions.
1745 2009-03-27 Dodji Seketeli <dodji@redhat.com>
1746 Jakub Jelinek <jakub@redhat.com>
1749 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
1750 (cp_function_decl_explicit_p): New prototype.
1751 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
1753 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
1756 * parser.c (cp_parser_elaborated_type_specifier): If we have a
1757 typename tag and don't have either a TYPE_DECL or a
1758 TEMPLATE_ID_EXPR, set the type to NULL.
1760 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1763 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
1766 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1769 * decl.c (check_array_designated_initializer): Handle error_mark_node.
1771 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1774 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1776 2009-03-26 Andrew Haley <aph@redhat.com>
1779 * decl2.c (possibly_inlined_p): If java exceptions are in use
1780 don't inline a decl unless it is explicitly marked inline.
1781 * lex.c: (pragma_java_exceptions): New variable.
1782 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
1783 * cp-tree.h (pragma_java_exceptions): Declare new variable.
1785 2009-03-24 Jason Merrill <jason@redhat.com>
1788 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
1790 2009-03-23 Jakub Jelinek <jakub@redhat.com>
1793 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
1794 code if iter is the second operand.
1795 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
1796 argument. If it is set, don't build the toplevel expression with
1797 build_x_binary_op, but build2.
1798 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
1800 (cp_parser_omp_for_cond): Don't assume the first operand of the
1801 comparison must be decl.
1803 2009-03-23 Jason Merrill <jason@redhat.com>
1806 * pt.c (make_fnparm_pack): Split out from...
1807 (instantiate_decl): ...here.
1808 (tsubst_pack_expansion): Handle being called in a late-specified
1812 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
1815 2009-03-20 Jason Merrill <jason@redhat.com>
1818 * parser.c (cp_parser_direct_declarator): In a template, wrap
1819 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
1820 * pt.c (tsubst): Preserve it in a partial instantiation.
1821 (dependent_type_p_r): Don't check value_dependent_expression_p.
1822 * decl.c (compute_array_index_type): Don't check
1823 value_dependent_expression_p if TREE_SIDE_EFFECTS.
1826 * typeck2.c (check_narrowing): Don't complain about loss of
1827 precision when converting a floating-point constant.
1829 2009-03-19 Jakub Jelinek <jakub@redhat.com>
1832 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
1833 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
1835 2009-03-18 Jakub Jelinek <jakub@redhat.com>
1837 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
1838 (eof_token): Adjust.
1840 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
1843 * parser.c (cp_parser_explicit_specialization): Don't skip the
1844 rest of the specialization when begin_specialization returns
1847 2009-03-17 Jason Merrill <jason@redhat.com>
1849 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
1850 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
1851 * pt.c (check_explicit_specialization): Likewise.
1852 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
1853 local specialization.
1854 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
1855 * decl2.c (parm_index): New fn.
1856 * semantics.c (finish_decltype_type): Don't use describable_type.
1857 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
1858 Give a sorry for unsupported codes rather than crash. Mangle
1859 conversions with other than 1 operand. New mangling for PARM_DECL.
1860 * operators.def (ALIGNOF_EXPR): Mangle as "az".
1862 2009-03-17 Jing Yu <jingyu@google.com>
1865 * method.c (use_thunk): Change is_thunk from crtl to cfun.
1867 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
1870 * semantics.c (check_trait_type): New.
1871 (finish_trait_expr): Use it.
1873 2009-03-17 Jakub Jelinek <jakub@redhat.com>
1875 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
1876 instead of calling imported_module_or_decl debug hook if
1877 building_stmt_tree ().
1878 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
1879 is a NAMESPACE_DECL.
1882 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
1883 hook at function scope.
1886 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
1889 2009-03-09 Jakub Jelinek <jakub@redhat.com>
1892 * semantics.c (finish_switch_cond): Don't call get_unwidened.
1893 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
1894 instead of TREE_TYPE (cond).
1896 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
1899 * parser.c (cp_parser_late_parsing_default_args): Continue
1900 the loop when cp_parser_assignment_expression returns
1903 2009-03-07 Jason Merrill <jason@redhat.com>
1906 * init.c (build_new_1): Don't use a VLA type.
1907 (build_vec_init): Handle getting a pointer for BASE.
1909 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
1912 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1913 when mangling symbols.
1915 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1918 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1920 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
1922 * decl.c (record_builtin_java_type): Use canonicalized integer
1925 2009-03-04 Jason Merrill <jason@redhat.com>
1928 * class.c (is_really_empty_class): New fn.
1929 * cp-tree.h: Declare it.
1930 * cp-objcp-common.c (cp_expr_size): Use it.
1933 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
1934 * parser.c (cp_parser_postfix_expression): Call it for
1936 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
1937 (get_first_fn): Likewise.
1943 * decl.c (make_typename_type): Do look inside currently open classes.
1944 * parser.c (cp_parser_lookup_name): Likewise.
1945 (cp_parser_template_name): Likewise.
1946 * pt.c (dependent_scope_p): New function.
1947 * cp-tree.h: Declare it.
1948 * class.c (currently_open_class): Return fast if T isn't a class.
1950 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
1953 * parser.c (cp_parser_mem_initializer): Return error_mark_node
1954 if cp_parser_mem_initializer_id returns error_mark_node.
1956 2009-02-24 Richard Guenther <rguenther@suse.de>
1959 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
1962 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
1965 * pt.c (coerce_template_template_parms): Return 0 if parameter
1968 2009-02-23 Jason Merrill <jason@redhat.com>
1970 * pt.c (unify): Call maybe_adjust_types_for_deduction when
1971 deducing from an initializer list.
1973 2009-02-20 Jason Merrill <jason@redhat.com>
1976 * decl.c (grokdeclarator): Handle ~identifier.
1978 2009-02-19 Jakub Jelinek <jakub@redhat.com>
1981 * decl2.c (determine_visibility): If visibility changed and
1982 DECL_RTL has been already set, call make_decl_rtl to update symbol
1985 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
1988 * cp-tree.h (maybe_commonize_var): New.
1990 * decl.c (maybe_commonize_var): Make it extern.
1992 * decl2.c (finish_anon_union): Call maybe_commonize_var.
1994 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
1997 * parser.c (cp_parser_enum_specifier): Apply all attributes.
1999 2009-02-18 Jason Merrill <jason@redhat.com>
2001 * cfns.h: Tweak pathname for cfns.gperf.
2003 2009-02-13 Jason Merrill <jason@redhat.com>
2006 * semantics.c (finish_call_expr): Change koenig_p parm to int.
2007 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2008 * cp-tree.h: Adjust prototype.
2009 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2011 2009-02-12 Jason Merrill <jason@redhat.com>
2014 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2016 2009-02-11 Jason Merrill <jason@redhat.com>
2019 * decl2.c (cp_write_global_declarations):
2020 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2023 * init.c (build_value_init_noctor): Split out from...
2024 (build_value_init): ...here.
2025 (expand_aggr_init_1): Handle value-initialization.
2026 * cp-tree.h: Add declaration.
2027 * class.c (type_has_user_provided_constructor):
2028 Handle non-class arguments.
2030 2009-02-10 Jason Merrill <jason@redhat.com>
2033 * class.c (defaultable_fn_p): Handle ... properly.
2036 * tree.c (lvalue_p_1): Condition rvalue ref handling on
2037 treat_class_rvalues_as_lvalues, too.
2039 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2042 * typeck.c (build_x_array_ref): New.
2043 * cp-tree.h: Declare it.
2044 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2046 2009-02-09 Jason Merrill <jason@redhat.com>
2049 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2050 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2051 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2052 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2053 for build_value_init TARGET_EXPR.
2054 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2056 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
2060 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2062 2009-02-04 Jakub Jelinek <jakub@redhat.com>
2065 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2066 remove ./dt operator.
2067 * mangle.c (write_expression): Handle COMPONENT_REF after handling
2068 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2069 write_string ("dt") instead of using operators.def.
2071 2009-02-03 Jason Merrill <jason@redhat.com>
2073 * typeck.c (cp_build_unary_op): Only complain about taking address
2074 of main if pedantic.
2076 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2079 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2082 * typeck2.c (digest_init_r): Don't call process_init_constructor
2085 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
2088 * pt.c (convert_nontype_argument_function): Expect expr to be an
2092 * typeck.c (merge_types): Call resolve_typename_type if only
2093 one type is a typename.
2095 2009-02-02 Jason Merrill <jason@redhat.com>
2098 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
2101 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2104 * parser.c (cp_parser_pure_specifier): If there are no tokens left
2105 do not call cp_lexer_consume_token.
2107 2009-01-30 Jakub Jelinek <jakub@redhat.com>
2110 * parser.c (cp_parser_already_scoped_statement): Handle __label__
2113 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2116 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2118 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2121 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2123 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2125 * typeck.c (invalid_nonstatic_memfn_p): Use
2126 DECL_NONSTATIC_MEMBER_FUNCTION_P.
2128 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
2131 * call.c (build_over_call): If convert_for_arg_passing returns
2132 error_mark_node unconditionally return it.
2134 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
2136 * class.c (check_field_decls): Also inherit packed for bitfields
2137 regardless of their type.
2139 2009-01-22 Dodji Seketeli <dodji@redhat.com>
2142 * decl2.c (grokfield): Reverting changes of PR c++/26693
2143 (save_template_attributes): Likewise.
2144 * decl.c (grokdeclarator): Likewise.
2145 * name-lookup.c (pushdecl_maybe_friend): Likewise.
2146 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2147 (append_type_to_template_for_access_check): Likewise.
2148 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2149 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2151 (resolve_type_name_type): Likewise.
2152 (append_type_to_template_for_access_check): Likewise.
2154 2009-01-21 Dodji Seketeli <dodji@redhat.com>
2157 * decl2.c (grokfield): when a typedef appears in a
2158 class, create the typedef variant type node for it.
2159 (save_template_attributes): Creating typedef variant type node
2160 here is now useless.
2161 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2162 anonymous, set the proper type name to all its type variants.
2163 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2164 set_underlying_type function to install typedef variant types.
2165 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2167 (append_type_to_template_for_access_check): New entry points.
2168 * semantics.c (check_accessibility_of_qualified_id):
2169 When a typedef that is a member of a class appears in a template,
2170 add it to the template. It will be ...
2171 * pt.c (instantiate_class_template, instantiate_template ): ... access
2172 checked at template instantiation time.
2173 (tsubst): Handle the case of being called with NULL args.
2174 (resolve_type_name_type): The type name should be the name of the
2176 (append_type_to_template_for_access_check): New entry point.
2178 2009-01-19 Jason Merrill <jason@redhat.com>
2181 * parser.c (cp_parser_unqualified_id): In a template,
2183 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2185 2009-01-16 Jason Merrill <jason@redhat.com>
2188 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2189 * init.c (build_new): Don't call describable_type unless we
2193 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2196 * search.c (protected_accessible_p): N doesn't vary.
2198 2009-01-15 Jason Merrill <jason@redhat.com>
2201 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2202 accept hidden friends.
2204 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2207 * decl.c (grokdeclarator): Check for a non namespace/class context.
2209 2009-01-15 Jason Merrill <jason@redhat.com>
2213 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
2214 a function isn't necessarily an lvalue. Take tree, not const_tree.
2215 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2216 * typeck.c (lvalue_or_else): Likewise.
2217 * cp-tree.h: Adjust prototypes.
2219 2009-01-15 Steve Ellcey <sje@cup.hp.com>
2222 * pt.c (tsubst): Check for NULL args.
2224 2009-01-15 Dodji Seketeli <dodji@redhat.com>
2227 * name-lookup.c (pushtag): Don't create members to types that are not
2230 2009-01-14 Nick Clifton <nickc@redhat.com>
2233 * parser.c: Pass cp_id_kind computed in
2234 cp_parser_postfix_dot_deref_expression to
2235 cp_parser_primary_expression.
2237 2009-01-13 Jakub Jelinek <jakub@redhat.com>
2240 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2241 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2244 2009-01-12 Jason Merrill <jason@redhat.com>
2245 Steve Ellcey <sje@cup.hp.com>
2248 * name-lookup.c (lookup_name_real): Keep looking past a hidden
2251 2009-01-12 Dodji Seketeli <dodji@redhat.com>
2254 * pt.c (parameter_of_template_p): New function.
2255 * cp-tree.h: Declare it.
2256 * name-lookup.c (binding_to_template_parms_of_scope_p): New
2258 (outer_binding): Take template parameters in account when looking for
2261 2009-01-12 Jason Merrill <jason@redhat.com>
2264 * tree.c (pod_type_p): Return 1 for structs created by the back end.
2266 2009-01-12 Jakub Jelinek <jakub@redhat.com>
2269 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2270 offsetof member-designator, handle it as `[0].'.
2273 * decl.c (start_function): If grokdeclarator hasn't returned
2274 FUNCTION_DECL nor error_mark_node, issue diagnostics.
2276 2009-01-11 Jakub Jelinek <jakub@redhat.com>
2279 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2280 (gimplify_if_stmt): ... this.
2281 (cp_gimplify_expr): Don't handle IF_STMT here.
2282 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2284 2009-01-10 Andrew Pinski <pinskia@gmail.com>
2287 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2290 * typeck2.c (build_functional_cast): Check for reference type and NULL
2293 2009-01-09 Steve Ellcey <sje@cup.hp.com>
2295 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2297 2009-01-09 Jakub Jelinek <jakub@redhat.com>
2300 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2302 2009-01-09 John F. Carr <jfc@mit.edu>
2305 * parser.c (cp_parser_class_specifier): Clear
2306 parser->in_unbraced_linkage_specification_p while parsing class
2309 2009-01-07 Jakub Jelinek <jakub@redhat.com>
2312 * semantics.c (finish_goto_stmt): Convert destination to
2315 2009-01-06 Jason Merrill <jason@redhat.com>
2322 * pt.c (check_default_tmpl_args): Don't complain about
2323 out-of-order parameter packs in the enclosing class
2324 or parameter packs after default args.
2325 (coerce_template_parms): If we have more than one
2326 parameter pack, don't flatten argument packs.
2327 (template_args_equal): Handle argument packs.
2328 (comp_template_args): Don't flatten argument packs.
2329 (check_instantiated_arg): Split out from...
2330 (check_instantiated_args): Here. Handle arg packs.
2331 (convert_template_argument): Just check that nontype argument
2332 packs have the right type.
2334 2009-01-05 Dodji Seketeli <dodji@redhat.com>
2337 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2339 2009-01-05 Jason Merrill <jason@redhat.com>
2342 * typeck2.c (process_init_constructor_union): Handle union with
2345 * mangle.c (write_expression): Remove mangling for zero-operand
2349 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2353 * class.c (defaultable_fn_p): Only operator== can be a copy
2354 assignment operator.
2356 2009-01-02 Jason Merrill <jason@redhat.com>
2359 * typeck2.c (process_init_constructor_union): Handle excess
2361 (process_init_constructor_record): Likewise.
2364 * typeck2.c (digest_init_r): Don't use process_init_constructor
2365 for non-aggregate classes.
2368 Copyright (C) 2009 Free Software Foundation, Inc.
2370 Copying and distribution of this file, with or without modification,
2371 are permitted in any medium without royalty provided the copyright
2372 notice and this notice are preserved.