PR c++/53551 - -Wunused-local-typedefs misses uses
[official-gcc.git] / gcc / cp / ChangeLog
blob78325900c8943c1557c2fbd081d277e5dc2e98da
1 2012-09-25  Dodji Seketeli  <dodji@redhat.com>
3         PR c++/53551 - -Wunused-local-typedefs misses uses
4         * decl.c (make_typename_type): Record the use of typedefs.
6 2012-09-27  Jakub Jelinek  <jakub@redhat.com>
8         * init.c (build_new_1): Don't test TREE_CONSTANT
9         of INTEGER_CST.
11 2012-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
13         PR c++/54526
14         * parser.c (cp_parser_template_id): In C++11 mode simply accept
15         X<::A>.
17 2012-09-25  Zhenqiang Chen <zhenqiang.chen@linaro.org>
19         PR c++/50970
20         * typeck.c (cp_build_binary_op): Check side effects before generating
21         pfn and delta related expressions.
23 2012-09-24  Lawrence Crowl  <crowl@google.com>
25         * init.c (build_new_1): Change to new double_int API.
26         * decl.c (build_enumerator): Likewise.
27         * typeck2.c (process_init_constructor_array): Likewise.
28         * mangle.c (write_array_type): Likewise.
30 2012-09-24  Paolo Carlini  <paolo.carlini@oracle.com>
32         PR c++/50828
33         * error.c (dump_function_decl): Strip TFF_TEMPLATE_NAME from flags
34         at the outset.
36 2012-09-24  Jason Merrill  <jason@redhat.com>
38         * decl.c (get_atexit_node): Remove dead code.
40         * Make-lang.in (cp/parser.o): Depend on decl.h.
42 2012-09-20  Paolo Carlini  <paolo.carlini@oracle.com>
44         PR c++/52432
45         * pt.c (tsubst_copy_and_build): If tf_error is not set in the complain
46         argument don't call unqualified_name_lookup_error.
48 2012-09-19  Marc Glisse  <marc.glisse@inria.fr>
50         PR c++/54581
51         * semantics.c (finish_decltype_type): Make vectors not opaque.
53 2012-09-17  Jason Merrill  <jason@redhat.com>
55         PR c++/54575
56         * pt.c (instantiate_alias_template): New.
57         (tsubst): Use it.
58         (push_access_scope): Allow TYPE_DECL.
60 2012-09-14  Jason Merrill  <jason@redhat.com>
62         PR c++/53661
63         * typeck2.c (check_narrowing): Avoid false positives on conversion
64         from enumeral type.
66 2012-09-14  Marc Glisse  <marc.glisse@inria.fr>
68         PR c++/54427
69         * typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
70         NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.
72 2012-09-14  Paolo Carlini  <paolo.carlini@oracle.com>
74         * decl.c (make_typename_type): Only error out if tf_error is set
75         in complain.
77 2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
78             Manuel López-Ibáñez  <manu@gcc.gnu.org>
80         PR c++/53210
81         * init.c (perform_member_init): Use OPT_Winit_self instead of
82         OPT_Wuninitialized.
84 2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
86         * typeck.c (build_indirect_ref, build_function_call,
87         build_function_call_vec, build_binary_op, build_unary_op,
88         build_compound_expr, build_c_cast, build_modify_expr): Remove
89         uses of ATTRIBUTE_UNUSED on the parameters.
90         * class.c (set_linkage_according_to_type, resort_type_method_vec,
91         dfs_find_final_overrider_post, empty_base_at_nonzero_offset_p):
92         Likewise.
93         * decl.c (local_variable_p_walkfn): Likewise.
94         * except.c (wrap_cleanups_r, check_noexcept_r): Likewise.
95         * error.c (find_typenames_r): Likewise.
96         * tree.c (verify_stmt_tree_r, bot_replace,
97         handle_java_interface_attribute, handle_com_interface_attribute,
98         handle_init_priority_attribute, c_register_addr_space): Likewise.
99         * cp-gimplify.c (cxx_omp_clause_default_ctor): Likewise.
100         * cp-lang.c (objcp_tsubst_copy_and_build): Likewise.
101         * pt.c (unify_success, unify_invalid, instantiation_dependent_r):
102         Likewise.
103         * semantics.c (dfs_calculate_bases_pre): Likewise.
104         * decl2.c (fix_temporary_vars_context_r, clear_decl_external):
105         Likewise.
106         * parser.c (cp_lexer_token_at, cp_parser_omp_clause_mergeable,
107         cp_parser_omp_clause_nowait, cp_parser_omp_clause_ordered,
108         cp_parser_omp_clause_untied): Likewise.
109         * mangle.c (write_unnamed_type_name,
110         discriminator_for_string_literal): Likewise.
111         * search.c (dfs_accessible_post, dfs_debug_mark): Likewise.
112         * lex.c (handle_pragma_vtable, handle_pragma_unit,
113         handle_pragma_interface, handle_pragma_implementation,
114         handle_pragma_java_exceptions): Likewise.
116 2012-09-13  Jason Merrill  <jason@redhat.com>
118         PR c++/53839
119         * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
120         address, make sure the value is constant.
122         PR c++/54511
123         * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
125         PR c++/53836
126         * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
127         be dependent.
129 2012-09-10  Paolo Carlini  <paolo.carlini@oracle.com>
131         PR c++/54541
132         PR c++/54542
133         * call.c (build_cxx_call): Add tsubst_flags_t parameter, use
134         require_complete_type_sfinae.
135         (build_op_delete_call, build_over_call): Adjust.
136         * typeck.c (build_x_compound_expr_from_vec): Add tsubst_flags_t
137         parameter.
138         (cp_build_function_call_vec): Adjust.
139         * init.c (build_new_1): Likewise.
140         * rtti.c (throw_bad_cast, throw_bad_typeid, build_dynamic_cast_1):
141         Likewise.
142         * optimize.c (build_delete_destructor_body): Likewise.
143         * cp-tree.h: Adjust declarations.
145         * call.c (convert_arg_to_ellipsis): Use require_complete_type_sfinae.
147 2012-09-10  Jason Merrill  <jason@redhat.com>
149         PR c++/54538
150         PR c++/53783
151         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Go back to using RECUR
152         for LAMBDA_EXPR_EXTRA_SCOPE except for function scope.
154         PR c++/54506
155         * decl.c (move_signature_fn_p): Split out from move_fn_p.
156         * method.c (process_subob_fn): Use it.
157         * cp-tree.h: Declare it.
159 2012-09-07  Jason Merrill  <jason@redhat.com>
161         * semantics.c (sort_constexpr_mem_initializers): Tweak.
163 2012-09-09  Mark Kettenis  <kettenis@openbsd.org>
165         * decl.c (reshape_init_class): Avoid dereferencing a
166         past-the-end pointer.
168 2012-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
170         * pt.c (num_template_headers_for_class): Rework per the code
171         inline in cp_parser_check_declarator_template_parameters.
172         * parser.c (cp_parser_check_declarator_template_parameters):
173         Use num_template_headers_for_class.
175 2012-09-06  Jason Merrill  <jason@redhat.com>
177         PR c++/54341
178         PR c++/54253
179         * semantics.c (sort_constexpr_mem_initializers): New.
180         (build_constexpr_constructor_member_initializers): Use it.
181         (cx_check_missing_mem_inits): Skip artificial fields.
182         * init.c (expand_aggr_init_1): Don't zero out a class
183         with no data.
185 2012-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
187         PR c++/54191
188         * search.c (lookup_base): Add tsubst_flags_t parameter.
189         (adjust_result_of_qualified_name_lookup, check_final_overrider):
190         Adjust.
191         * name-lookup.c (do_class_using_decl): Adjust.
192         * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
193         Likewise.
194         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
195         build_up_reference): Likewise.
196         * rtti.c (build_dynamic_cast_1): Likewise.
197         * tree.c (maybe_dummy_object): Likewise.
198         * call.c (build_conditional_expr_1, build_over_call): Likewise.
199         * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
200         Remove.
201         (enum base_access_flags, ba_quiet): Remove.
202         (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
203         * except.c (can_convert_eh): Adjust.
204         * decl.c (grokdeclarator): Likewise.
205         * typeck.c (comp_except_types, build_class_member_access_expr,
206         finish_class_member_access_expr, get_member_function_from_ptrfunc,
207         build_static_cast_1, get_delta_difference_1): Likewise.
208         * class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
209         warn_about_ambiguous_bases): Likewise.
210         (uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
212 2012-09-04  Jason Merrill  <jason@redhat.com>
214         PR c++/54441
215         * decl.c (reshape_init_class): Handle invalid initializer for
216         0-length array member.
218         * error.c (dump_type_suffix): Correct handling of 0-length arrays.
220         PR c++/54420
221         * cp-tree.h (LAMBDANAME_P): Remove.
222         (LAMBDA_TYPE_P): Check CLASSTYPE_LAMBDA_EXPR instead.
223         * cp-lang.c (cxx_dwarf_name): Likewise.
224         * error.c (dump_aggr_type): Likewise.
225         * semantics.c (begin_lambda_type): Set CLASSTYPE_LAMBDA_EXPR sooner.
227         PR c++/54198
228         * decl.c (check_default_argument): Set cp_unevaluated_operand
229         around call to perform_implicit_conversion_flags.
231         PR c++/54437
232         PR c++/51213
233         * pt.c (fn_type_unification): Call coerce_template_parms before
234         entering substitution context.
236 2012-08-31  Paolo Carlini  <paolo.carlini@oracle.com>
237             Jason Merrill  <jason@redhat.com>
239         PR c++/18747
240         * pt.c (check_template_variable): New.
241         (num_template_headers_for_class): Split out...
242         * decl.c (grokdeclarator): ...from here.
243         (start_decl): Remove redundant diagnostic.
244         * cp-tree.h: Declare them
245         * parser.c (cp_parser_single_declaration): Call check_template_variable.
247 2012-08-31  Ollie Wild  <aaw@google.com>
249         PR c++/54197
250         * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
252 2012-08-30  Jason Merrill  <jason@redhat.com>
254         PR c++/50545
255         PR c++/51222
256         * pt.c (instantiation_dependent_r): New.
257         (instantiation_dependent_expression_p): New.
258         (value_dependent_expression_p): Use it.  SCOPE_REF is always dependent.
259         * semantics.c (finish_decltype_type): Use it.
260         * cp-tree.h: Declare it.
262         * semantics.c (finish_qualified_id_expr): Handle building up a
263         non-dependent SCOPE_REF here.
264         (finish_id_expression): Not here.
265         * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME.
267         * friend.c (make_friend_class): Handle template template parameters.
268         * parser.c (cp_parser_template_declaration_after_export): Likewise.
269         * pt.c (tsubst_friend_class): Likewise.
270         (instantiate_class_template_1): Likewise
271         * decl.c (check_elaborated_type_specifier): Likewise.
272         (lookup_and_check_tag): Likewise.
274         * pt.c (get_class_bindings): Call coerce_template_parms.  Add
275         main_tmpl parameter.
276         (more_specialized_class): Add main_tmpl parameter.
277         (most_specialized_class): Adjust calls.
279         * decl.c (cp_finish_decl): Check for invalid multiple initializers
280         even if the initializer is dependent.
282         * pt.c (instantiate_template_1): Keep processing_template_decl set
283         if there are dependent args.
285 2012-08-25  Paolo Carlini  <paolo.carlini@oracle.com>
287         PR c++/51421
288         * decl2.c (mark_used): Consistently return false after errors
289         about uses before deduction of auto.
290         * semantics.c (finish_id_expression): Check mark_used return
291         value and return error_mark_node in case of failure.
293 2012-08-24  Jason Merrill  <jason@redhat.com>
295         PR c++/51213 (again)
296         * pt.c (deduction_tsubst_fntype): Remove.
297         (fn_type_unification): Check deduction depth and call
298         instantiate_template here.  Handle default argument access checks.
299         (determine_specialization): Suppress access control.
300         (tsubst_decl): Check for excessive deduction depth.
301         (recheck_decl_substitution): Make sure access control is on.
302         (type_unification_real): Don't mess with access deferring here.
303         (get_bindings): Adjust for fn_type_unification return type.
304         * call.c (enum rejection_reason_code): Drop rr_template_instantiation.
305         (template_instantiation_rejection): Remove.
306         (struct rejection_reason): Change targs to num_targs.
307         (template_unification_rejection, print_z_candidate): Adjust.
308         (add_template_candidate_real): Adjust for fn_type_unification change.
309         * class.c (resolve_address_of_overloaded_function): Likewise.
310         * cp-tree.h: Adjust declaration.
312         * pt.c (tsubst_default_argument): Indicate where the default
313         argument is being instantiated for.
314         (tsubst_expr): Restore previous location.
315         (tsubst_copy_and_build): Set and restore location.
316         * call.c (build_new_method_call_1): Remember location of call.
317         * semantics.c (finish_call_expr): Here too.
318         * parser.c (cp_parser_omp_for_loop): Remember the location of the
319         increment expression.
321         * pt.c (resolve_overloaded_unification): Use coerce_template_parms
322         instead of get_bindings.
323         (resolve_nondeduced_context): Likewise.
325         * pt.c (register_specialization): Correct argument to
326         check_specialization_namespace.
327         (determine_specialization): Don't consider members of
328         unspecialized types.
330 2012-08-23  Jason Merrill  <jason@redhat.com>
332         * decl.c (compute_array_index_type): Use type_dependent_expression_p.
334 2012-08-23  Paolo Carlini  <paolo.carlini@oracle.com>
336         PR c++/20420
337         * name-lookup.c (supplement_binding_1): Handle specially enums
338         only in class templates.
339         (validate_nonmember_using_decl): Enforce 7.3.3/10 about duplicate
340         using declarations at function scope.
342 2012-08-21  Richard Guenther  <rguenther@suse.de>
344         * cp-tree.h (TREE_INDIRECT_USING): Use TREE_LANG_FLAG_0 accessor.
345         (ATTR_IS_DEPENDENT): Likewise.
346         (ARGUMENT_PACK_INCOMPLETE_P): Use TREE_ADDRESSABLE instead of
347         TREE_LANG_FLAG_0 on TREE_VECs.
349 2012-08-20  Paolo Carlini  <paolo.carlini@oracle.com>
351         PR c++/10416
352         * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for
353         Wunused_variable too.
355 2012-08-20  Diego Novillo  <dnovillo@google.com>
357         * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
359 2012-08-20  Richard Guenther  <rguenther@suse.de>
361         * name-lookup.c (store_binding_p): New predicate, split out from ...
362         (store_binding): ... here.  Always store binding and require
363         target vector with enough space.
364         (store_bindings): Collect to store bindings and reserve space
365         for them, then store them.
366         (store_class_bindings): Likewise.
368 2012-08-19  Mikael Morin  <mikael@gcc.gnu.org>
370         * Make-lang.in: Fix typo.
372 2012-08-17  Jakub Jelinek  <jakub@redhat.com>
374         * cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
376 2012-08-14   Diego Novillo  <dnovillo@google.com>
378         Merge from cxx-conversion branch.  Re-write VEC in C++.
380         * call.c (add_function_candidate): Remove const qualifier
381         from call to VEC_index.
383 2012-08-10  Richard Guenther  <rguenther@suse.de>
385         * error.c (dump_expr): Handle anonymous SSA names.
387 2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
389         * error.c (print_instantiation_context): Pretty-print a newline before
390         diagnostic_flush_buffer.
391         * cxx-pretty-print.c (pp_cxx_function_definition): Use
392         pp_newline_and_flush instead of separate pp_newline and pp_flush.
394 2012-08-06  Dodji Seketeli  <dodji@redhat.com>
396         Avoid crashing on erroneous static_assert usage
397         * semantics.c (finish_static_assert): Don't crash on erroneous
398         message or condition.
400 2012-08-06  Marc Glisse  <marc.glisse@inria.fr>
401             Paolo Carlini  <paolo.carlini@oracle.com>
403         PR c++/54165
404         * typeck.c (build_static_cast_1): Move the conversion to void case
405         before the perform_direct_initialization_if_possible call.
407 2012-08-03  Marc Glisse  <marc.glisse@inria.fr>
409         * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
410         * cp-tree.h (scalarish_type_p): Declare.
411         * tree.c (scalarish_type_p): Make non-static.
413 2012-08-02  Jason Merrill  <jason@redhat.com>
414             Paolo Carlini  <paolo.carlini@oracle.com>
416         PR c++/51213 (again)
417         * pt.c (type_unification_real): Call push_deferring_access_checks /
418         pop_deferring_access_checks around the substitution of default
419         template args.
420         (instantiate_template_1): When the specialization returned by
421         retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
422         are in a SFINAE context, simply return error_mark_node.
423         * cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
425 2012-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
427         * pt.c (check_default_tmpl_args): Change is_primary and is_partial
428         parameters to bool type, adjust.
429         (push_template_decl_real): Tidy.
430         * parser.c (cp_parser_init_declarator): Adjust.
431         * decl.c (redeclaration_error_message): Likewise.
432         * cp-tree.h (check_default_tmpl_args): Update prototype.
434 2012-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
436         PR c++/53624
437         * pt.c (check_default_tmpl_args): Don't check local types.
439 2012-07-25  Sandra Loosemore  <sandra@codesourcery.com>
440             Paul Brook  <paul@codesourcery.com>
442         PR target/53633
443         * decl.c (finish_function): Check targetm.warn_func_return.
445 2012-07-25  Jason Merrill  <jason@redhat.com>
447         PR c++/54086
448         * decl.c (grokdeclarator): Allow const and constexpr together.
450         PR c++/54020
451         * semantics.c (potential_constant_expression_1) [COND_EXPR]: Call
452         maybe_constant_value.
454         * cp-tree.h (tsubst_flags): Remove tf_no_access_control.
455         * call.c (standard_conversion): Don't set it.
456         * class.c (resolve_address_of_overloaded_function): Don't check it.
457         * decl.c (check_default_argument): Call
458         perform_implicit_conversion_flags.
460         * pt.c (print_candidates_1): Use inform instead of error.
462 2012-07-24  Paolo Carlini  <paolo.carlini@oracle.com>
464         * pt.c (convert_template_argument, tsubst): Simplify fourth argument
465         to make_typename_type (complain & tf_error -> complain).
467 2012-07-24  Steven Bosscher  <steven@gcc.gnu.org>
469         * class.c (n_vtables, n_vtable_entries, n_vtable_searches,
470         n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
471         n_inner_fields_searched): Always define.
472         (build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
473         (print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
474         * tree.c (depth_reached): Always define global.
475         (cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
476         * pt.c (depth_reached): Always define.
477         (push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
478         * search.c (n_fields_searched, n_calls_lookup_field,
479         n_calls_lookup_field_1, n_calls_lookup_fnfields,
480         n_calls_lookup_fnfields_1, n_calls_get_base_type,
481         n_outer_fields_searched, n_contexts_saved): Always define.
482         (lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
483         (lookup_member): Likewise.
484         (lookup_fnfields_idx_nolazy): Likewise.
485         (print_search_statistics): Likewise.
486         (reinit_search_statistics): Unconditionally re-set counters.
487         * lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
488         to if-code.
489         (cxx_dup_lang_specific_decl): Likewise.
490         (copy_lang_type): Likewise.
491         (cxx_make_type): Likewise.
493 2012-07-20  Jason Merrill  <jason@redhat.com>
495         PR c++/54038
496         * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
497         canonical array type rather than mess with its TYPE_*_VARIANT.
499 2012-07-19  Jason Merrill  <jason@redhat.com>
501         PR c++/54026
502         * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
504         PR c++/54021
505         * call.c (build_cxx_call): Set optimize when folding
506         __builtin_constant_p in a constexpr function.
508 2012-07-18  Jason Merrill  <jason@redhat.com>
510         * pt.c (instantiate_decl): Don't recheck substitutions.
512 2012-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
513             Jason Merrill  <jason@redhat.com>
515         DR 1170
516         PR c++/51213
517         * semantics.c (perform_access_checks): Add complain parm, return bool.
518         (perform_deferred_access_checks): Likewise.
519         (perform_or_defer_access_check): Likewise.
520         (speculative_access_check): Remove.
521         * call.c (enforce_access): Add complain parm, return bool.
522         * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
523         * search.c: Adjust callers.
524         * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
525         (FNDECL_RECHECK_ACCESS_P): New macro.
526         * method.c (synthesized_method_walk): Stop deferring access checks.
527         * pt.c (recheck_decl_substitution): New.
528         (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
530 2012-07-18  Jason Merrill  <jason@redhat.com>
532         * method.c (process_subob_fn): Make sure no_implicit_p is non-null
533         before trying to store through it.
535 2012-07-17  Jason Merrill  <jason@redhat.com>
537         PR c++/53995
538         * decl.c (finish_enum_value_list): Only call
539         insert_late_enum_def_into_classtype_sorted_fields in class scope.
541         PR c++/53989
542         * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
543         to the list of variants.
545         * decl.c (xref_basetypes): Complain about incomplete template base.
546         * class.c (finish_struct): Adjust variants in templates, too.
548         PR c++/53549
549         * parser.c (cp_parser_class_head): Call xref_basetypes here.
550         (cp_parser_class_specifier_1): Not here.
551         * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
552         as well as DECL_DEPENDENT_P.
554 2012-07-16  Jason Merrill  <jason@redhat.com>
556         * cp-tree.h (struct deferred_access_check): Add location.
557         * semantics.c (perform_access_checks): Use it.
558         (perform_or_defer_access_check): Store it.
560 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
562         * dump.c (dump_stmt): Moved here from c-dump.c.
563         * optimize.c: Include dumpfile.h instead of tree-dump.h.
564         * class.c: Likewise.
565         * decl2.c: Likewise.
566         * Make-lang.in: Fix dependencies.
568 2012-07-13  Jason Merrill  <jason@redhat.com>
570         PR c++/53953
571         * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
573 2012-07-12  Jason Merrill  <jason@redhat.com>
575         * pt.c (instantiate_decl): Check typedefs access here.
576         (instantiate_template_1): Not here.
578         * pt.c (deduction_tsubst_fntype): Just suppress access checking.
579         (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
580         (push_deduction_access_scope, pop_deduction_access_scope): Remove.
582 2012-07-11  Jason Merrill  <jason@redhat.com>
584         DR 1402
585         * method.c (synthesized_method_walk): Replace uses of msg with diag.
586         Correct handling of virtual bases with move operations.
587         (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
589 2012-07-11  Steven Bosscher  <steven@gcc.gnu.org>
591         * method.c: Do not include tree-pass.h.
593 2012-07-10  Jason Merrill  <jason@redhat.com>
595         DR 1402
596         PR c++/53733
597         * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
598         (struct lang_decl_fn): Add suppress_implicit_decl field.
599         * method.c (implicitly_declare_fn): Check it.
600         (process_subob_fn): Add no_implicit_p parm.
601         (walk_field_subobs, synthesized_method_walk): Likewise.
602         (maybe_explain_implicit_delete): Adjust.
603         (explain_implicit_non_constexpr): Adjust.
605         * method.c (synthesized_method_walk): Avoid changing
606         EH spec based on cleanups in other places, too.
608 2012-07-09  Sterling Augustine  <saugustine@google.com>
610         * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
612 2012-07-08  Steven Bosscher  <steven@gcc.gnu.org>
614         * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
616 2012-07-06  Jason Merrill  <jason@redhat.com>
618         PR c++/53862
619         * pt.c (tsubst_arg_types): Add "end" parameter.
620         (check_undeduced_parms): Use it.
622         * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
624         PR c++/53858
625         * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
627 2012-07-05  Jason Merrill  <jason@redhat.com>
629         PR c++/53039
630         * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
631         cp_tree_equal.
633         * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
634         (struct template_parm_index_s): Remove num_siblings.
635         * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
636         (fixup_template_type_parm_type): Remove.
637         (build_template_parm_index): Remove num_siblings parm.
638         (process_template_parm): Likewise.
639         * parser.c (cp_parser_template_parameter_list): Adjust.
640         * tree.c (cp_tree_equal): Don't compare num_siblings.
641         * typeck.c (comp_template_parms_position): Likewise.
643         PR c++/50852
644         PR c++/53039
645         * tree.c (strip_typedefs_expr): New.
646         * cp-tree.h: Declare it.
647         * pt.c (convert_template_argument, unify): Use it.
648         * parser.c (cp_parser_template_declaration_after_export): Don't call
649         fixup_template_parms.
651 2012-07-04  Jason Merrill  <jason@redhat.com>
653         PR c++/53848
654         PR c++/53524
655         * decl.c (build_enumerator): Don't use build_lang_decl_loc.
657 2012-07-03  Jakub Jelinek  <jakub@redhat.com>
659         PR c++/53812
660         * semantics.c (finish_goto_stmt): Surround computed goto argument
661         with CLEANUP_POINT_EXPR if needed.
663 2012-07-02  Jason Merrill  <jason@redhat.com>
665         PR c++/53619
666         * pt.c (in_template_function): New.
667         * cp-tree.h: Declare it.
668         * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
670         PR c++/53783
671         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
672         for LAMBDA_EXPR_EXTRA_SCOPE.
674         PR c++/53788
675         * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
677         PR c++/53816
678         * class.c (resolves_to_fixed_type_p): Check uses_template_parms
679         (current_function_decl) instead of processing_template_decl.
681         PR c++/53821
682         * semantics.c (maybe_add_lambda_conv_op): Don't set
683         DECL_INTERFACE_KNOWN.
685         PR c++/53524
686         * call.c (build_conditional_expr_1): Don't warn about comparison of
687         two enumerators before their enumeration is complete.
688         (build_new_op_1): Call decay_conversion before warn_logical_operator.
689         * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
690         its enumeration.
691         * decl2.c (mark_used): Call used_types_insert for enums.
692         * semantics.c (finish_id_expression): Don't decay CONST_DECL.
693         (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
694         * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
695         * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
696         (build_class_member_access_expr): Look through unscoped enums.
697         * search.c (context_for_name_lookup): Look through unscoped enums.
698         * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
699         (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
700         * tree.c (decl_linkage): Likewise.
701         * cvt.c (ocp_convert): Check decayed expr for enum range warning.
703 2012-06-29  Steven Bosscher  <steven@gcc.gnu.org>
705         * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
707 2012-06-27  Jason Merrill  <jason@redhat.com>
709         * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
710         (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
711         (cp_parser_elaborated_type_specifier): Adjust.
712         * decl.c (duplicate_decls): Return error_mark_node on template
713         mismatch.
715         PR c++/53563
716         * parser.c (cp_parser_template_id): Add tag_type parm.
717         (cp_parser_template_name): Likewise.
718         (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
719         (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
720         (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
721         (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
723 2012-06-27  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
725         PR C++/51033
726         * semantics.c (constexpr_call): Fix typo in comment.
727         (cxx_eval_vec_perm_expr): New.
728         (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
730 2012-06-26  Richard Guenther  <rguenther@suse.de>
732         PR c++/53752
733         * mangle.c (write_array_type): Truncate the number-of-elements
734         result.
736 2012-06-25  Jason Merrill  <jason@redhat.com>
738         PR c++/53498
739         PR c++/53305
740         * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
741         if cp_unevaluated_operand is set.
742         (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
744         PR c++/52988
745         * typeck.c (decay_conversion): Don't discard side-effects from
746         expressions of nullptr_t.
748 2012-06-25  Florian Weimer  <fweimer@redhat.com>
750         * init.c (build_new_1): Warn about (T[N]) for variable N, and
751         reject T[M][N].
753         * parser.c (cp_parser_direct_new_declarator): Accept non-constant
754         expressions.  Handled now in build_new_1.
756 2012-06-25  Jason Merrill  <jason@redhat.com>
758         PR c++/53202
759         * semantics.c (build_data_member_initialization): Always keep
760         initializer for empty base.
761         (cxx_eval_bare_aggregate): Discard it here.
763         PR c++/53565
764         * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
765         (tsubst_expr) [OMP_FOR]: Here, too.
767 2012-06-25  Jakub Jelinek  <jakub@redhat.com>
769         PR c++/53594
770         * class.c (check_bases_and_members): Avoid -Wuninitialized
771         diagnostics for non-static const members or references if they
772         use NSDMI.
774 2012-06-16  Ville Voutilainen  <ville.voutilainen@gmail.com>
776         * parser.c (cp_parser_direct_declarator): Move virt-specifier
777         parsing after late-specified return type parsing.
779 2012-06-14  Jason Merrill  <jason@redhat.com>
781         PR c++/53651
782         * name-lookup.c (constructor_name_p): Don't try to look at the
783         name of a DECLTYPE_TYPE.
785 2012-06-18  Lawrence Crowl  <crowl@google.com>
787         * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
788         to TV_PHASE_OPT_GEN.
790 2012-06-18  Steven Bosscher  <steven@gcc.gnu.org>
792         * decl.c (finish_function): Remove code conditional on VMS_TARGET.
794 2012-06-15  Marc Glisse  <marc.glisse@inria.fr>
796         PR c++/51033
797         * semantics.c (literal_type_p): Handle VECTOR_TYPE.
798         (potential_constant_expression_1): Handle VEC_PERM_EXPR.
799         * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
801 2012-06-09  Jason Merrill  <jason@redhat.com>
803         * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
804         * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
805         * decl2.c (finish_static_data_member_decl): Avoid redundant error.
807         PR c++/53599
808         * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
809         * semantics.c (finish_cond): Build a COMPOUND_EXPR.
810         * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
811         [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
812         Don't return the decl.
814 2012-06-11  Richard Guenther  <rguenther@suse.de>
816         PR c++/53605
817         * mangle.c (write_array_type): Use double-ints for array domain
818         arithmetic.
820 2012-06-07  Fabien Chêne  <fabien@gcc.gnu.org>
822         PR c++/51214
823         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
824         Declare.
825         * class.c (insert_into_classtype_sorted_fields): New.
826         (add_enum_fields_to_record_type): New.
827         (count_fields): Adjust the comment.
828         (add_fields_to_record_type): Likewise.
829         (finish_struct_1): Move the code that inserts the fields for the
830         sorted case, into insert_into_classtype_sorted_fields, and call
831         it.
832         (insert_late_enum_def_into_classtype_sorted_fields): Define.
833         * decl.c (finish_enum_value_list): Call
834         insert_late_enum_def_into_classtype_sorted_fields if a late enum
835         definition is encountered.
837 2012-06-06  Paolo Carlini  <paolo.carlini@oracle.com>
839         PR c++/53567
840         * typeck.c (cp_perform_integral_promotions): New, like
841         perform_integral_promotions but also takes a tsubst_flags_t parameter.
842         (pointer_diff): Add tsubst_flags_t parameter.
843         (decay_conversion, cp_default_conversion, cp_build_array_ref,
844         cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
845         build_reinterpret_cast_1, cp_build_modify_expr,
846         convert_for_assignment): Adjust.
847         * optimize.c (build_delete_destructor_body): Adjust.
848         * init.c (expand_virtual_init, expand_default_init, build_new_1,
849         build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
850         (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
851         * class.c (build_base_path): Adjust.
852         * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
853         * method.c (synthesized_method_walk): Adjust flag and complain.
854         * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
855         (build_typeid, build_dynamic_cast_1): Adjust.
856         * except.c (initialize_handler_parm): Likewise.
857         * typeck2.c (process_init_constructor_record): Likewise.
858         * pt.c (tsubst_friend_class): Don't change flags.
859         * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
860         finish_static_assert): Likewise.
861         * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
862         lookup_name_real.
863         * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
864         (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
865         Adjust.
866         (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
867         (implicit_conversion): Mask out tf_error with a FIXME.
868         (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
869         complain & tf_error instead of flags & LOOKUP_COMPLAIN.
870         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
871         build_up_reference, convert_to_reference, cp_convert,
872         cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
873         parameter.
874         (convert_to_reference, ocp_convert): Use complain & tf_error instead
875         of flags & LOOKUP_COMPLAIN.
876         (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
877         * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
878         lookup_name_real, lookup_function_nonclass, lookup_name,
879         lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
880         * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
882 2012-06-06  Steven Bosscher  <steven@gcc.gnu.org>
884         * decl.c: Do not include output.h.
885         (start_decl): Remove code for flag_conserve_space.
887 2012-06-06  Fabien Chêne  <fabien@gcc.gnu.org>
889         PR c++/52841
890         * parser.c (cp_parser_alias_declaration): Return earlier
891         if an error occured.
893 2012-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
895         PR c++/53524
896         * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
897         to control enumeral mismatch in conditional expression too.
899 2012-06-04   Sterling Augustine  <saugustine@google.com>
901         * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
902         * cp-lang.c (cxx_dwarf_name): Call them.
904 2012-06-04  Steven Bosscher  <steven@gcc.gnu.org>
906         * semantics.c: Do not include output.h.
907         * decl2.c: Likewise.
908         * friend.c: Likewise.
909         * typeck.c: Likewise.
910         * typeck2.c: Likewise.
911         * Make-lang.in: Fix dependencies.
913 2012-06-01  Jason Merrill  <jason@redhat.com>
915         PR c++/52973
916         * parser.c (cp_parser_class_head): Apply attributes here.
917         * semantics.c (begin_class_definition): Not here.
918         * cp-tree.h: Adjust.
920         PR c++/52725
921         * parser.c (cp_parser_binary_expression): Bail early if we're parsing
922         tentatively and the LHS has a parse error.
924         PR c++/53137
925         * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
926         (instantiate_decl): Don't push_to_top_level for local class methods.
927         (instantiate_class_template_1): Or for local classes.
929         PR c++/53484
930         * pt.c (do_auto_deduction): Don't try to deduce from a
931         type-dependent initializer.
933 2012-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
935         PR c++/26155
936         * name-lookup.c (push_namespace): When error recovery is
937         impossible just error out in duplicate_decls.
939 2012-05-31  Steven Bosscher  <steven@gcc.gnu.org>
941         * call.c: Do not include output.h.
942         * class.c: Likewise.
943         * except.c: Likewise.
944         * friend.c: Likewise.
945         * init.c: Likewise.
946         * lex.c: Likewise.
947         * method.c: Likewise.
948         * parser.c: Likewise.
949         * pt.c: Likewise.
950         * rtti.c: Likewise.
951         * search.c: Likewise.
953 2012-05-30  Jason Merrill  <jason@redhat.com>
955         PR c++/53356
956         * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
957         representing a bitwise copy of a glvalue.
959         * tree.c (stabilize_expr): Tweak logic.
961         PR c++/53356
962         * tree.c (stabilize_init): Side effects make the init unstable.
964 2012-05-28  Paolo Carlini  <paolo.carlini@oracle.com>
966         PR c++/53503
967         * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
969 2012-05-26  Paolo Carlini  <paolo.carlini@oracle.com>
971         PR c++/53491
972         * tree.c (stabilize_expr): Handle exp of void type.
974 2012-05-26  Jason Merrill  <jason@redhat.com>
976         PR c++/53220
977         * call.c (convert_like_real) [ck_list]: Take array address directly.
978         * typeck.c (decay_conversion): Reject decay of an array compound
979         literal.
981 2012-05-25  Paolo Carlini  <paolo.carlini@oracle.com>
983         PR c++/32054
984         * parser.c (cp_parser_member_declaration): A storage class is not
985         allowed in a declaration of an anonymous aggregate in a class scope.
987 2012-05-24  Uros Bizjak  <ubizjak@gmail.com>
989         PR obj-c++/53441
990         * decl.c (grokdeclarator): Check that current_class_type is non-NULL
991         before calling constructor_name_p.
993 2012-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
995         PR c++/32080
996         * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
997         cp_parser_function_body): Add a bool parameter, true when parsing
998         a function-try-block.
999         (cp_parser_function_try_block): Pass true to the above.
1000         (cp_parser_function_definition_after_declarator,
1001         cp_parser_function_transaction): Adjust.
1003 2012-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
1005         PR c++/29185
1006         * decl2.c (delete_sanity): Extend 'deleting array' warning to
1007         any array type.
1009 2012-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1011         PR c++/51184
1012         * decl.c (grokdeclarator): Diagnose functions returning abstract
1013         class types as TYPENAME.
1014         * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
1015         * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
1016         * pt.c (tsubst): Likewise.
1017         * semantics.c (trait_expr_value): Likewise.
1019 2012-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1021         PR c++/40821
1022         * parser.c (cp_parser_attributes_opt): Enforce error checking of
1023         unbalanced parentheses in the presence of tentative parsing.
1025 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1027         PR c++/39681
1028         * parser.c (cp_parser_new_type_id): Early return error_mark_node
1029         if the cp_parser_type_specifier_seq call has type_specifier_seq.type
1030         error_mark_node; tidy.
1031         (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
1032         avoid uninitialized warnings.
1033         (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
1034         Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
1035         returns error_mark_node.
1037 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1039         PR c++/53371
1040         * except.c (is_admissible_throw_operand): Rename to
1041         is_admissible_throw_operand_or_catch_parameter and handle
1042         catch parameter too.
1043         (expand_start_catch_block): Use it.
1044         (build_throw): Adjust.
1046 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1048         PR c++/44516
1049         * typeck.c (build_x_array_ref, build_x_conditional_expr,
1050         build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
1051         (finish_class_member_access_expr, build_x_indirect_ref,
1052         build_x_binary_op, build_x_compound_expr_from_list,
1053         build_x_compound_expr_from_vec): Adjust callers.
1054         * tree.c (build_min_nt_loc): New.
1055         (build_min_nt): Remove.
1056         * typeck2.c (build_x_arrow): Adjust callers.
1057         * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
1058         tsubst_copy_and_build): Likewise.
1059         * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
1060          finish_omp_atomic): Likewise.
1061         * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
1062         * parser.c (cp_parser_question_colon_clause,
1063         cp_parser_assignment_expression, cp_parser_expression,
1064         cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
1065         * cp-tree.h: Update.
1067 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
1069         PR preprocessor/7263
1070         * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
1071         the possible declarator specifiers so far.
1072         (struct cp_decl_specifier_seq::locations): Declare new member.
1073         (cp_decl_specifier_seq::{specs, type_location}): Remove.
1074         (decl_spec_seq_has_spec_p): Declare new function.
1075         * parser.c (cp_parser_check_decl_spec): Remove.
1076         (set_and_check_decl_spec_loc): Define new static function.
1077         (decl_spec_seq_has_spec_p): Define new public function.
1078         (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
1079         (cp_parser_type_specifier, cp_parser_simple_type_specifier)
1080         (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
1081         (cp_parser_alias_declaration): Set the locations for each
1082         declspec, using set_and_check_decl_spec_loc.
1083         (cp_parser_explicit_instantiation, cp_parser_init_declarator)
1084         (cp_parser_member_declaration, cp_parser_init_declarator): Use the
1085         new declspec location for specifiers.  Use the new
1086         decl_spec_seq_has_spec_p.
1087         (cp_parser_type_specifier_seq): Use the new
1088         set_and_check_decl_spec_loc.  Stop using
1089         cp_parser_check_decl_spec.  Use the new decl_spec_seq_has_spec_p.
1090         (, cp_parser_init_declarator): Use the new
1091         set_and_check_decl_spec_loc.
1092         (cp_parser_single_declaration, cp_parser_friend_p)
1093         (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
1094         Use the new decl_spec_seq_has_spec_p.
1095         * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p.  Use
1096         the more precise ds_redefined_builtin_type_spec location for
1097         diagnostics about re-declaring C++ built-in types.
1098         (start_decl, grokvardecl, grokdeclarator): Use the new
1099         decl_spec_seq_has_spec_p.
1101 2012-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
1103         PR c++/11856
1104         * pt.c (tsubst_copy_and_build): Increase / decrease
1105         c_inhibit_evaluation_warnings around build_x_binary_op call.
1107 2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
1109         * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
1110         (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
1111         (TYPE_PTR_OR_PTRMEM_P): Add.
1112         * typeck.c (composite_pointer_type_r, composite_pointer_type,
1113         common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
1114         cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
1115         build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
1116         casts_away_constness_r, casts_away_constness): Adjust.
1117         * init.c (build_zero_init_1): Adjust.
1118         * class.c (check_field_decls): Likewise.
1119         * decl.c (check_default_argument): Likewise.
1120         * rtti.c (target_incomplete_p): Likewise.
1121         * tree.c (zero_init_p): Likewise.
1122         * cxx-pretty-print.c (pp_cxx_ptr_operator,
1123         pp_cxx_abstract_declarator): Likewise.
1124         * typeck2.c (build_m_component_ref): Likewise.
1125         * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
1126         dependent_type_p_r): Likewise.
1127         * call.c (null_member_pointer_value_p, standard_conversion,
1128         add_builtin_candidate, build_conditional_expr_1, compare_ics):
1129         Likewise.
1130         * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
1131         * cvt.c (cp_convert_to_pointer, ocp_convert,
1132         perform_qualification_conversions): Likewise.
1133         * mangle.c (write_type): Likewise.
1134         * name-lookup.c (arg_assoc_type): Likewise.
1136 2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
1138         * parser.c (struct cp_parser_expression_stack_entry): Add location_t
1139         field.
1140         (cp_parser_binary_expression): Rework to always update at the same
1141         time tree_type and loc.
1142         * call.c (print_z_candidate): Add location_t parameter.
1143         (print_z_candidates, convert_like_real, joust): Adjust.
1145 2012-05-11  Alexandre Oliva  <aoliva@redhat.com>
1147         PR c++/53209
1148         * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
1150 2012-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
1152         PR c++/53305
1153         * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
1154         tsubst_decl returns NULL_TREE.
1155         * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
1156         BOUND_TEMPLATE_TEMPLATE_PARM.
1158 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1160         PR c++/53158
1161         * cvt.c (ocp_convert): Error out early for void -> bool conversions.
1162         * typeck.c (decay_conversion): Use error_at.
1163         * call.c (build_integral_nontype_arg_conv, convert_like_real,
1164         convert_arg_to_ellipsis, perform_implicit_conversion_flags,
1165         initialize_reference): Likewise.
1166         * cvt.c (warn_ref_binding): Add location_t parameter.
1167         (cp_convert_to_pointer, convert_to_reference, ocp_convert,
1168         convert_to_void, ): Use error_at and warning_at.
1170 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1172         PR c++/53301
1173         * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
1174         instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
1176 2012-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
1178         PR c++/53152
1179         * call.c (op_error, build_new_op_1, build_new_op): Add location_t
1180         parameter.
1181         (build_conditional_expr_1): Adjust.
1182         * typeck.c (build_x_indirect_ref, build_x_binary_op,
1183         build_x_unary_op): Add location_t parameter.
1184         (rationalize_conditional_expr, build_x_array_ref,
1185         build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
1186         Adjust.
1187         * typeck2.c (build_x_arrow): Add location_t parameter.
1188         * semantics.c (finish_unary_op_expr): Likewise.
1189         (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
1190         * decl2.c (grok_array_decl): Add location_t parameter.
1191         * parser.c (cp_parser_postfix_open_square_expression,
1192         cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
1193         cp_parser_binary_expression, cp_parser_builtin_offsetof,
1194         do_range_for_auto_deduction, cp_convert_range_for,
1195         cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
1196         location, adjust.
1197         * pt.c (tsubst_copy_and_build): Adjust.
1198         * tree.c (maybe_dummy_object): Likewise.
1199         * cp-tree.h: Update declarations.
1201 2012-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1203         * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
1205 2012-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1207         PR c++/53166
1208         * pt.c (instantiate_class_template_1): Increase / decrease
1209         c_inhibit_evaluation_warnings around the tsubst_expr call
1210         for STATIC_ASSERT_CONDITION.
1211         (tsubst_expr, case STATIC_ASSERT): Likewise.
1212         * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
1213         c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
1215 2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
1217         PR c++/53186
1218         * call.c (build_over_call): Handle final member functions
1219         and class types.
1220         (build_new_method_call_1): Do not handle here.
1222 2012-05-02  Richard Guenther  <rguenther@suse.de>
1224         * decl.c (grokdeclarator): Properly check for sizes that
1225         cover more than half of the address-space.
1227 2012-04-30  Marc Glisse  <marc.glisse@inria.fr>
1229         PR c++/51033
1230         * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
1231         * decl2.c (grok_array_decl): Likewise.
1233         PR c++/51314
1234         * parser.c (cp_parser_sizeof_operand): Require parentheses for
1235         sizeof...
1237 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
1239         Fix location for static class members
1240         * decl.c (grokdeclarator): Use the location carried by the
1241         declarator for the DECL of the static class member.
1243         Fix va_arg type location
1244         * cp-tree.h (build_x_va_arg): Take an additional location
1245         parameter.
1246         * call.c (build_x_va_arg): Take a loc parameter for the location
1247         of the type of the va_arg expression.
1248         * parser.c (cp_parser_primary_expression): Pass the type of the
1249         type in the va_arg expression to build_x_va_arg.
1250         * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
1252         Make conversion warnings work on NULL with -ftrack-macro-expansion
1253         * call.c (conversion_null_warnings): Use the new
1254         expansion_point_location_if_in_system_header.
1255         * cvt.c (build_expr_type_conversion): Likewise.
1256         * typeck.c (cp_build_binary_op): Likewise.
1258 2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1260         * typeck.c (convert_for_assignment):  Replace
1261         Wmissing-format-attribute with Wsuggest-attribute=format.
1262         * call.c (convert_for_arg_passing): Likewise.
1264 2012-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1266         PR c++/53096
1267         * class.c (check_bases_and_members): Implement core/1333, do not
1268         disallow defaulted in the class body non-const ref special members.
1270 2012-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
1272         PR c++/52363
1273         * call.c (tourney, perform_overload_resolution,
1274         build_operator_new_call, build_user_type_conversion_1,
1275         build_user_type_conversion, perform_overload_resolution,
1276         add_template_candidate, add_template_candidate_real,
1277         add_template_conv_candidate, add_builtin_candidates,
1278         add_builtin_candidate, build_builtin_candidate,
1279         add_conv_candidate, add_function_candidate, implicit_conversion,
1280         reference_binding, build_list_conv, conditional_conversion,
1281         add_candidates, can_convert_array, build_aggr_conv,
1282         build_array_conv, build_complex_conv, conditional_conversion):
1283         Add tsubst_flags_t parameter.
1284         (joust): Likewise, use it to handle SFINAE as if pedantic.
1285         (add_list_candidates, build_integral_nontype_arg_conv,
1286         perform_overload_resolution, build_new_function_call,
1287         build_operator_new_call, build_op_call_1,
1288         build_conditional_expr_1, build_new_op_1, convert_like_real,
1289         convert_arg_to_ellipsis, convert_default_arg,
1290         convert_for_arg_passing, build_over_call,
1291         build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
1292         perform_implicit_conversion_flags,
1293         perform_direct_initialization_if_possible,
1294         initialize_reference): Adjust.
1295         * typeck.c (casts_away_constness, casts_away_constness_r):
1296         Add tsubst_flags_t parameter.
1297         (convert_arguments, check_for_casting_away_constness,
1298         build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
1299         Adjust.
1300         * decl.c (reshape_init_r, check_default_argument): Likewise.
1301         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1302         * pt.c (convert_nontype_argument, check_non_deducible_conversion):
1303         Likewise.
1304         * init.c (build_new_1): Likewise.
1305         * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
1306         build_expr_type_conversion, ): Likewise.
1307         * search.c (check_final_overrider): Likewise.
1308         * cp-tree.h (build_user_type_conversion,
1309         build_operator_new_call, can_convert, can_convert_arg,
1310         can_convert_arg_bad, convert_default_arg,
1311         convert_arg_to_ellipsis, convert_for_arg_passing):
1312         Adjust declaration.
1314 2012-04-22  Jan Hubicka  <jh@suse.cz>
1316         * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
1317         gets finalized.
1319 2012-04-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1321         PR c/44774
1322         * typeck.c (composite_pointer_type): Likewise.
1323         (cxx_sizeof_or_alignof_type): Likewise.
1324         (cp_build_array_ref): Likewise.
1325         (cp_build_function_call_vec): Likewise.
1326         (cp_build_addr_expr_1): Likewise.
1327         (convert_member_func_to_ptr): Likewise.
1328         * decl.c (check_tag_decl): Likewise.
1329         (check_static_variable_definition): Likewise.
1330         (compute_array_index_type): Likewise.
1331         (create_array_type_for_decl): Likewise.
1332         (grokdeclarator): Likewise.
1333         (grok_op_properties): Likewise.
1334         * error.c (maybe_warn_cpp0x): Likewise.
1335         * pt.c (maybe_process_partial_specialization): Likewise.
1336         (convert_template_argument): Likewise.
1337         (do_decl_instantiation): Likewise.
1338         (do_type_instantiation): Likewise.
1339         * parser.c (cp_parser_primary_expression): Likewise.
1340         (cp_parser_postfix_expression): Likewise.
1341         (cp_parser_unary_expression): Likewise.
1342         (cp_parser_question_colon_clause): Likewise.
1343         (cp_parser_lambda_introducer): Likewise.
1344         (cp_parser_lambda_declarator_opt): Likewise.
1345         (cp_parser_compound_statement): Likewise.
1346         (cp_parser_jump_statement): Likewise.
1347         (cp_parser_declaration_seq_opt): Likewise.
1348         (cp_parser_enum_specifier): Likewise.
1349         (cp_parser_enumerator_list): Likewise.
1350         (cp_parser_initializer_list): Likewise.
1351         (cp_parser_member_declaration): Likewise.
1352         * call.c (build_conditional_expr_1): Likewise.
1353         * friend.c (make_friend_class): Likewise.
1354         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1356 2012-04-21  Jan Hubicka  <jh@suse.cz>
1358         * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
1359         * decl2.c (mark_needed): Likewise.
1360         (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
1362         * decl2.c (cxx_callgraph_analyze_expr): Remove.
1363         * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
1364         * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
1366 2012-04-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1368         PR 35441
1369         * typeck.c (cp_build_function_call_vec): Do not pretty-print
1370         expressions when caret is enabled.
1372 2012-04-20  Jan Hubicka  <jh@suse.cz>
1374         PR target/53042
1375         * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
1376         list when target has no support for it.
1378 2012-04-20  Michael Matz  <matz@suse.de>
1380         * error.c (pedwarn_cxx98): Move va_end call after user
1381         of the va_list.
1383 2012-04-18  Paolo Carlini  <paolo.carlini@oracle.com>
1385         PR c++/52422
1386         * cp-tree.h (build_addr_func, decay_conversion,
1387         get_member_function_from_ptrfunc,
1388         build_m_component_ref, convert_member_func_to_ptr):
1389         Add tsubst_flags_t parameter.
1390         * typeck.c (cp_default_conversion): Add.
1391         (decay_conversion, default_conversion,
1392         get_member_function_from_ptrfunc, convert_member_func_to_ptr):
1393         Add tsubst_flags_t parameter and use it throughout.
1394         (cp_build_indirect_ref, cp_build_array_ref,
1395         cp_build_function_call_vec, convert_arguments, build_x_binary_op,
1396         cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
1397         build_const_cast_1, expand_ptrmemfunc_cst,
1398         convert_for_initialization): Adjust.
1399         * init.c (build_vec_init): Adjust.
1400         * decl.c (grok_reference_init, get_atexit_node): Likewise.
1401         * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
1402         * except.c (build_throw): Likewise.
1403         * typeck2.c (build_x_arrow): Likewise.
1404         (build_m_component_ref): Add tsubst_flags_t parameter and
1405         use it throughout.
1406         * pt.c (convert_nontype_argument): Adjust.
1407         * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
1408         * decl2.c (build_offset_ref_call_from_tree): Likewise.
1409         * call.c (build_addr_func): Add tsubst_flags_t parameter and
1410         use it throughout.
1411         (build_call_a, build_conditional_expr_1, build_new_op_1,
1412         convert_like_real, convert_arg_to_ellipsis, build_over_call,
1413         build_special_member_call): Adjust.
1414         * cvt.c (cp_convert_to_pointer, force_rvalue,
1415         build_expr_type_conversion): Likewise.
1417 2012-04-17  Tom de Vries  <tom@codesourcery.com>
1419         * cp-gimplify.c (begin_bc_block): Add location parameter and use as
1420         location argument to create_artificial_label.
1421         (finish_bc_block): Change return type to void.  Remove body_seq
1422         parameter, and add block parameter.  Append label to STMT_LIST and
1423         return in block.
1424         (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
1425         (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
1426         (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
1427         (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
1428         (genericize_break_stmt, genericize_omp_for_stmt): New function.
1429         (cp_gimplify_omp_for): Remove bc_continue processing.
1430         (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
1431         (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
1432         CONTINUE_STMT, and BREAK_STMT as unreachable.
1433         (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
1434         SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
1435         (cp_genericize_tree): New function, factored out of ...
1436         (cp_genericize): ... this function.
1438 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
1440         PR c++/52599
1441         * semantics.c (build_constexpr_constructor_member_initializers):
1442         Check for function-try-block as function-body.
1444 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
1446         PR c++/53003
1447         * parser.c (cp_parser_member_declaration): Check that
1448         initializer_token_start is non null before dereferencing it.
1450 2012-04-16  Jason Merrill  <jason@redhat.com>
1452         PR c++/38543
1453         * pt.c (determine_specialization): Instead of comparing the number
1454         of parms, check that tsubst gives the right answer.
1456         PR c++/52008
1457         * pt.c (process_partial_specialization): Complain about a partial
1458         specialization with fewer args than primary template parms.
1460         PR c++/50830
1461         * pt.c (convert_template_argument): Handle template template
1462         argument packs.
1464         PR c++/50303
1465         * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
1466         template parameters.
1468 2012-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
1470         PR c++/49152
1471         * call.c (op_error): Print types; when flag_diagnostics_show_caret
1472         is false print expressions too.
1473         (op_error_string): Add.
1475 2012-04-16  Jason Merrill  <jason@redhat.com>
1477         PR c++/51148
1478         * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
1480 2012-04-16  Jan Hubicka  <jh@suse.cz>
1482         * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
1483         walkers to walk cgraph and varpool.
1485 2012-04-15  Jason Merrill  <jason@redhat.com>
1487         PR c++/47220
1488         * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
1490         PR c++/52292
1491         PR c++/52380
1492         * pt.c (coerce_template_parms): Even if we aren't converting we
1493         want to expand argument packs.
1495         PR c++/52706
1496         * mangle.c (write_type): nullptr_t is a builtin type.
1498 2012-04-14  Jan Hubicka  <jh@suse.cz>
1500         * tree.c: Update field referenced for new cgraph/varpool layout.
1501         * decl2.c: Likewise.
1503 2012-04-13  Jason Merrill  <jason@redhat.com>
1505         PR c++/52824
1506         * pt.c (any_pack_expanson_args_p): New.
1507         (coerce_template_parms): Use it.
1509         PR c++/52905
1510         * call.c (joust): Handle comparing list and non-list ctors.
1512         PR c++/52915
1513         * decl2.c (finish_anon_union): Use cp_finish_decl.
1514         * error.c (dump_function_name): Avoid showing anonymous "name".
1516 2012-04-11  Fabien Chêne  <fabien@gcc.gnu.org>
1518         PR c++/52465
1519         * parser.c (cp_parser_class_name): Call strip_using_decl and
1520         return the target decl.
1521         * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
1522         to be stripped is NULL_TREE.
1523         (qualify_lookup): Call strip_using_decl and perform some checks on
1524         the target decl.
1526 2012-04-11  Jason Merrill  <jason@redhat.com>
1528         PR debug/45088
1529         * decl.c (grokdeclarator): Strip the injected-class-name typedef
1530         if we are building a declaration or compound type.
1532         PR c++/52906
1533         * decl.c (check_tag_decl): Don't complain about attributes if we
1534         don't even have a type.
1536 2012-04-10  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1538         * cvt.c (convert_to_void): Update comment.
1540 2012-04-05  Jason Merrill  <jason@redhat.com>
1542         PR c++/52596
1543         * semantics.c (finish_non_static_data_member): In templates, pass
1544         the decl to build_qualified_name.
1545         * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
1547 2012-04-04  Jason Merrill  <jason@redhat.com>
1549         PR c++/52845
1550         * decl.c (finish_function): Update fntype after deducing return type.
1552 2012-04-03  Jason Merrill  <jason@redhat.com>
1554         PR c++/52796
1555         * pt.c (tsubst_initializer_list): A pack expansion with no elements
1556         means value-initialization.
1558 2012-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
1560         PR c++/50043
1561         * class.c (deduce_noexcept_on_destructor,
1562         deduce_noexcept_on_destructors): New.
1563         (check_bases_and_members): Call the latter.
1564         * decl.c (grokfndecl): Call the former.
1565         * method.c (implicitly_declare_fn): Not static.
1566         * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
1567         Declare
1569 2012-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
1571         PR c++/52718
1572         * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
1573         warn for a zero as null pointer constant default argument.
1575 2012-03-29  Jason Merrill  <jason@redhat.com>
1577         PR c++/52685
1578         * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
1580 2012-03-29  Jakub Jelinek  <jakub@redhat.com>
1582         PR c++/52759
1583         * decl.c (start_decl): Don't call maybe_apply_pragma_weak
1584         if processing_template_decl.
1586 2012-03-29  Jason Merrill  <jason@redhat.com>
1588         PR c++/52743
1589         * call.c (compare_ics): Handle ck_aggr like ck_list.
1591 2012-03-28  Jason Merrill  <jason@redhat.com>
1593         PR c++/52746
1594         * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
1595         we didn't get an explicit scope.
1596         * pt.c (tsubst_baselink): Likewise.
1598 2012-03-28  Richard Guenther  <rguenther@suse.de>
1600         * typeck2.c (process_init_constructor_array): Use the proper
1601         type for computing the array length.
1603 2012-03-27  Meador Inge  <meadori@codesourcery.com>
1605         PR c++/52672
1606         * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
1607         stripped child trees that are not pointer types.
1609 2012-03-21  Jason Merrill  <jason@redhat.com>
1611         Implement return type deduction for normal functions with -std=c++1y.
1612         * cp-tree.h (FNDECL_USED_AUTO): New macro.
1613         (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
1614         (dependent_lambda_return_type_node): Remove.
1615         (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
1616         (struct language_function): Add x_auto_return_pattern field.
1617         (current_function_auto_return_pattern): New.
1618         (enum tsubst_flags): Add tf_partial.
1619         * decl.c (decls_match): Handle auto return comparison.
1620         (duplicate_decls): Adjust error message for auto return.
1621         (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
1622         (cp_finish_decl): Don't do auto deduction for functions.
1623         (grokdeclarator): Allow auto return without trailing return type in
1624         C++1y mode.
1625         (check_function_type): Defer checking of deduced return type.
1626         (start_preparsed_function): Set current_function_auto_return_pattern.
1627         (finish_function): Set deduced return type to void if not previously
1628         deduced.
1629         * decl2.c (change_return_type): Handle error_mark_node.
1630         (mark_used): Always instantiate functions with deduced return type.
1631         Complain about use if deduction isn't done.
1632         * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
1633         initial return type.
1634         (cp_parser_lambda_body): Don't deduce return type in a template.
1635         (cp_parser_conversion_type_id): Allow auto in C++1y.
1636         * pt.c (instantiate_class_template_1): Don't mess with
1637         LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
1638         (tsubst_copy_and_build): Likewise.
1639         (fn_type_unification, tsubst): Don't reduce the template parm level
1640         of 'auto' during deduction.
1641         (unify): Compare 'auto' specially.
1642         (get_bindings): Change test.
1643         (always_instantiate_p): Always instantiate functions with deduced
1644         return type.
1645         (do_auto_deduction): Handle error_mark_node and lambda context.
1646         Don't check for use in initializer.
1647         (contains_auto_r): Remove.
1648         * search.c (lookup_conversions_r): Handle auto conversion function.
1649         * semantics.c (lambda_return_type): Handle null return.  Don't mess
1650         with dependent_lambda_return_type_node.
1651         (apply_deduced_return_type): Rename from apply_lambda_return_type.
1652         * typeck.c (merge_types): Handle auto.
1653         (check_return_expr): Do auto deduction.
1654         * typeck2.c (add_exception_specifier): Fix complain check.
1656 2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
1658         PR c++/52487
1659         * class.c (check_field_decls): Call literal_type_p only
1660         on complete types.
1662 2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1664         PR c++/52671
1665         * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
1666         on CLASS_TYPE_P types.
1668 2012-03-20  Jason Merrill  <jason@redhat.com>
1670         * lex.c (init_reswords): Use >= for cxx_dialect test.
1671         * parser.c (cp_parser_exception_specification_opt): Likewise.
1673         * mangle.c (write_type): Handle 'auto'.
1674         * init.c (build_new): Don't do auto deduction where it might
1675         affect template mangling.
1677         PR c++/52510
1678         * decl.c (reshape_init_class): Handle repeated reshaping.
1679         * search.c (lookup_field_1): Add sanity check.
1681 2012-03-19  Paolo Carlini  <paolo.carlini@oracle.com>
1683         PR c++/14710
1684         * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
1685         * tree.c (xvalue_p): Define.
1686         * typeck.c (maybe_warn_about_useless_cast): Define.
1687         (build_reinterpret_cast, build_const_cast,
1688         build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
1689         * rtti.c (build_dynamic_cast): Likewise.
1690         * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
1691         c_inhibit_evaluation_warnings before/after the build_* calls.
1693 2012-03-15  Jason Merrill  <jason@redhat.com>
1695         PR c++/52582
1696         * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
1698 2012-03-15  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1700         PR c++/44783
1701         * error.c (print_instantiation_partial_context): Use
1702         template_backtrace_limit.
1704 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1706         * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
1708 2012-03-14  Jakub Jelinek  <jakub@redhat.com>
1710         PR c++/52521
1711         * parser.c (lookup_literal_operator): Return fn only if
1712         processed all arguments from args vector and argtypes is
1713         void_list_node.
1715 2012-01-30  Dodji Seketeli  <dodji@redhat.com>
1717         PR c++/51641
1718         * cp-tree.h (template_type_parameter_p): Declare new function.
1719         (parameter_of_template_p): Remove.
1720         * pt.c (template_type_parameter_p): Define new function.
1721         (parameter_of_template_p): Remove.
1722         * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
1723         on parameter_of_template_p anymore.  Compare the level of the
1724         template parameter to the depth of the template.
1726 2011-12-15  Dodji Seketeli  <dodji@redhat.com>
1728         * call.c (standard_conversion, build_integral_nontype_arg_conv)
1729         (build_new_op_1, convert_like_real, is_subseq)
1730         (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
1731         (joust): Use next_conversion instead of accessing fields of struct
1732         conversion directly.
1734 2012-03-12  Paolo Carlini  <paolo.carlini@oracle.com>
1736         PR c++/52299
1737         * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
1738         division by zero warnings.
1740 2012-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
1742         * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
1743         build_ptrmemfunc): Consistently forward the tsubst_flags_t
1744         parameter.
1745         * call.c (resolve_args): Likewise.
1747 2012-03-07  Jason Merrill  <jason@redhat.com>
1749         PR c++/52521
1750         * mangle.c (write_literal_operator_name): The length comes after the
1751         operator prefix.
1753 2012-03-05  Jakub Jelinek  <jakub@redhat.com>
1755         * pt.c (local_specializations): Change from htab_t into
1756         struct pointer_map_t *.
1757         (retrieve_local_specializations, register_local_specialization,
1758         tsubst_pack_expansion, instantiate_decl): Adjust users.
1759         (eq_local_specializations, hash_local_specialization): Remove.
1761 2012-03-05  Jason Merrill  <jason@redhat.com>
1763         PR c++/51930
1764         * decl2.c (determine_visibility): Correct calculation of class
1765         args depth.
1766         * decl.c (check_tag_decl): Adjust warning.
1768         * method.c (synthesized_method_walk): Cleanups don't affect the EH
1769         spec either.
1771 2012-03-03  Jason Merrill  <jason@redhat.com>
1773         * init.c (perform_member_init): Cope with uninstantiated NSDMI.
1775         Core 1270
1776         * call.c (build_aggr_conv): Call reshape_init.
1777         (convert_like_real): Likewise.
1778         * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
1779         not all constant.
1781         * mangle.c (write_nested_name): Use decl_mangling_context.
1782         (write_prefix, write_template_prefix): Likewise.
1784         PR c++/36797
1785         * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
1787         * class.c (add_method): Always build an OVERLOAD for using-decls.
1788         * search.c (lookup_member): Handle getting an OVERLOAD for a
1789         single function.
1791 2012-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
1793         PR c++/51989
1794         * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
1795         propagate it.
1796         * cp-tree.h (build_x_arrow): Adjust prototype.
1797         * pt.c (tsubst_copy_and_build): Adjust call.
1798         * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1800 2012-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
1802         * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
1804 2012-02-29  Jason Merrill  <jason@redhat.com>
1806         PR c++/51930
1807         * decl.c (check_tag_decl): Move warning for misplaced attributes here.
1808         (shadow_tag): From here.
1809         * parser.c (cp_parser_explicit_instantiation): Don't warn here.
1811 2012-02-21  Jakub Jelinek  <jakub@redhat.com>
1813         PR c++/52312
1814         * typeck.c (check_literal_operator_args): Initialize *long_double_p
1815         and *long_long_unsigned_p even if processing_template_decl.
1817 2012-02-16  Jason Merrill  <jason@redhat.com>
1819         PR c++/52248
1820         * decl.c (define_label): Use timevar_cond_start/stop.
1822 2012-02-16  Fabien Chêne  <fabien@gcc.gnu.org>
1824         PR c++/52126
1825         * decl.c (xref_basetypes): call dependent_scope_p instead of
1826         dependent_type_p.
1828 2012-02-16  Jason Merrill  <jason@redhat.com>
1830         PR c++/51415
1831         * error.c (dump_expr): Handle lambda closures specifically.
1833 2012-02-14  Jason Merrill  <jason@redhat.com>
1835         * parser.c (cp_parser_explicit_instantiation): Give a warning
1836         for ignored attributes on explicit class instantiation.
1838 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
1840         PR c++/52247
1841         * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
1842         lookup_label on label's name and set TREE_USED.
1844 2012-02-14  Jason Merrill  <jason@redhat.com>
1846         PR c++/39055
1847         * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
1849 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
1851         PR c/52181
1852         * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
1853         newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
1855 2012-02-07  Jason Merrill  <jason@redhat.com>
1857         PR c++/51675
1858         * semantics.c (cx_check_missing_mem_inits): Handle unions.
1859         Fix constexpr default constructor logic.
1861         PR c++/52035
1862         * pt.c (tsubst): Strip uninstantiated typedef.
1864 2012-02-06  Jason Merrill  <jason@redhat.com>
1866         PR c++/52088
1867         * cvt.c (build_expr_type_conversion): Check for template conversion.
1869 2012-01-31  Jason Merrill  <jason@redhat.com>
1871         PR c++/52043
1872         * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
1873         * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
1874         (tsubst_pack_expansion): Check it.
1876 2012-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
1878         PR c++/51327
1879         * class.c (explain_non_literal_class): Correctly handle implicitly
1880         deleted constructors.
1882 2012-01-27  Jakub Jelinek  <jakub@redhat.com>
1884         PR c++/51852
1885         * pt.c (tsubst_pack_expansion): Delete and restore
1886         local_specialization whenever need_local_specialization, not just
1887         when saved_local_specializations is non-NULL.
1889 2012-01-26  Paolo Carlini  <paolo.carlini@oracle.com>
1891         PR c++/51370
1892         * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
1893         as TREE_OPERAND (t, 1).
1895 2012-01-24  Jason Merrill  <jason@redhat.com>
1897         PR c++/51917
1898         * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
1900         PR c++/51973
1901         * tree.c (called_fns_equal): Check template args.
1902         (cp_tree_equal): Call it.
1904 2012-01-24  Aldy Hernandez  <aldyh@redhat.com>
1905             Patrick Marlier  <patrick.marlier@gmail.com>
1907         PR c++/51928
1908         * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
1909         thunk for set_one_vmethod_tm_attributes.
1911 2012-01-24  Paolo Carlini  <paolo.carlini@oracle.com>
1913         PR c++/51223
1914         * call.c (build_over_call): Check for error_mark_node as
1915         TREE_VALUE when default arguments are processed.
1917 2012-01-23  Jason Merrill  <jason@redhat.com>
1919         PR c++/51930
1920         * decl2.c (determine_visibility): Check for visibility attribute
1921         on template specialization.
1923 2012-01-23  Paolo Carlini  <paolo.carlini@oracle.com>
1925         PR c++/51398
1926         * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
1928 2012-01-23  Jason Merrill  <jason@redhat.com>
1930         PR c++/51925
1931         * class.c (add_method): Set OVL_USED for using-decls.
1932         * tree.c (ovl_scope): New.
1933         * cp-tree.h: Declare it.
1934         * parser.c (cp_parser_template_name): Use it.
1935         * semantics.c (baselink_for_fns): Likewise.
1936         * name-lookup.c (set_inherited_value_binding_p): Likewise.
1938 2012-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
1940         PR c++/51402
1941         * pt.c (lookup_template_class_1): Check context returned by
1942         tsubst for error_mark_node.
1944 2012-01-19  Kai Tietz  <ktietz@redhat.com>
1946         PR c++/51344
1947         * decl2.c (save_template_attributes): Use merge_attributes
1948         instead of chaining up via TREE_CHAIN.
1950 2012-01-19  Jason Merrill  <jason@redhat.com>
1952         PR c++/51889
1953         * class.c (finish_struct): Call add_method here for function usings.
1954         * semantics.c (finish_member_declaration): Not here.
1956 2012-01-18  Paolo Carlini  <paolo.carlini@oracle.com>
1958         PR c++/51225
1959         * typeck2.c (store_init_value): Within a template guard
1960         cxx_constant_value with require_potential_constant_expression.
1961         * pt.c (convert_nontype_argument): Likewise.
1963 2012-01-16  Jakub Jelinek  <jakub@redhat.com>
1965         PR c++/51854
1966         * mangle.c (write_template_arg_literal): Handle complex.
1968 2012-01-16  Jason Merrill  <jason@redhat.com>
1970         PR c++/51827
1971         * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
1973         PR c++/51868
1974         * typeck.c (build_static_cast_1): Handle bit-fields properly.
1976 2012-01-13  Ian Lance Taylor  <iant@google.com>
1978         PR c++/50012
1979         * typeck.c (enum_cast_to_int): New static function.
1980         (cp_build_binary_op): When handling warn_sign_compare, don't test
1981         for TREE_NO_WARNING.  Do call enum_cast_to_int.
1982         * call.c (avoid_sign_compare_warnings): Remove static function.
1983         (build_new_op_1): Don't call avoid_sign_compare_warnings.
1985 2012-01-13  Steven Bosscher  <steven@gcc.gnu.org>
1987         * decl2.c: Do not include tree-mudflap.h
1988         * semantics.c: Likewise.
1990 2012-01-13  Jason Merrill  <jason@redhat.com>
1992         PR c++/20681
1993         * semantics.c (finish_break_stmt): Avoid adding an unreachable
1994         BREAK_STMT.
1996         PR c++/51813
1997         * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
1998         when reducing the visibility.
2000         PR c++/51620
2001         * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
2003 2012-01-12  Jason Merrill  <jason@redhat.com>
2005         PR c++/51714
2006         * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
2007         value-dependent.
2009 2012-01-13  Dodji Seketeli  <dodji@redhat.com>
2011         PR c++/51633
2012         * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
2013         Set the pointer to the last block of the constructor to the
2014         current statement.
2015         (build_constexpr_constructor_member_initializers): Get
2016         build_data_member_initialization a chance to deal with more
2017         statements before we choke.
2019 2012-01-12  Jason Merrill  <jason@redhat.com>
2021         PR c++/48051
2022         * mangle.c (write_expression): Mangle BASELINK scope if
2023         BASELINK_QUALIFIED_P.
2024         * search.c (adjust_result_of_qualified_name_lookup): Set
2025         BASELINK_QUALIFIED_P.
2026         * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
2027         * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
2028         adjust_result_of_qualified_name_lookup for non-qualified names.
2030         PR c++/51403
2031         * pt.c (unify): Handle error_mark_node.
2033 2012-01-11  Jason Merrill  <jason@redhat.com>
2035         PR c++/51565
2036         * call.c (standard_conversion): For ptrmemfuncs, compare the
2037         static_fn_types.
2039         PR c++/51818
2040         * mangle.c (find_substitution): A type is only a substitution
2041         match if we're looking for a type.
2042         (write_nested_name): Use decl_mangling_context.
2044         * decl.c (decls_match): Assert that the arguments are decls.
2046         PR c++/51613
2047         * pt.c (resolve_overloaded_unification): Compare types with
2048         same_type_p, not decls_match.
2050 2012-01-10  Jason Merrill  <jason@redhat.com>
2052         PR c++/51614
2053         * class.c (build_base_path): Diagnose ambiguous base.
2055         PR c++/51433
2056         * semantics.c (cxx_eval_call_expression): Always retry previously
2057         non-constant expressions.
2059 2012-01-06  Jason Merrill  <jason@redhat.com>
2061         DR 686
2062         PR c++/47450
2063         * parser.c (cp_parser_new_expression): Set
2064         type_definition_forbidden_message.
2066         PR c++/6057
2067         PR c++/48051
2068         PR c++/50855
2069         PR c++/51322
2070         * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
2071         THROW_EXPR, CONSTRUCTOR, OVERLOAD.  Fix PREINCREMENT_EXPR and
2072         PREDECREMENT_EXPR.
2073         (write_template_arg): Fix mangling of class-scope functions and
2074         argument packs.
2075         (mangle_decl): Update suggested -fabi-version argument.
2076         * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
2077         DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
2078         * tree.c (dependent_name): No longer static.
2079         * cp-tree.h: Declare it.
2080         * pt.c (unify): Defer handling of unconverted functions.
2082         * mangle.c (mangle_decl): Don't generate mangling aliases
2083         for maybe-in-charge [cd]tors.
2085         * error.c (dump_expr): Print type of CONSTRUCTOR.
2087 2012-01-05  Dodji Seketeli  <dodji@redhat.com>
2089         PR c++/51541
2090         * parser.c (cp_parser_alias_declaration): Get out early upon
2091         errors in the identifier or the attributes.
2093 2012-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
2095         PR c++/51064
2096         * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
2097         the tree returned by build_x_binary_op.
2099 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
2101         PR c++/51738
2102         * parser.c (cp_parser_postfix_open_square_expression): Handle
2103         postfix-expression [ braced-init-list ].
2105 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
2107         PR c++/29273
2108         * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
2109         call decay_conversion on v.
2111 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
2113         PR c++/15867
2114         * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
2115         declaration followed by specialization.
2117 2012-01-03  Jakub Jelinek  <jakub@redhat.com>
2119         PR c++/51669
2120         * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
2121         on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
2123 2012-01-02  Jason Merrill  <jason@redhat.com>
2125         DR 1359
2126         PR c++/51675
2127         * method.c (walk_field_subobs): Don't check for uninitialized
2128         fields in a union.
2129         (synthesized_method_walk): Check here.
2131         DR 325
2132         PR c++/51666
2133         * parser.c (cp_parser_cache_defarg): Split out...
2134         (cp_parser_parameter_declaration): ...from here.
2135         (cp_parser_save_nsdmi): Use it.
2136         (cp_parser_cache_group): Remove CPP_COMMA support.
2138 2012-01-02  Dodji Seketeli  <dodji@redhat.com>
2140         PR c++/51462
2141         * semantics.c (cx_check_missing_mem_inits): Don't assert in case
2142         of error.
2144 2012-01-02  Paolo Carlini  <paolo.carlini@oracle.com>
2146         PR c++/20140
2147         * typeck2.c (digest_init_r): Use copy_init when initializing
2148         an array of chars.
2150 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
2152         PR c++/16603
2153         * decl.c (build_enumerator): Don't call perform_integral_promotions
2154         on the value.
2156 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
2158         PR c++/51379
2159         * typeck.c (build_reinterpret_cast_1): Implement resolution of
2160         DR 799.
2162 2012-01-01  Fabien Chêne  <fabien@gcc.gnu.org>
2164         * parser.c (cp_parser_using_declaration): Add a warning about
2165         deprecated access declarations when no errors were encountered
2166         while parsing the access declaration. Save the first token in
2167         order to emit the warning at the right place.
2169 Copyright (C) 2012 Free Software Foundation, Inc.
2171 Copying and distribution of this file, with or without modification,
2172 are permitted in any medium without royalty provided the copyright
2173 notice and this notice are preserved.