* cp-tree.h (struct deferred_access_check): Add location.
[official-gcc.git] / gcc / cp / ChangeLog
bloba8b19aec857bc097d35b3c5b0278e3366e234459
1 2012-07-16  Jason Merrill  <jason@redhat.com>
3         * cp-tree.h (struct deferred_access_check): Add location.
4         * semantics.c (perform_access_checks): Use it.
5         (perform_or_defer_access_check): Store it.
7 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
9         * dump.c (dump_stmt): Moved here from c-dump.c.
10         * optimize.c: Include dumpfile.h instead of tree-dump.h.
11         * class.c: Likewise.
12         * decl2.c: Likewise.
13         * Make-lang.in: Fix dependencies.
15 2012-07-13  Jason Merrill  <jason@redhat.com>
17         PR c++/53953
18         * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
20 2012-07-12  Jason Merrill  <jason@redhat.com>
22         * pt.c (instantiate_decl): Check typedefs access here.
23         (instantiate_template_1): Not here.
25         * pt.c (deduction_tsubst_fntype): Just suppress access checking.
26         (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
27         (push_deduction_access_scope, pop_deduction_access_scope): Remove.
29 2012-07-11  Jason Merrill  <jason@redhat.com>
31         DR 1402
32         * method.c (synthesized_method_walk): Replace uses of msg with diag.
33         Correct handling of virtual bases with move operations.
34         (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
36 2012-07-11  Steven Bosscher  <steven@gcc.gnu.org>
38         * method.c: Do not include tree-pass.h.
40 2012-07-10  Jason Merrill  <jason@redhat.com>
42         DR 1402
43         PR c++/53733
44         * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
45         (struct lang_decl_fn): Add suppress_implicit_decl field.
46         * method.c (implicitly_declare_fn): Check it.
47         (process_subob_fn): Add no_implicit_p parm.
48         (walk_field_subobs, synthesized_method_walk): Likewise.
49         (maybe_explain_implicit_delete): Adjust.
50         (explain_implicit_non_constexpr): Adjust.
52         * method.c (synthesized_method_walk): Avoid changing
53         EH spec based on cleanups in other places, too.
55 2012-07-09  Sterling Augustine  <saugustine@google.com>
57         * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
59 2012-07-08  Steven Bosscher  <steven@gcc.gnu.org>
61         * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
63 2012-07-06  Jason Merrill  <jason@redhat.com>
65         PR c++/53862
66         * pt.c (tsubst_arg_types): Add "end" parameter.
67         (check_undeduced_parms): Use it.
69         * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
71         PR c++/53858
72         * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
74 2012-07-05  Jason Merrill  <jason@redhat.com>
76         PR c++/53039
77         * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
78         cp_tree_equal.
80         * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
81         (struct template_parm_index_s): Remove num_siblings.
82         * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
83         (fixup_template_type_parm_type): Remove.
84         (build_template_parm_index): Remove num_siblings parm.
85         (process_template_parm): Likewise.
86         * parser.c (cp_parser_template_parameter_list): Adjust.
87         * tree.c (cp_tree_equal): Don't compare num_siblings.
88         * typeck.c (comp_template_parms_position): Likewise.
90         PR c++/50852
91         PR c++/53039
92         * tree.c (strip_typedefs_expr): New.
93         * cp-tree.h: Declare it.
94         * pt.c (convert_template_argument, unify): Use it.
95         * parser.c (cp_parser_template_declaration_after_export): Don't call
96         fixup_template_parms.
98 2012-07-04  Jason Merrill  <jason@redhat.com>
100         PR c++/53848
101         PR c++/53524
102         * decl.c (build_enumerator): Don't use build_lang_decl_loc.
104 2012-07-03  Jakub Jelinek  <jakub@redhat.com>
106         PR c++/53812
107         * semantics.c (finish_goto_stmt): Surround computed goto argument
108         with CLEANUP_POINT_EXPR if needed.
110 2012-07-02  Jason Merrill  <jason@redhat.com>
112         PR c++/53619
113         * pt.c (in_template_function): New.
114         * cp-tree.h: Declare it.
115         * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
117         PR c++/53783
118         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
119         for LAMBDA_EXPR_EXTRA_SCOPE.
121         PR c++/53788
122         * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
124         PR c++/53816
125         * class.c (resolves_to_fixed_type_p): Check uses_template_parms
126         (current_function_decl) instead of processing_template_decl.
128         PR c++/53821
129         * semantics.c (maybe_add_lambda_conv_op): Don't set
130         DECL_INTERFACE_KNOWN.
132         PR c++/53524
133         * call.c (build_conditional_expr_1): Don't warn about comparison of
134         two enumerators before their enumeration is complete.
135         (build_new_op_1): Call decay_conversion before warn_logical_operator.
136         * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
137         its enumeration.
138         * decl2.c (mark_used): Call used_types_insert for enums.
139         * semantics.c (finish_id_expression): Don't decay CONST_DECL.
140         (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
141         * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
142         * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
143         (build_class_member_access_expr): Look through unscoped enums.
144         * search.c (context_for_name_lookup): Look through unscoped enums.
145         * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
146         (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
147         * tree.c (decl_linkage): Likewise.
148         * cvt.c (ocp_convert): Check decayed expr for enum range warning.
150 2012-06-29  Steven Bosscher  <steven@gcc.gnu.org>
152         * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
154 2012-06-27  Jason Merrill  <jason@redhat.com>
156         * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
157         (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
158         (cp_parser_elaborated_type_specifier): Adjust.
159         * decl.c (duplicate_decls): Return error_mark_node on template
160         mismatch.
162         PR c++/53563
163         * parser.c (cp_parser_template_id): Add tag_type parm.
164         (cp_parser_template_name): Likewise.
165         (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
166         (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
167         (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
168         (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
170 2012-06-27  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
172         PR C++/51033
173         * semantics.c (constexpr_call): Fix typo in comment.
174         (cxx_eval_vec_perm_expr): New.
175         (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
177 2012-06-26  Richard Guenther  <rguenther@suse.de>
179         PR c++/53752
180         * mangle.c (write_array_type): Truncate the number-of-elements
181         result.
183 2012-06-25  Jason Merrill  <jason@redhat.com>
185         PR c++/53498
186         PR c++/53305
187         * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
188         if cp_unevaluated_operand is set.
189         (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
191         PR c++/52988
192         * typeck.c (decay_conversion): Don't discard side-effects from
193         expressions of nullptr_t.
195 2012-06-25  Florian Weimer  <fweimer@redhat.com>
197         * init.c (build_new_1): Warn about (T[N]) for variable N, and
198         reject T[M][N].
200         * parser.c (cp_parser_direct_new_declarator): Accept non-constant
201         expressions.  Handled now in build_new_1.
203 2012-06-25  Jason Merrill  <jason@redhat.com>
205         PR c++/53202
206         * semantics.c (build_data_member_initialization): Always keep
207         initializer for empty base.
208         (cxx_eval_bare_aggregate): Discard it here.
210         PR c++/53565
211         * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
212         (tsubst_expr) [OMP_FOR]: Here, too.
214 2012-06-25  Jakub Jelinek  <jakub@redhat.com>
216         PR c++/53594
217         * class.c (check_bases_and_members): Avoid -Wuninitialized
218         diagnostics for non-static const members or references if they
219         use NSDMI.
221 2012-06-16  Ville Voutilainen  <ville.voutilainen@gmail.com>
223         * parser.c (cp_parser_direct_declarator): Move virt-specifier
224         parsing after late-specified return type parsing.
226 2012-06-14  Jason Merrill  <jason@redhat.com>
228         PR c++/53651
229         * name-lookup.c (constructor_name_p): Don't try to look at the
230         name of a DECLTYPE_TYPE.
232 2012-06-18  Lawrence Crowl  <crowl@google.com>
234         * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
235         to TV_PHASE_OPT_GEN.
237 2012-06-18  Steven Bosscher  <steven@gcc.gnu.org>
239         * decl.c (finish_function): Remove code conditional on VMS_TARGET.
241 2012-06-15  Marc Glisse  <marc.glisse@inria.fr>
243         PR c++/51033
244         * semantics.c (literal_type_p): Handle VECTOR_TYPE.
245         (potential_constant_expression_1): Handle VEC_PERM_EXPR.
246         * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
248 2012-06-09  Jason Merrill  <jason@redhat.com>
250         * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
251         * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
252         * decl2.c (finish_static_data_member_decl): Avoid redundant error.
254         PR c++/53599
255         * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
256         * semantics.c (finish_cond): Build a COMPOUND_EXPR.
257         * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
258         [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
259         Don't return the decl.
261 2012-06-11  Richard Guenther  <rguenther@suse.de>
263         PR c++/53605
264         * mangle.c (write_array_type): Use double-ints for array domain
265         arithmetic.
267 2012-06-07  Fabien ChĂȘne  <fabien@gcc.gnu.org>
269         PR c++/51214
270         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
271         Declare.
272         * class.c (insert_into_classtype_sorted_fields): New.
273         (add_enum_fields_to_record_type): New.
274         (count_fields): Adjust the comment.
275         (add_fields_to_record_type): Likewise.
276         (finish_struct_1): Move the code that inserts the fields for the
277         sorted case, into insert_into_classtype_sorted_fields, and call
278         it.
279         (insert_late_enum_def_into_classtype_sorted_fields): Define.
280         * decl.c (finish_enum_value_list): Call
281         insert_late_enum_def_into_classtype_sorted_fields if a late enum
282         definition is encountered.
284 2012-06-06  Paolo Carlini  <paolo.carlini@oracle.com>
286         PR c++/53567
287         * typeck.c (cp_perform_integral_promotions): New, like
288         perform_integral_promotions but also takes a tsubst_flags_t parameter.
289         (pointer_diff): Add tsubst_flags_t parameter.
290         (decay_conversion, cp_default_conversion, cp_build_array_ref,
291         cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
292         build_reinterpret_cast_1, cp_build_modify_expr,
293         convert_for_assignment): Adjust.
294         * optimize.c (build_delete_destructor_body): Adjust.
295         * init.c (expand_virtual_init, expand_default_init, build_new_1,
296         build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
297         (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
298         * class.c (build_base_path): Adjust.
299         * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
300         * method.c (synthesized_method_walk): Adjust flag and complain.
301         * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
302         (build_typeid, build_dynamic_cast_1): Adjust.
303         * except.c (initialize_handler_parm): Likewise.
304         * typeck2.c (process_init_constructor_record): Likewise.
305         * pt.c (tsubst_friend_class): Don't change flags.
306         * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
307         finish_static_assert): Likewise.
308         * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
309         lookup_name_real.
310         * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
311         (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
312         Adjust.
313         (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
314         (implicit_conversion): Mask out tf_error with a FIXME.
315         (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
316         complain & tf_error instead of flags & LOOKUP_COMPLAIN.
317         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
318         build_up_reference, convert_to_reference, cp_convert,
319         cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
320         parameter.
321         (convert_to_reference, ocp_convert): Use complain & tf_error instead
322         of flags & LOOKUP_COMPLAIN.
323         (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
324         * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
325         lookup_name_real, lookup_function_nonclass, lookup_name,
326         lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
327         * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
329 2012-06-06  Steven Bosscher  <steven@gcc.gnu.org>
331         * decl.c: Do not include output.h.
332         (start_decl): Remove code for flag_conserve_space.
334 2012-06-06  Fabien ChĂȘne  <fabien@gcc.gnu.org>
336         PR c++/52841
337         * parser.c (cp_parser_alias_declaration): Return earlier
338         if an error occured.
340 2012-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
342         PR c++/53524
343         * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
344         to control enumeral mismatch in conditional expression too.
346 2012-06-04   Sterling Augustine  <saugustine@google.com>
348         * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
349         * cp-lang.c (cxx_dwarf_name): Call them.
351 2012-06-04  Steven Bosscher  <steven@gcc.gnu.org>
353         * semantics.c: Do not include output.h.
354         * decl2.c: Likewise.
355         * friend.c: Likewise.
356         * typeck.c: Likewise.
357         * typeck2.c: Likewise.
358         * Make-lang.in: Fix dependencies.
360 2012-06-01  Jason Merrill  <jason@redhat.com>
362         PR c++/52973
363         * parser.c (cp_parser_class_head): Apply attributes here.
364         * semantics.c (begin_class_definition): Not here.
365         * cp-tree.h: Adjust.
367         PR c++/52725
368         * parser.c (cp_parser_binary_expression): Bail early if we're parsing
369         tentatively and the LHS has a parse error.
371         PR c++/53137
372         * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
373         (instantiate_decl): Don't push_to_top_level for local class methods.
374         (instantiate_class_template_1): Or for local classes.
376         PR c++/53484
377         * pt.c (do_auto_deduction): Don't try to deduce from a
378         type-dependent initializer.
380 2012-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
382         PR c++/26155
383         * name-lookup.c (push_namespace): When error recovery is
384         impossible just error out in duplicate_decls.
386 2012-05-31  Steven Bosscher  <steven@gcc.gnu.org>
388         * call.c: Do not include output.h.
389         * class.c: Likewise.
390         * except.c: Likewise.
391         * friend.c: Likewise.
392         * init.c: Likewise.
393         * lex.c: Likewise.
394         * method.c: Likewise.
395         * parser.c: Likewise.
396         * pt.c: Likewise.
397         * rtti.c: Likewise.
398         * search.c: Likewise.
400 2012-05-30  Jason Merrill  <jason@redhat.com>
402         PR c++/53356
403         * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
404         representing a bitwise copy of a glvalue.
406         * tree.c (stabilize_expr): Tweak logic.
408         PR c++/53356
409         * tree.c (stabilize_init): Side effects make the init unstable.
411 2012-05-28  Paolo Carlini  <paolo.carlini@oracle.com>
413         PR c++/53503
414         * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
416 2012-05-26  Paolo Carlini  <paolo.carlini@oracle.com>
418         PR c++/53491
419         * tree.c (stabilize_expr): Handle exp of void type.
421 2012-05-26  Jason Merrill  <jason@redhat.com>
423         PR c++/53220
424         * call.c (convert_like_real) [ck_list]: Take array address directly.
425         * typeck.c (decay_conversion): Reject decay of an array compound
426         literal.
428 2012-05-25  Paolo Carlini  <paolo.carlini@oracle.com>
430         PR c++/32054
431         * parser.c (cp_parser_member_declaration): A storage class is not
432         allowed in a declaration of an anonymous aggregate in a class scope.
434 2012-05-24  Uros Bizjak  <ubizjak@gmail.com>
436         PR obj-c++/53441
437         * decl.c (grokdeclarator): Check that current_class_type is non-NULL
438         before calling constructor_name_p.
440 2012-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
442         PR c++/32080
443         * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
444         cp_parser_function_body): Add a bool parameter, true when parsing
445         a function-try-block.
446         (cp_parser_function_try_block): Pass true to the above.
447         (cp_parser_function_definition_after_declarator,
448         cp_parser_function_transaction): Adjust.
450 2012-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
452         PR c++/29185
453         * decl2.c (delete_sanity): Extend 'deleting array' warning to
454         any array type.
456 2012-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
458         PR c++/51184
459         * decl.c (grokdeclarator): Diagnose functions returning abstract
460         class types as TYPENAME.
461         * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
462         * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
463         * pt.c (tsubst): Likewise.
464         * semantics.c (trait_expr_value): Likewise.
466 2012-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
468         PR c++/40821
469         * parser.c (cp_parser_attributes_opt): Enforce error checking of
470         unbalanced parentheses in the presence of tentative parsing.
472 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
474         PR c++/39681
475         * parser.c (cp_parser_new_type_id): Early return error_mark_node
476         if the cp_parser_type_specifier_seq call has type_specifier_seq.type
477         error_mark_node; tidy.
478         (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
479         avoid uninitialized warnings.
480         (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
481         Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
482         returns error_mark_node.
484 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
486         PR c++/53371
487         * except.c (is_admissible_throw_operand): Rename to
488         is_admissible_throw_operand_or_catch_parameter and handle
489         catch parameter too.
490         (expand_start_catch_block): Use it.
491         (build_throw): Adjust.
493 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
495         PR c++/44516
496         * typeck.c (build_x_array_ref, build_x_conditional_expr,
497         build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
498         (finish_class_member_access_expr, build_x_indirect_ref,
499         build_x_binary_op, build_x_compound_expr_from_list,
500         build_x_compound_expr_from_vec): Adjust callers.
501         * tree.c (build_min_nt_loc): New.
502         (build_min_nt): Remove.
503         * typeck2.c (build_x_arrow): Adjust callers.
504         * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
505         tsubst_copy_and_build): Likewise.
506         * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
507          finish_omp_atomic): Likewise.
508         * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
509         * parser.c (cp_parser_question_colon_clause,
510         cp_parser_assignment_expression, cp_parser_expression,
511         cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
512         * cp-tree.h: Update.
514 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
516         PR preprocessor/7263
517         * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
518         the possible declarator specifiers so far.
519         (struct cp_decl_specifier_seq::locations): Declare new member.
520         (cp_decl_specifier_seq::{specs, type_location}): Remove.
521         (decl_spec_seq_has_spec_p): Declare new function.
522         * parser.c (cp_parser_check_decl_spec): Remove.
523         (set_and_check_decl_spec_loc): Define new static function.
524         (decl_spec_seq_has_spec_p): Define new public function.
525         (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
526         (cp_parser_type_specifier, cp_parser_simple_type_specifier)
527         (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
528         (cp_parser_alias_declaration): Set the locations for each
529         declspec, using set_and_check_decl_spec_loc.
530         (cp_parser_explicit_instantiation, cp_parser_init_declarator)
531         (cp_parser_member_declaration, cp_parser_init_declarator): Use the
532         new declspec location for specifiers.  Use the new
533         decl_spec_seq_has_spec_p.
534         (cp_parser_type_specifier_seq): Use the new
535         set_and_check_decl_spec_loc.  Stop using
536         cp_parser_check_decl_spec.  Use the new decl_spec_seq_has_spec_p.
537         (, cp_parser_init_declarator): Use the new
538         set_and_check_decl_spec_loc.
539         (cp_parser_single_declaration, cp_parser_friend_p)
540         (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
541         Use the new decl_spec_seq_has_spec_p.
542         * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p.  Use
543         the more precise ds_redefined_builtin_type_spec location for
544         diagnostics about re-declaring C++ built-in types.
545         (start_decl, grokvardecl, grokdeclarator): Use the new
546         decl_spec_seq_has_spec_p.
548 2012-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
550         PR c++/11856
551         * pt.c (tsubst_copy_and_build): Increase / decrease
552         c_inhibit_evaluation_warnings around build_x_binary_op call.
554 2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
556         * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
557         (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
558         (TYPE_PTR_OR_PTRMEM_P): Add.
559         * typeck.c (composite_pointer_type_r, composite_pointer_type,
560         common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
561         cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
562         build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
563         casts_away_constness_r, casts_away_constness): Adjust.
564         * init.c (build_zero_init_1): Adjust.
565         * class.c (check_field_decls): Likewise.
566         * decl.c (check_default_argument): Likewise.
567         * rtti.c (target_incomplete_p): Likewise.
568         * tree.c (zero_init_p): Likewise.
569         * cxx-pretty-print.c (pp_cxx_ptr_operator,
570         pp_cxx_abstract_declarator): Likewise.
571         * typeck2.c (build_m_component_ref): Likewise.
572         * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
573         dependent_type_p_r): Likewise.
574         * call.c (null_member_pointer_value_p, standard_conversion,
575         add_builtin_candidate, build_conditional_expr_1, compare_ics):
576         Likewise.
577         * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
578         * cvt.c (cp_convert_to_pointer, ocp_convert,
579         perform_qualification_conversions): Likewise.
580         * mangle.c (write_type): Likewise.
581         * name-lookup.c (arg_assoc_type): Likewise.
583 2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
585         * parser.c (struct cp_parser_expression_stack_entry): Add location_t
586         field.
587         (cp_parser_binary_expression): Rework to always update at the same
588         time tree_type and loc.
589         * call.c (print_z_candidate): Add location_t parameter.
590         (print_z_candidates, convert_like_real, joust): Adjust.
592 2012-05-11  Alexandre Oliva  <aoliva@redhat.com>
594         PR c++/53209
595         * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
597 2012-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
599         PR c++/53305
600         * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
601         tsubst_decl returns NULL_TREE.
602         * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
603         BOUND_TEMPLATE_TEMPLATE_PARM.
605 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
607         PR c++/53158
608         * cvt.c (ocp_convert): Error out early for void -> bool conversions.
609         * typeck.c (decay_conversion): Use error_at.
610         * call.c (build_integral_nontype_arg_conv, convert_like_real,
611         convert_arg_to_ellipsis, perform_implicit_conversion_flags,
612         initialize_reference): Likewise.
613         * cvt.c (warn_ref_binding): Add location_t parameter.
614         (cp_convert_to_pointer, convert_to_reference, ocp_convert,
615         convert_to_void, ): Use error_at and warning_at.
617 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
619         PR c++/53301
620         * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
621         instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
623 2012-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
625         PR c++/53152
626         * call.c (op_error, build_new_op_1, build_new_op): Add location_t
627         parameter.
628         (build_conditional_expr_1): Adjust.
629         * typeck.c (build_x_indirect_ref, build_x_binary_op,
630         build_x_unary_op): Add location_t parameter.
631         (rationalize_conditional_expr, build_x_array_ref,
632         build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
633         Adjust.
634         * typeck2.c (build_x_arrow): Add location_t parameter.
635         * semantics.c (finish_unary_op_expr): Likewise.
636         (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
637         * decl2.c (grok_array_decl): Add location_t parameter.
638         * parser.c (cp_parser_postfix_open_square_expression,
639         cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
640         cp_parser_binary_expression, cp_parser_builtin_offsetof,
641         do_range_for_auto_deduction, cp_convert_range_for,
642         cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
643         location, adjust.
644         * pt.c (tsubst_copy_and_build): Adjust.
645         * tree.c (maybe_dummy_object): Likewise.
646         * cp-tree.h: Update declarations.
648 2012-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
650         * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
652 2012-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
654         PR c++/53166
655         * pt.c (instantiate_class_template_1): Increase / decrease
656         c_inhibit_evaluation_warnings around the tsubst_expr call
657         for STATIC_ASSERT_CONDITION.
658         (tsubst_expr, case STATIC_ASSERT): Likewise.
659         * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
660         c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
662 2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
664         PR c++/53186
665         * call.c (build_over_call): Handle final member functions
666         and class types.
667         (build_new_method_call_1): Do not handle here.
669 2012-05-02  Richard Guenther  <rguenther@suse.de>
671         * decl.c (grokdeclarator): Properly check for sizes that
672         cover more than half of the address-space.
674 2012-04-30  Marc Glisse  <marc.glisse@inria.fr>
676         PR c++/51033
677         * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
678         * decl2.c (grok_array_decl): Likewise.
680         PR c++/51314
681         * parser.c (cp_parser_sizeof_operand): Require parentheses for
682         sizeof...
684 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
686         Fix location for static class members
687         * decl.c (grokdeclarator): Use the location carried by the
688         declarator for the DECL of the static class member.
690         Fix va_arg type location
691         * cp-tree.h (build_x_va_arg): Take an additional location
692         parameter.
693         * call.c (build_x_va_arg): Take a loc parameter for the location
694         of the type of the va_arg expression.
695         * parser.c (cp_parser_primary_expression): Pass the type of the
696         type in the va_arg expression to build_x_va_arg.
697         * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
699         Make conversion warnings work on NULL with -ftrack-macro-expansion
700         * call.c (conversion_null_warnings): Use the new
701         expansion_point_location_if_in_system_header.
702         * cvt.c (build_expr_type_conversion): Likewise.
703         * typeck.c (cp_build_binary_op): Likewise.
705 2012-04-30  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
707         * typeck.c (convert_for_assignment):  Replace
708         Wmissing-format-attribute with Wsuggest-attribute=format.
709         * call.c (convert_for_arg_passing): Likewise.
711 2012-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
713         PR c++/53096
714         * class.c (check_bases_and_members): Implement core/1333, do not
715         disallow defaulted in the class body non-const ref special members.
717 2012-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
719         PR c++/52363
720         * call.c (tourney, perform_overload_resolution,
721         build_operator_new_call, build_user_type_conversion_1,
722         build_user_type_conversion, perform_overload_resolution,
723         add_template_candidate, add_template_candidate_real,
724         add_template_conv_candidate, add_builtin_candidates,
725         add_builtin_candidate, build_builtin_candidate,
726         add_conv_candidate, add_function_candidate, implicit_conversion,
727         reference_binding, build_list_conv, conditional_conversion,
728         add_candidates, can_convert_array, build_aggr_conv,
729         build_array_conv, build_complex_conv, conditional_conversion):
730         Add tsubst_flags_t parameter.
731         (joust): Likewise, use it to handle SFINAE as if pedantic.
732         (add_list_candidates, build_integral_nontype_arg_conv,
733         perform_overload_resolution, build_new_function_call,
734         build_operator_new_call, build_op_call_1,
735         build_conditional_expr_1, build_new_op_1, convert_like_real,
736         convert_arg_to_ellipsis, convert_default_arg,
737         convert_for_arg_passing, build_over_call,
738         build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
739         perform_implicit_conversion_flags,
740         perform_direct_initialization_if_possible,
741         initialize_reference): Adjust.
742         * typeck.c (casts_away_constness, casts_away_constness_r):
743         Add tsubst_flags_t parameter.
744         (convert_arguments, check_for_casting_away_constness,
745         build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
746         Adjust.
747         * decl.c (reshape_init_r, check_default_argument): Likewise.
748         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
749         * pt.c (convert_nontype_argument, check_non_deducible_conversion):
750         Likewise.
751         * init.c (build_new_1): Likewise.
752         * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
753         build_expr_type_conversion, ): Likewise.
754         * search.c (check_final_overrider): Likewise.
755         * cp-tree.h (build_user_type_conversion,
756         build_operator_new_call, can_convert, can_convert_arg,
757         can_convert_arg_bad, convert_default_arg,
758         convert_arg_to_ellipsis, convert_for_arg_passing):
759         Adjust declaration.
761 2012-04-22  Jan Hubicka  <jh@suse.cz>
763         * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
764         gets finalized.
766 2012-04-22  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
768         PR c/44774
769         * typeck.c (composite_pointer_type): Likewise.
770         (cxx_sizeof_or_alignof_type): Likewise.
771         (cp_build_array_ref): Likewise.
772         (cp_build_function_call_vec): Likewise.
773         (cp_build_addr_expr_1): Likewise.
774         (convert_member_func_to_ptr): Likewise.
775         * decl.c (check_tag_decl): Likewise.
776         (check_static_variable_definition): Likewise.
777         (compute_array_index_type): Likewise.
778         (create_array_type_for_decl): Likewise.
779         (grokdeclarator): Likewise.
780         (grok_op_properties): Likewise.
781         * error.c (maybe_warn_cpp0x): Likewise.
782         * pt.c (maybe_process_partial_specialization): Likewise.
783         (convert_template_argument): Likewise.
784         (do_decl_instantiation): Likewise.
785         (do_type_instantiation): Likewise.
786         * parser.c (cp_parser_primary_expression): Likewise.
787         (cp_parser_postfix_expression): Likewise.
788         (cp_parser_unary_expression): Likewise.
789         (cp_parser_question_colon_clause): Likewise.
790         (cp_parser_lambda_introducer): Likewise.
791         (cp_parser_lambda_declarator_opt): Likewise.
792         (cp_parser_compound_statement): Likewise.
793         (cp_parser_jump_statement): Likewise.
794         (cp_parser_declaration_seq_opt): Likewise.
795         (cp_parser_enum_specifier): Likewise.
796         (cp_parser_enumerator_list): Likewise.
797         (cp_parser_initializer_list): Likewise.
798         (cp_parser_member_declaration): Likewise.
799         * call.c (build_conditional_expr_1): Likewise.
800         * friend.c (make_friend_class): Likewise.
801         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
803 2012-04-21  Jan Hubicka  <jh@suse.cz>
805         * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
806         * decl2.c (mark_needed): Likewise.
807         (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
809         * decl2.c (cxx_callgraph_analyze_expr): Remove.
810         * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
811         * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
813 2012-04-21  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
815         PR 35441
816         * typeck.c (cp_build_function_call_vec): Do not pretty-print
817         expressions when caret is enabled.
819 2012-04-20  Jan Hubicka  <jh@suse.cz>
821         PR target/53042
822         * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
823         list when target has no support for it.
825 2012-04-20  Michael Matz  <matz@suse.de>
827         * error.c (pedwarn_cxx98): Move va_end call after user
828         of the va_list.
830 2012-04-18  Paolo Carlini  <paolo.carlini@oracle.com>
832         PR c++/52422
833         * cp-tree.h (build_addr_func, decay_conversion,
834         get_member_function_from_ptrfunc,
835         build_m_component_ref, convert_member_func_to_ptr):
836         Add tsubst_flags_t parameter.
837         * typeck.c (cp_default_conversion): Add.
838         (decay_conversion, default_conversion,
839         get_member_function_from_ptrfunc, convert_member_func_to_ptr):
840         Add tsubst_flags_t parameter and use it throughout.
841         (cp_build_indirect_ref, cp_build_array_ref,
842         cp_build_function_call_vec, convert_arguments, build_x_binary_op,
843         cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
844         build_const_cast_1, expand_ptrmemfunc_cst,
845         convert_for_initialization): Adjust.
846         * init.c (build_vec_init): Adjust.
847         * decl.c (grok_reference_init, get_atexit_node): Likewise.
848         * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
849         * except.c (build_throw): Likewise.
850         * typeck2.c (build_x_arrow): Likewise.
851         (build_m_component_ref): Add tsubst_flags_t parameter and
852         use it throughout.
853         * pt.c (convert_nontype_argument): Adjust.
854         * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
855         * decl2.c (build_offset_ref_call_from_tree): Likewise.
856         * call.c (build_addr_func): Add tsubst_flags_t parameter and
857         use it throughout.
858         (build_call_a, build_conditional_expr_1, build_new_op_1,
859         convert_like_real, convert_arg_to_ellipsis, build_over_call,
860         build_special_member_call): Adjust.
861         * cvt.c (cp_convert_to_pointer, force_rvalue,
862         build_expr_type_conversion): Likewise.
864 2012-04-17  Tom de Vries  <tom@codesourcery.com>
866         * cp-gimplify.c (begin_bc_block): Add location parameter and use as
867         location argument to create_artificial_label.
868         (finish_bc_block): Change return type to void.  Remove body_seq
869         parameter, and add block parameter.  Append label to STMT_LIST and
870         return in block.
871         (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
872         (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
873         (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
874         (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
875         (genericize_break_stmt, genericize_omp_for_stmt): New function.
876         (cp_gimplify_omp_for): Remove bc_continue processing.
877         (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
878         (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
879         CONTINUE_STMT, and BREAK_STMT as unreachable.
880         (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
881         SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
882         (cp_genericize_tree): New function, factored out of ...
883         (cp_genericize): ... this function.
885 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
887         PR c++/52599
888         * semantics.c (build_constexpr_constructor_member_initializers):
889         Check for function-try-block as function-body.
891 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
893         PR c++/53003
894         * parser.c (cp_parser_member_declaration): Check that
895         initializer_token_start is non null before dereferencing it.
897 2012-04-16  Jason Merrill  <jason@redhat.com>
899         PR c++/38543
900         * pt.c (determine_specialization): Instead of comparing the number
901         of parms, check that tsubst gives the right answer.
903         PR c++/52008
904         * pt.c (process_partial_specialization): Complain about a partial
905         specialization with fewer args than primary template parms.
907         PR c++/50830
908         * pt.c (convert_template_argument): Handle template template
909         argument packs.
911         PR c++/50303
912         * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
913         template parameters.
915 2012-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
917         PR c++/49152
918         * call.c (op_error): Print types; when flag_diagnostics_show_caret
919         is false print expressions too.
920         (op_error_string): Add.
922 2012-04-16  Jason Merrill  <jason@redhat.com>
924         PR c++/51148
925         * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
927 2012-04-16  Jan Hubicka  <jh@suse.cz>
929         * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
930         walkers to walk cgraph and varpool.
932 2012-04-15  Jason Merrill  <jason@redhat.com>
934         PR c++/47220
935         * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
937         PR c++/52292
938         PR c++/52380
939         * pt.c (coerce_template_parms): Even if we aren't converting we
940         want to expand argument packs.
942         PR c++/52706
943         * mangle.c (write_type): nullptr_t is a builtin type.
945 2012-04-14  Jan Hubicka  <jh@suse.cz>
947         * tree.c: Update field referenced for new cgraph/varpool layout.
948         * decl2.c: Likewise.
950 2012-04-13  Jason Merrill  <jason@redhat.com>
952         PR c++/52824
953         * pt.c (any_pack_expanson_args_p): New.
954         (coerce_template_parms): Use it.
956         PR c++/52905
957         * call.c (joust): Handle comparing list and non-list ctors.
959         PR c++/52915
960         * decl2.c (finish_anon_union): Use cp_finish_decl.
961         * error.c (dump_function_name): Avoid showing anonymous "name".
963 2012-04-11  Fabien ChĂȘne  <fabien@gcc.gnu.org>
965         PR c++/52465
966         * parser.c (cp_parser_class_name): Call strip_using_decl and
967         return the target decl.
968         * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
969         to be stripped is NULL_TREE.
970         (qualify_lookup): Call strip_using_decl and perform some checks on
971         the target decl.
973 2012-04-11  Jason Merrill  <jason@redhat.com>
975         PR debug/45088
976         * decl.c (grokdeclarator): Strip the injected-class-name typedef
977         if we are building a declaration or compound type.
979         PR c++/52906
980         * decl.c (check_tag_decl): Don't complain about attributes if we
981         don't even have a type.
983 2012-04-10  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
985         * cvt.c (convert_to_void): Update comment.
987 2012-04-05  Jason Merrill  <jason@redhat.com>
989         PR c++/52596
990         * semantics.c (finish_non_static_data_member): In templates, pass
991         the decl to build_qualified_name.
992         * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
994 2012-04-04  Jason Merrill  <jason@redhat.com>
996         PR c++/52845
997         * decl.c (finish_function): Update fntype after deducing return type.
999 2012-04-03  Jason Merrill  <jason@redhat.com>
1001         PR c++/52796
1002         * pt.c (tsubst_initializer_list): A pack expansion with no elements
1003         means value-initialization.
1005 2012-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
1007         PR c++/50043
1008         * class.c (deduce_noexcept_on_destructor,
1009         deduce_noexcept_on_destructors): New.
1010         (check_bases_and_members): Call the latter.
1011         * decl.c (grokfndecl): Call the former.
1012         * method.c (implicitly_declare_fn): Not static.
1013         * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
1014         Declare
1016 2012-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
1018         PR c++/52718
1019         * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
1020         warn for a zero as null pointer constant default argument.
1022 2012-03-29  Jason Merrill  <jason@redhat.com>
1024         PR c++/52685
1025         * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
1027 2012-03-29  Jakub Jelinek  <jakub@redhat.com>
1029         PR c++/52759
1030         * decl.c (start_decl): Don't call maybe_apply_pragma_weak
1031         if processing_template_decl.
1033 2012-03-29  Jason Merrill  <jason@redhat.com>
1035         PR c++/52743
1036         * call.c (compare_ics): Handle ck_aggr like ck_list.
1038 2012-03-28  Jason Merrill  <jason@redhat.com>
1040         PR c++/52746
1041         * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
1042         we didn't get an explicit scope.
1043         * pt.c (tsubst_baselink): Likewise.
1045 2012-03-28  Richard Guenther  <rguenther@suse.de>
1047         * typeck2.c (process_init_constructor_array): Use the proper
1048         type for computing the array length.
1050 2012-03-27  Meador Inge  <meadori@codesourcery.com>
1052         PR c++/52672
1053         * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
1054         stripped child trees that are not pointer types.
1056 2012-03-21  Jason Merrill  <jason@redhat.com>
1058         Implement return type deduction for normal functions with -std=c++1y.
1059         * cp-tree.h (FNDECL_USED_AUTO): New macro.
1060         (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
1061         (dependent_lambda_return_type_node): Remove.
1062         (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
1063         (struct language_function): Add x_auto_return_pattern field.
1064         (current_function_auto_return_pattern): New.
1065         (enum tsubst_flags): Add tf_partial.
1066         * decl.c (decls_match): Handle auto return comparison.
1067         (duplicate_decls): Adjust error message for auto return.
1068         (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
1069         (cp_finish_decl): Don't do auto deduction for functions.
1070         (grokdeclarator): Allow auto return without trailing return type in
1071         C++1y mode.
1072         (check_function_type): Defer checking of deduced return type.
1073         (start_preparsed_function): Set current_function_auto_return_pattern.
1074         (finish_function): Set deduced return type to void if not previously
1075         deduced.
1076         * decl2.c (change_return_type): Handle error_mark_node.
1077         (mark_used): Always instantiate functions with deduced return type.
1078         Complain about use if deduction isn't done.
1079         * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
1080         initial return type.
1081         (cp_parser_lambda_body): Don't deduce return type in a template.
1082         (cp_parser_conversion_type_id): Allow auto in C++1y.
1083         * pt.c (instantiate_class_template_1): Don't mess with
1084         LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
1085         (tsubst_copy_and_build): Likewise.
1086         (fn_type_unification, tsubst): Don't reduce the template parm level
1087         of 'auto' during deduction.
1088         (unify): Compare 'auto' specially.
1089         (get_bindings): Change test.
1090         (always_instantiate_p): Always instantiate functions with deduced
1091         return type.
1092         (do_auto_deduction): Handle error_mark_node and lambda context.
1093         Don't check for use in initializer.
1094         (contains_auto_r): Remove.
1095         * search.c (lookup_conversions_r): Handle auto conversion function.
1096         * semantics.c (lambda_return_type): Handle null return.  Don't mess
1097         with dependent_lambda_return_type_node.
1098         (apply_deduced_return_type): Rename from apply_lambda_return_type.
1099         * typeck.c (merge_types): Handle auto.
1100         (check_return_expr): Do auto deduction.
1101         * typeck2.c (add_exception_specifier): Fix complain check.
1103 2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
1105         PR c++/52487
1106         * class.c (check_field_decls): Call literal_type_p only
1107         on complete types.
1109 2012-03-22  Jakub Jelinek  <jakub@redhat.com>
1111         PR c++/52671
1112         * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
1113         on CLASS_TYPE_P types.
1115 2012-03-20  Jason Merrill  <jason@redhat.com>
1117         * lex.c (init_reswords): Use >= for cxx_dialect test.
1118         * parser.c (cp_parser_exception_specification_opt): Likewise.
1120         * mangle.c (write_type): Handle 'auto'.
1121         * init.c (build_new): Don't do auto deduction where it might
1122         affect template mangling.
1124         PR c++/52510
1125         * decl.c (reshape_init_class): Handle repeated reshaping.
1126         * search.c (lookup_field_1): Add sanity check.
1128 2012-03-19  Paolo Carlini  <paolo.carlini@oracle.com>
1130         PR c++/14710
1131         * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
1132         * tree.c (xvalue_p): Define.
1133         * typeck.c (maybe_warn_about_useless_cast): Define.
1134         (build_reinterpret_cast, build_const_cast,
1135         build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
1136         * rtti.c (build_dynamic_cast): Likewise.
1137         * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
1138         c_inhibit_evaluation_warnings before/after the build_* calls.
1140 2012-03-15  Jason Merrill  <jason@redhat.com>
1142         PR c++/52582
1143         * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
1145 2012-03-15  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
1147         PR c++/44783
1148         * error.c (print_instantiation_partial_context): Use
1149         template_backtrace_limit.
1151 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1153         * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
1155 2012-03-14  Jakub Jelinek  <jakub@redhat.com>
1157         PR c++/52521
1158         * parser.c (lookup_literal_operator): Return fn only if
1159         processed all arguments from args vector and argtypes is
1160         void_list_node.
1162 2012-01-30  Dodji Seketeli  <dodji@redhat.com>
1164         PR c++/51641
1165         * cp-tree.h (template_type_parameter_p): Declare new function.
1166         (parameter_of_template_p): Remove.
1167         * pt.c (template_type_parameter_p): Define new function.
1168         (parameter_of_template_p): Remove.
1169         * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
1170         on parameter_of_template_p anymore.  Compare the level of the
1171         template parameter to the depth of the template.
1173 2011-12-15  Dodji Seketeli  <dodji@redhat.com>
1175         * call.c (standard_conversion, build_integral_nontype_arg_conv)
1176         (build_new_op_1, convert_like_real, is_subseq)
1177         (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
1178         (joust): Use next_conversion instead of accessing fields of struct
1179         conversion directly.
1181 2012-03-12  Paolo Carlini  <paolo.carlini@oracle.com>
1183         PR c++/52299
1184         * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
1185         division by zero warnings.
1187 2012-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
1189         * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
1190         build_ptrmemfunc): Consistently forward the tsubst_flags_t
1191         parameter.
1192         * call.c (resolve_args): Likewise.
1194 2012-03-07  Jason Merrill  <jason@redhat.com>
1196         PR c++/52521
1197         * mangle.c (write_literal_operator_name): The length comes after the
1198         operator prefix.
1200 2012-03-05  Jakub Jelinek  <jakub@redhat.com>
1202         * pt.c (local_specializations): Change from htab_t into
1203         struct pointer_map_t *.
1204         (retrieve_local_specializations, register_local_specialization,
1205         tsubst_pack_expansion, instantiate_decl): Adjust users.
1206         (eq_local_specializations, hash_local_specialization): Remove.
1208 2012-03-05  Jason Merrill  <jason@redhat.com>
1210         PR c++/51930
1211         * decl2.c (determine_visibility): Correct calculation of class
1212         args depth.
1213         * decl.c (check_tag_decl): Adjust warning.
1215         * method.c (synthesized_method_walk): Cleanups don't affect the EH
1216         spec either.
1218 2012-03-03  Jason Merrill  <jason@redhat.com>
1220         * init.c (perform_member_init): Cope with uninstantiated NSDMI.
1222         Core 1270
1223         * call.c (build_aggr_conv): Call reshape_init.
1224         (convert_like_real): Likewise.
1225         * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
1226         not all constant.
1228         * mangle.c (write_nested_name): Use decl_mangling_context.
1229         (write_prefix, write_template_prefix): Likewise.
1231         PR c++/36797
1232         * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
1234         * class.c (add_method): Always build an OVERLOAD for using-decls.
1235         * search.c (lookup_member): Handle getting an OVERLOAD for a
1236         single function.
1238 2012-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
1240         PR c++/51989
1241         * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
1242         propagate it.
1243         * cp-tree.h (build_x_arrow): Adjust prototype.
1244         * pt.c (tsubst_copy_and_build): Adjust call.
1245         * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1247 2012-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
1249         * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
1251 2012-02-29  Jason Merrill  <jason@redhat.com>
1253         PR c++/51930
1254         * decl.c (check_tag_decl): Move warning for misplaced attributes here.
1255         (shadow_tag): From here.
1256         * parser.c (cp_parser_explicit_instantiation): Don't warn here.
1258 2012-02-21  Jakub Jelinek  <jakub@redhat.com>
1260         PR c++/52312
1261         * typeck.c (check_literal_operator_args): Initialize *long_double_p
1262         and *long_long_unsigned_p even if processing_template_decl.
1264 2012-02-16  Jason Merrill  <jason@redhat.com>
1266         PR c++/52248
1267         * decl.c (define_label): Use timevar_cond_start/stop.
1269 2012-02-16  Fabien ChĂȘne  <fabien@gcc.gnu.org>
1271         PR c++/52126
1272         * decl.c (xref_basetypes): call dependent_scope_p instead of
1273         dependent_type_p.
1275 2012-02-16  Jason Merrill  <jason@redhat.com>
1277         PR c++/51415
1278         * error.c (dump_expr): Handle lambda closures specifically.
1280 2012-02-14  Jason Merrill  <jason@redhat.com>
1282         * parser.c (cp_parser_explicit_instantiation): Give a warning
1283         for ignored attributes on explicit class instantiation.
1285 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
1287         PR c++/52247
1288         * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
1289         lookup_label on label's name and set TREE_USED.
1291 2012-02-14  Jason Merrill  <jason@redhat.com>
1293         PR c++/39055
1294         * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
1296 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
1298         PR c/52181
1299         * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
1300         newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
1302 2012-02-07  Jason Merrill  <jason@redhat.com>
1304         PR c++/51675
1305         * semantics.c (cx_check_missing_mem_inits): Handle unions.
1306         Fix constexpr default constructor logic.
1308         PR c++/52035
1309         * pt.c (tsubst): Strip uninstantiated typedef.
1311 2012-02-06  Jason Merrill  <jason@redhat.com>
1313         PR c++/52088
1314         * cvt.c (build_expr_type_conversion): Check for template conversion.
1316 2012-01-31  Jason Merrill  <jason@redhat.com>
1318         PR c++/52043
1319         * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
1320         * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
1321         (tsubst_pack_expansion): Check it.
1323 2012-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
1325         PR c++/51327
1326         * class.c (explain_non_literal_class): Correctly handle implicitly
1327         deleted constructors.
1329 2012-01-27  Jakub Jelinek  <jakub@redhat.com>
1331         PR c++/51852
1332         * pt.c (tsubst_pack_expansion): Delete and restore
1333         local_specialization whenever need_local_specialization, not just
1334         when saved_local_specializations is non-NULL.
1336 2012-01-26  Paolo Carlini  <paolo.carlini@oracle.com>
1338         PR c++/51370
1339         * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
1340         as TREE_OPERAND (t, 1).
1342 2012-01-24  Jason Merrill  <jason@redhat.com>
1344         PR c++/51917
1345         * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
1347         PR c++/51973
1348         * tree.c (called_fns_equal): Check template args.
1349         (cp_tree_equal): Call it.
1351 2012-01-24  Aldy Hernandez  <aldyh@redhat.com>
1352             Patrick Marlier  <patrick.marlier@gmail.com>
1354         PR c++/51928
1355         * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
1356         thunk for set_one_vmethod_tm_attributes.
1358 2012-01-24  Paolo Carlini  <paolo.carlini@oracle.com>
1360         PR c++/51223
1361         * call.c (build_over_call): Check for error_mark_node as
1362         TREE_VALUE when default arguments are processed.
1364 2012-01-23  Jason Merrill  <jason@redhat.com>
1366         PR c++/51930
1367         * decl2.c (determine_visibility): Check for visibility attribute
1368         on template specialization.
1370 2012-01-23  Paolo Carlini  <paolo.carlini@oracle.com>
1372         PR c++/51398
1373         * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
1375 2012-01-23  Jason Merrill  <jason@redhat.com>
1377         PR c++/51925
1378         * class.c (add_method): Set OVL_USED for using-decls.
1379         * tree.c (ovl_scope): New.
1380         * cp-tree.h: Declare it.
1381         * parser.c (cp_parser_template_name): Use it.
1382         * semantics.c (baselink_for_fns): Likewise.
1383         * name-lookup.c (set_inherited_value_binding_p): Likewise.
1385 2012-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
1387         PR c++/51402
1388         * pt.c (lookup_template_class_1): Check context returned by
1389         tsubst for error_mark_node.
1391 2012-01-19  Kai Tietz  <ktietz@redhat.com>
1393         PR c++/51344
1394         * decl2.c (save_template_attributes): Use merge_attributes
1395         instead of chaining up via TREE_CHAIN.
1397 2012-01-19  Jason Merrill  <jason@redhat.com>
1399         PR c++/51889
1400         * class.c (finish_struct): Call add_method here for function usings.
1401         * semantics.c (finish_member_declaration): Not here.
1403 2012-01-18  Paolo Carlini  <paolo.carlini@oracle.com>
1405         PR c++/51225
1406         * typeck2.c (store_init_value): Within a template guard
1407         cxx_constant_value with require_potential_constant_expression.
1408         * pt.c (convert_nontype_argument): Likewise.
1410 2012-01-16  Jakub Jelinek  <jakub@redhat.com>
1412         PR c++/51854
1413         * mangle.c (write_template_arg_literal): Handle complex.
1415 2012-01-16  Jason Merrill  <jason@redhat.com>
1417         PR c++/51827
1418         * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
1420         PR c++/51868
1421         * typeck.c (build_static_cast_1): Handle bit-fields properly.
1423 2012-01-13  Ian Lance Taylor  <iant@google.com>
1425         PR c++/50012
1426         * typeck.c (enum_cast_to_int): New static function.
1427         (cp_build_binary_op): When handling warn_sign_compare, don't test
1428         for TREE_NO_WARNING.  Do call enum_cast_to_int.
1429         * call.c (avoid_sign_compare_warnings): Remove static function.
1430         (build_new_op_1): Don't call avoid_sign_compare_warnings.
1432 2012-01-13  Steven Bosscher  <steven@gcc.gnu.org>
1434         * decl2.c: Do not include tree-mudflap.h
1435         * semantics.c: Likewise.
1437 2012-01-13  Jason Merrill  <jason@redhat.com>
1439         PR c++/20681
1440         * semantics.c (finish_break_stmt): Avoid adding an unreachable
1441         BREAK_STMT.
1443         PR c++/51813
1444         * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
1445         when reducing the visibility.
1447         PR c++/51620
1448         * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
1450 2012-01-12  Jason Merrill  <jason@redhat.com>
1452         PR c++/51714
1453         * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
1454         value-dependent.
1456 2012-01-13  Dodji Seketeli  <dodji@redhat.com>
1458         PR c++/51633
1459         * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
1460         Set the pointer to the last block of the constructor to the
1461         current statement.
1462         (build_constexpr_constructor_member_initializers): Get
1463         build_data_member_initialization a chance to deal with more
1464         statements before we choke.
1466 2012-01-12  Jason Merrill  <jason@redhat.com>
1468         PR c++/48051
1469         * mangle.c (write_expression): Mangle BASELINK scope if
1470         BASELINK_QUALIFIED_P.
1471         * search.c (adjust_result_of_qualified_name_lookup): Set
1472         BASELINK_QUALIFIED_P.
1473         * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
1474         * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
1475         adjust_result_of_qualified_name_lookup for non-qualified names.
1477         PR c++/51403
1478         * pt.c (unify): Handle error_mark_node.
1480 2012-01-11  Jason Merrill  <jason@redhat.com>
1482         PR c++/51565
1483         * call.c (standard_conversion): For ptrmemfuncs, compare the
1484         static_fn_types.
1486         PR c++/51818
1487         * mangle.c (find_substitution): A type is only a substitution
1488         match if we're looking for a type.
1489         (write_nested_name): Use decl_mangling_context.
1491         * decl.c (decls_match): Assert that the arguments are decls.
1493         PR c++/51613
1494         * pt.c (resolve_overloaded_unification): Compare types with
1495         same_type_p, not decls_match.
1497 2012-01-10  Jason Merrill  <jason@redhat.com>
1499         PR c++/51614
1500         * class.c (build_base_path): Diagnose ambiguous base.
1502         PR c++/51433
1503         * semantics.c (cxx_eval_call_expression): Always retry previously
1504         non-constant expressions.
1506 2012-01-06  Jason Merrill  <jason@redhat.com>
1508         DR 686
1509         PR c++/47450
1510         * parser.c (cp_parser_new_expression): Set
1511         type_definition_forbidden_message.
1513         PR c++/6057
1514         PR c++/48051
1515         PR c++/50855
1516         PR c++/51322
1517         * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
1518         THROW_EXPR, CONSTRUCTOR, OVERLOAD.  Fix PREINCREMENT_EXPR and
1519         PREDECREMENT_EXPR.
1520         (write_template_arg): Fix mangling of class-scope functions and
1521         argument packs.
1522         (mangle_decl): Update suggested -fabi-version argument.
1523         * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
1524         DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
1525         * tree.c (dependent_name): No longer static.
1526         * cp-tree.h: Declare it.
1527         * pt.c (unify): Defer handling of unconverted functions.
1529         * mangle.c (mangle_decl): Don't generate mangling aliases
1530         for maybe-in-charge [cd]tors.
1532         * error.c (dump_expr): Print type of CONSTRUCTOR.
1534 2012-01-05  Dodji Seketeli  <dodji@redhat.com>
1536         PR c++/51541
1537         * parser.c (cp_parser_alias_declaration): Get out early upon
1538         errors in the identifier or the attributes.
1540 2012-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
1542         PR c++/51064
1543         * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
1544         the tree returned by build_x_binary_op.
1546 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1548         PR c++/51738
1549         * parser.c (cp_parser_postfix_open_square_expression): Handle
1550         postfix-expression [ braced-init-list ].
1552 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1554         PR c++/29273
1555         * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
1556         call decay_conversion on v.
1558 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1560         PR c++/15867
1561         * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
1562         declaration followed by specialization.
1564 2012-01-03  Jakub Jelinek  <jakub@redhat.com>
1566         PR c++/51669
1567         * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
1568         on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
1570 2012-01-02  Jason Merrill  <jason@redhat.com>
1572         DR 1359
1573         PR c++/51675
1574         * method.c (walk_field_subobs): Don't check for uninitialized
1575         fields in a union.
1576         (synthesized_method_walk): Check here.
1578         DR 325
1579         PR c++/51666
1580         * parser.c (cp_parser_cache_defarg): Split out...
1581         (cp_parser_parameter_declaration): ...from here.
1582         (cp_parser_save_nsdmi): Use it.
1583         (cp_parser_cache_group): Remove CPP_COMMA support.
1585 2012-01-02  Dodji Seketeli  <dodji@redhat.com>
1587         PR c++/51462
1588         * semantics.c (cx_check_missing_mem_inits): Don't assert in case
1589         of error.
1591 2012-01-02  Paolo Carlini  <paolo.carlini@oracle.com>
1593         PR c++/20140
1594         * typeck2.c (digest_init_r): Use copy_init when initializing
1595         an array of chars.
1597 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
1599         PR c++/16603
1600         * decl.c (build_enumerator): Don't call perform_integral_promotions
1601         on the value.
1603 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
1605         PR c++/51379
1606         * typeck.c (build_reinterpret_cast_1): Implement resolution of
1607         DR 799.
1609 2012-01-01  Fabien ChĂȘne  <fabien@gcc.gnu.org>
1611         * parser.c (cp_parser_using_declaration): Add a warning about
1612         deprecated access declarations when no errors were encountered
1613         while parsing the access declaration. Save the first token in
1614         order to emit the warning at the right place.
1616 Copyright (C) 2012 Free Software Foundation, Inc.
1618 Copying and distribution of this file, with or without modification,
1619 are permitted in any medium without royalty provided the copyright
1620 notice and this notice are preserved.