gcc/cp:
[official-gcc.git] / gcc / cp / ChangeLog
blobbd82693722cfae4669bb1fa8f58fc82ccf6e779c
1 2013-06-25  Ed Smith-Rowland  <3dw4rd@verizon.net>
3         PR c++/57640
4         * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
5         to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
7 2013-06-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
9         * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
10         * class.c (add_implicitly_declared_members): Likewise.
11         (check_field_decl): Likewise.
12         (finalize_literal_type_property): Likewise.
13         (check_bases_and_members): Likewise.
14         * decl.c (poplevel): Likewise.
15         (case_conversion): Likewise.
16         (check_initializer): Likewise.
17         (grokfndecl): Likewise.
18         (check_static_variable_definition): Likewise.
19         (compute_array_index_type): Likewise.
20         (grokdeclarator): Likewise.
21         (build_enumerator): Likewise.
22         * friend.c (make_friend_class): Likewise.
23         * lex.c (init_reswords): Likewise.
24         * method.c (synthesized_method_walk): Likewise.
25         (implicitly_declare_fn): Likewise.
26         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
27         (cp_parser_constant_expression): Likewise.
28         (cp_parser_for_init_statement): Likewise.
29         (cp_parser_block_declaration): Likewise.
30         (cp_parser_type_name): Likewise.
31         (cp_parser_enum_specifier): Likewise.
32         (cp_parser_enumerator_list): Likewise.
33         (cp_parser_member_declaration): Likewise.
34         (cp_nth_tokens_can_be_std_attribute_p): Likewise.
35         (cp_parser_template_declaration_after_export): Likewise.
36         * pt.c (convert_nontype_argument_function): Likewise.
37         (convert_nontype_argument): Likewise.
38         (convert_template_argument): Likewise.
39         (tsubst_copy_and_build): Likewise.
40         (build_non_dependent_expr): Likewise.
41         * semantics.c (non_const_var_error): Likewise.
42         (potential_constant_expression_1): Likewise.
43         * tree.c (lvalue_kind): Likewise.
44         (build_vec_init_expr): Likewise.
45         (cast_valid_in_integral_constant_expression_p): Likewise.
46         * typeck.c (build_x_conditional_expr): Likewise.
47         * typeck2.c (check_narrowing): Likewise.
49 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
51         * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
52         (expand_an_in_modify_expr): Changed a function call from the above
53         removed function to length_mismatch_in_expr_p.
55 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
57         * call.c (convert_like_real): Added a check if array notation is present
58         in expression.  If so, then no conversion of arguments is necessary.
59         (build_over_call): Likewise.
60         * typeck.c (cp_build_function_call_vec): Likewise.
61         (convert_for_assignment): Likewise.
62         (cp_build_array_ref): Reject array notations with a rank greater than 1
63         as an array's index.
64         (cp_build_binary_op): If array notations are preent in op, then call
65         find_correct_array_notation_type.
66         (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
67         * cp-array-notation.c: New file.
68         * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
69         as typed.
70         * cp-tree.h (fix_array_notation_exprs): New prototype.
71         * semantics.c (finish_return_stmt): Reject array notations as
72         return value.
73         (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
74         (potential_constant_expression_1): Likewise.
75         * tree.c (lvalue_kind): Likewise.
76         * error.c (dump_decl): Likewise.
77         (dump_expr): Likewise.
78         * pt.c (ARRAY_NOTATION_REF): Likewise.
79         (type_unification_real): Do not unify any arguments if array notations
80         are found in arg.
81         (instantiate_decl): Added a check for array notaitons inside the
82         function body.  If so, then expand them.
83         * parser.c (cp_parser_array_notation): New function.
84         (cp_parser_postfix_open_square_expression): Added a check for colons
85         inside square braces.  If found, then handle the array access as an
86         array notation access.  Also, disable auto-correction from a single
87         colon to scope when Cilk Plus is enabled.
88         (cp_parser_compound_statement): Added a check for array notations
89         inside the statement.  If found, then expand them.
90         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
91         (cp_parser_function_definition_after_declarator): Likewise.
92         (cp_parser_selection_statement): Searched for array notations inside
93         condition.  If so, then emit an error.
94         (cp_parser_iteration_statement): Likewise.
95         (cp_parser_direct_declarator): Reject array notations inside a
96         variable or array declaration.
97         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
99 2013-06-20  Jason Merrill  <jason@redhat.com>
101         PR c++/55149
102         * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
103         context if we're in C++14 mode.
104         * tree.c (array_of_runtime_bound_p): Return true for a dependent
105         bound that is not potentually constant.
106         * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
107         * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
108         * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
109         (build_capture_proxy): Set REFERENCE_VLA_OK.
110         (vla_capture_type): Make it a proper C++ class.
111         (add_capture): Set DECL_VLA_CAPTURE_P.  Don't pre-digest the
112         initializer.
114         * decl.c (compute_array_index_type): Use size_one_node.
116         * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
117         a partial specialization.
118         (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
119         specialization.
120         (most_specialized_class): Adjust.
122         * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
123         (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
124         TEMPLATE_DECL_CHECK.
126 2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
128         PR c++/57638
129         * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
130         TREE_TYPE (arg), not arg itself.
132 2013-06-18  Paolo Carlini  <paolo.carlini@oracle.com>
134         PR c++/53211
135         * pt.c (type_dependent_expression_p): Handle an array of unknown
136         bound depending on a variadic parameter.
137         * parser.c (cp_parser_range_for): Revert PR56794 changes.
139 2013-06-17  Richard Biener  <rguenther@suse.de>
141         * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
143 2013-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
145         PR c++/16128
146         * parser.c (cp_parser_expression_statement): Check whether
147         cp_parser_expression returns error_mark_node.
149 2013-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
151         PR c++/51413
152         * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
154 2013-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
156         PR c++/57599
157         * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
158         accessible base simply forward to build_static_cast.
160 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
162         PR c++/38958
163         * decl.c (poplevel): For the benefit of -Wunused-variable see
164         through references.
166 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
168         * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
170 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
172         PR c++/42021
173         * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
174         again diagnostic already emitted by cp_parser_lookup_name.
176 2013-06-11  Jan Hubicka  <jh@suse.cz>
178         PR c++/57551
179         * cp/pt.c (mark_decl_instantiated): Do not export explicit
180         instantiations of anonymous namespace templates.
182 2013-06-10  Jason Merrill  <jason@redhat.com>
184         * name-lookup.c (add_decl_to_level): Add decls in an anonymous
185         namespace to static_decls.
187 2013-06-07  Sriraman Tallam  <tmsriram@google.com>
189         PR c++/57548
190         * call.c (build_over_call):  Check if current_function_decl is
191         NULL.
193 2013-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
195         PR c++/53658
196         * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
197         not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
199 2013-06-06  Jason Merrill  <jason@redhat.com>
201         PR c++/55520
202         * semantics.c (add_capture): Diagnose capture of variable-size
203         type that is not a C++1y array of runtime bound.
205         * decl.c (grokdeclarator): Keep a decl with error type.
206         (grokfield, grokbitfield): Likewise.
207         * pt.c (instantiate_class_template_1): Likewise.
208         (tsubst_decl): Drop redundant error.
209         * class.c (walk_subobject_offsets): Handle erroneous fields.
210         * typeck2.c (process_init_constructor_record): Likewise.
212 2013-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
214         PR c++/51908
215         * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
216         parser->in_type_id_in_expr_p before calling cp_parser_type_id.
218 2013-06-03  Jan Hubicka  <jh@suse.cz>
220         * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
221         mark_decl_referenced.
222         (mark_needed): Likewise.
224 2013-06-03  Jason Merrill  <jason@redhat.com>
226         * class.c (mark_type_abi_tags): New.
227         (check_abi_tags): Use it.
229 2013-06-03  Paolo Carlini  <paolo.carlini@oracle.com>
231         PR c++/57419
232         * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
233         * semantics.c (finish_qualified_id_expr): Use it.
234         * cp-tree.h: Update.
236 2013-06-01  Jan Hubicka  <jh@suse.cz>
238         * decl2.c (cp_write_global_declarations): Replace same_body_alias
239         by symbol.cpp_implicit_alias.
241 2013-05-30  Jason Merrill  <jason@redhat.com>
243         PR c++/57404
244         * cp-lang.c (cp_classify_record): Handle structs without
245         TYPE_LANG_SPECIFIC.
247         PR c++/52377
248         * class.c (common_enclosing_class): New.
249         * cp-tree.h: Declare it.
250         * init.c (sort_mem_initializers): Don't splice out a union member
251         with an NSDMI.
253 2013-05-29  Jan Hubicka  <jh@suse.cz>
255         * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
256         * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
258 2013-05-25  Paolo Carlini  <paolo.carlini@oracle.com>
260         PR c++/25666
261         * decl2.c (check_classfn): Check for destructors declared as member
262         templates.
264 2013-05-24  Jason Merrill  <jason@redhat.com>
266         PR c++/56971
267         * pt.c (any_template_arguments_need_structural_equality_p): A
268         TEMPLATE_TEMPLATE_PARM can require structural type comparison.
270 2013-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
272         PR c++/19618
273         * class.c (check_bitfield_decl): Warn for bool and enum bitfields
274         with width exceeding the type.
276 2013-05-24  Jason Merrill  <jason@redhat.com>
278         PR c++/57391
279         * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
280         (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
282 2013-05-23  Jason Merrill  <jason@redhat.com>
284         PR c++/57388
285         * tree.c (build_ref_qualified_type): Clear
286         FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
288 2013-05-22  Jason Merrill  <jason@redhat.com>
290         PR c++/56930
291         * call.c (convert_like_real): Use cp_convert_and_check.
292         * cvt.c (cp_convert_and_check): Use maybe_constant_value.
293         * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
294         (potential_constant_expression_1): Handle OMP_ATOMIC*.
296         PR c++/56915
297         * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
298         isn't defined.
300 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
302         PR c++/57352
303         * parser.c (cp_parser_conversion_type_id): Set up
304         parser->type_definition_forbidden_message before calling
305         cp_parser_type_specifier_seq.
307 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
309         PR c++/57211
310         * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
311         warnings about defaulted functions.
313 2013-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
315         * call.c (build_conditional_expr_1): Add location_t parameter.
316         (build_conditional_expr): Likewise.
317         * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
318         get_member_function_from_ptrfunc, build_x_conditional_expr,
319         cp_build_modify_expr): Update.
320         * init.c (build_new_1): Likewise.
321         * cp-tree.h: Update declaration.
323 2013-05-20  Jason Merrill  <jason@redhat.com>
325         PR c++/57016
326         * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
327         if there is one.
329         PR c++/57102
330         * decl.c (fndecl_declared_return_type): Also look in
331         DECL_SAVED_FUNCTION_DATA.
333 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
335         PR c++/12288
336         * parser.c (cp_parser_parameter_declaration): Check return value
337         of cp_parser_parse_and_diagnose_invalid_type_name.
339 2013-05-20  Jason Merrill  <jason@redhat.com>
341         PR c++/57319
342         * class.c (vbase_has_user_provided_move_assign): New.
343         * method.c (synthesized_method_walk): Check it.
344         * cp-tree.h: Declare it.
346         PR c++/57325
347         * tree.c (build_cplus_array_type): Copy layout info if element
348         type is complete.
350 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
352         PR c++/23608
353         * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
355 2013-05-20  Jason Merrill  <jason@redhat.com>
357         PR c++/57317
358         * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
359         whether a template has its own args.
361 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
363         PR c++/57327
364         * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
366 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
368         PR c++/10207
369         * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
370         instead of cp_parser_initializer_list for compound-literals.
372 2013-05-20  Marc Glisse  <marc.glisse@inria.fr>
374         PR c++/57175
375         * typeck.c (check_return_expr): Reverse the alignment comparison.
377 2013-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
379         PR c++/18126
380         * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
381         correctly sizeof compound-literal; update comments.
383 2013-05-16  Marc Glisse  <marc.glisse@inria.fr>
385         * call.c (build_conditional_expr_1): Use cp_build_binary_op
386         instead of directly calling fold_build2.
388 2013-05-16  Jason Merrill  <jason@redhat.com>
390         * Make-lang.in (cc1plus$(exeext)): Use link mutex.
392         PR c++/57279
393         * decl.c (grokdeclarator): Allow member function qualifiers in
394         TYPENAME context in C++11 mode.
396 2013-05-16  Dodji Seketeli  <dodji@redhat.com>
398         PR c++/56782 - Regression with empty pack expansions
399         * pt.c (use_pack_expansion_extra_args_p): When at least a
400         parameter pack has an empty argument pack, and another parameter
401         pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
402         mechanism.
404 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
406         * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
407         warning_at and permerror with warning_at/inform and permerror/
408         inform, respectively.
410 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
412         PR c++/31952
413         * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
414         redeclarations.
416 2013-05-14  Jason Merrill  <jason@redhat.com>
418         PR c++/57243
419         * parser.c (cp_parser_range_for): Call complete_type.
421         PR c++/57041
422         * pt.c (tsubst_copy_and_build): Don't recur into a designator.
424 2013-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
426         PR c++/53903
427         * method.c (defaulted_late_check): Check for compatible exception
428         specification out of class explicitly defaulted functions too.
430 2013-05-14  Jason Merrill  <jason@redhat.com>
432         PR c++/56998
433         * semantics.c (potential_constant_expression_1): Make sure the
434         called function is potentially constant.
435         * call.c (null_ptr_cst_p): Revert earlier change.
437 2013-05-13  Jason Merrill  <jason@redhat.com>
439         PR c++/56998
440         * call.c (null_ptr_cst_p): An expression with side-effects can't
441         be a C++03 null pointer constant.
443         PR c++/57041
444         * decl.c (reshape_init_class): Handle error_mark_node.
446         PR c++/57254
447         * typeck.c (merge_types): Propagate ref-qualifier
448         in METHOD_TYPE case.
450         PR c++/57253
451         * decl.c (grokdeclarator): Apply ref-qualifier
452         in the TYPENAME case.
454         PR c++/57252
455         * decl.c (decls_match): Compare ref-qualifiers.
457 2013-05-10  Jason Merrill  <jason@redhat.com>
459         PR c++/57196
460         * pt.c (convert_template_argument): Use dependent_template_arg_p,
461         not uses_template_parms.
463         PR c++/57047
464         * semantics.c (cxx_fold_indirect_ref): Fix thinko.
466         PR c++/55149
467         * semantics.c (add_capture): Error rather than abort on copy
468         capture of VLA.
469         * typeck.c (maybe_warn_about_returning_address_of_local): Don't
470         warn about capture proxy.
472 2013-05-09  Jason Merrill  <jason@redhat.com>
474         * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
476         PR c++/57222
477         * pt.c (lookup_template_class_1): Handle getting a template
478         template parameter as D1.
480         N3639 C++1y VLA diagnostics
481         * decl.c (grokdeclarator): Complain about reference, pointer, or
482         typedef to VLA.
483         (create_array_type_for_decl): Complain about array of VLA.
484         * pt.c (tsubst): Likewise.
485         * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
486         * semantics.c (finish_decltype_type): Complain about decltype of VLA.
487         * typeck.c (cp_build_addr_expr_1): Complain about VLA.
488         (cxx_sizeof_or_alignof_type): Likewise.
490         N3639 C++1y VLA support
491         * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
492         (check_array_initializer): Allow VLA init.
493         (reshape_init_array_1): Adjust.
494         (cp_finish_decl): Check for invalid VLA length.
495         * typeck2.c (process_init_constructor_array): Adjust.
496         (store_init_value): Use build_vec_init for VLAs.
497         * semantics.c (add_capture): Capture VLA as ptr+len.
498         (vla_capture_type): New.
499         (build_capture_proxy): Rebuild the VLA.
500         * typeck.c (build_simple_component_ref): Split out from...
501         (build_ptrmemfunc_access_expr): ...here.
502         * tree.c (array_of_runtime_bound_p): New.
503         * init.c (throw_bad_array_length): New.
504         (build_vec_init): Use it.
505         * parser.c (cp_convert_range_for): When iterating over a VLA,
506         use it directly rather than bind a reference.
507         * cp-tree.h: Declare new functions.
509 2013-05-08  Jason Merrill  <jason@redhat.com>
511         * except.c (is_admissible_throw_operand_or_catch_parameter): Check
512         variably_modified_type_p.
513         (expand_start_catch_block): Mark the typeinfo used here.
514         * semantics.c (finish_handler_parms): Not here.
516         * error.c (dump_type_suffix): Try harder on VLA length.
518         Core 624/N2932
519         * init.c (throw_bad_array_new_length): New.
520         (build_new_1): Use it.  Don't warn about braced-init-list.
521         (build_vec_init): Use it.
522         * call.c (build_operator_new_call): Use it.
524         PR c++/57068
525         * decl.c (grokdeclarator): Warn about ref-qualifiers here.
526         * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
527         * error.c (maybe_warn_cpp0x): s/0x/11/.
529 2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
531         PR c++/51226
532         * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
533         == error_mark_node.
535 2013-05-06  Marc Glisse  <marc.glisse@inria.fr>
537         * typeck.c (cp_build_binary_op): Call save_expr before
538         build_vector_from_val.
540 2013-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
542         PR c++/57183
543         * decl.c (cp_finish_decl): After do_auto_deduction copy the
544         qualifers with cp_apply_type_quals_to_decl.
546 2013-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
548         * pt.c (convert_nontype_argument): Add missing whitespace in
549         error message.
551 2013-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
553         PR c++/53745
554         * decl.c (build_enumerator): Improve error message.
556 2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
558         PR c++/14283
559         * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
560         messages for template types and fix column numbers.
562 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
564         PR c++/57132
565         * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
566         c_inhibit_evaluation_warnings around build_x_modify_expr call.
568 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
570         PR c++/57092
571         * semantics.c (finish_decltype_type): Handle instantiated template
572         non-type arguments.
574 2013-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
576         PR c++/56450
577         * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
579 2013-04-26  Jakub Jelinek  <jakub@redhat.com>
581         * error.c (cp_print_error_function): Adjust file_name_as_prefix
582         caller.
584 2013-04-25  Jason Merrill  <jason@redhat.com>
586         PR c++/56859
587         * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
589         PR c++/50261
590         * init.c (perform_member_init): Call reshape_init.
592 2013-04-24  Jason Merrill  <jason@redhat.com>
594         PR c++/53721
595         * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
597 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
599         * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
600         pedwarn to simply use OPT_Wpointer_arith.
601         (cp_build_unary_op): Likewise.
603 2013-04-24  Jason Merrill  <jason@redhat.com>
605         N3648: init-captures are named.
606         * semantics.c (add_capture): Don't prepend "__" to init-captures.
607         (build_capture_proxy): Adjust.
608         * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
610         N3648: Allow braced and parenthesized initializers.
611         * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
612         * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
613         * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
614         (add_capture): Collapse a parenthesized initializer into a single
615         expression.
616         * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
618 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
620         PR c++/56970
621         * init.c (build_offset_ref): Add tsubst_flags_t parameter.
622         * semantics.c (finish_qualified_id_expr): Likewise.
623         (finish_id_expression): Update.
624         * typeck.c (cp_build_addr_expr_1): Likewise.
625         * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
626         * cp-tree.h: Update declarations.
628 2013-04-22  Jason Merrill  <jason@redhat.com>
630         Core 1586
631         * parser.c (cp_parser_unqualified_id): Handle ~auto.
632         (cp_parser_pseudo_destructor_name): Likewise.
633         (cp_parser_postfix_dot_deref_expression): Adjust.
634         (cp_lexer_nth_token_is_keyword): New.
635         * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
636         * typeck.c (lookup_destructor): Handle ~auto.
638         * pt.c (fn_type_unification): Push tinst level around
639         type_unification_real if we aren't explaining.
640         * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
641         * error.c (dump_function_decl): Respect it.
642         (subst_to_string): Pass it.
644         PR c++/48665
645         * rtti.c (get_typeid): Diagnose qualified function type.
646         * pt.c (tsubst) [POINTER_TYPE]: Likewise.
648         * error.c (dump_aggr_type): Fix lambda detection.
649         (dump_simple_decl): Pretty-print capture field.
651         N3323
652         * cvt.c (build_expr_type_conversion): Two conversions that return
653         the same type aren't necessarily ambiguous.
655         N3648
656         * parser.c (cp_parser_lambda_introducer): Make lambda capture init
657         pedwarn unconditional except in C++1y mode.
659         * semantics.c (potential_constant_expression_1): Don't crash on
660         'this' in NSDMI.
662         Core 1612
663         * semantics.c (finish_id_expression): Reject capture of anonymous
664         union member.
666         Core 1609
667         * decl2.c (check_default_args): Check for pack expansion.
669         * mangle.c (write_type): Mangle decltype(auto).
671 2013-04-19  Jason Merrill  <jason@redhat.com>
673         N3638 changes to return type deduction
674         * decl.c (undeduced_auto_decl): New.
675         (require_deduced_type): New.
676         (fndecl_declared_return_type): New.
677         (decls_match): Use it.
678         (duplicate_decls): Don't check for auto return.
679         (grokdeclarator): Reject virtual auto.
680         * class.c (resolve_address_of_overloaded_function): Handle
681         auto function templates.
682         * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
683         * cp-tree.h: Declare new fns.
684         * error.c (dump_function_decl): Use fndecl_declared_return_type.
685         * search.c (check_final_overrider): Likewise.
686         * pt.c (make_decltype_auto): New.
687         (do_auto_deduction): Require plain decltype(auto).
688         (is_auto): Adjust.
690         DR 941
691         * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
692         template specializations.
694 2013-04-16  Ed Smith-Rowland  <3dw4rd@verizon.net>
696         Implement n3599 - Literal operator templates for strings.
697         * parser.c (make_string_pack (tree value)): New function.
698         (cp_parser_userdef_string_literal (cp_token *)): Use it
699         to construct calls to character string literal operator templates.
700         (cp_parser_template_declaration_after_export): Check for new string
701         literal operator template parameter form.
703 2013-04-15  Jason Merrill  <jason@redhat.com>
705         * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
707         PR c++/52748
708         * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
709         rather than a destructor name, it isn't an unqualified-name.
710         (tsubst_copy_and_build): Pass down decltype_flag to operator
711         handling code, too.
713         PR c++/56388
714         * semantics.c (insert_capture_proxy): Just use index 1 in the
715         stmt_list_stack.
717 2013-04-12  Jakub Jelinek  <jakub@redhat.com>
719         * error.c (cp_print_error_function,
720         print_instantiation_partial_context_line,
721         maybe_print_constexpr_context): Colorize locus strings.
723 2013-04-11  Jason Merrill  <jason@redhat.com>
725         PR c++/52748
726         * parser.c (complain_flags): New.
727         (cp_parser_postfix_expression): Use it.
728         (cp_parser_unary_expression): Likewise.
729         (cp_parser_binary_expression): Likewise.
730         (cp_parser_assignment_expression): Likewise.
731         (cp_parser_expression): Likewise.
732         (cp_parser_postfix_open_square_expression): Take decltype_p.
733         (cp_parser_builtin_offsetof): Adjust.
734         (cp_convert_range_for): Pass complain to finish_unary_op_expr.
735         * decl2.c (grok_array_decl): Add decltype_p parm.
736         * cp-tree.h: Adjust prototype.
737         * semantics.c (finish_unary_op_expr): Add complain parm.
739 2013-04-11  Jakub Jelinek  <jakub@redhat.com>
741         PR c++/56895
742         * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
743         calling maybe_constant_value for C++98.
745 2013-04-11  Jason Merrill  <jason@redhat.com>
747         PR c++/56901
748         * semantics.c (lambda_capture_field_type, lambda_proxy_type):
749         Strip references before checking WILDCARD_TYPE_P.
751 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
753         * call.c (build_conditional_expr_1, build_over_call): Protect
754         error calls with complain & tf_error.
755         * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
756         build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
757         build_ptrmemfunc): Likewise.
758         (lookup_destructor): Take tsubst_flags_t parameter, adjust.
760         * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
761         (convert_to_reference): Adjust.
763 2013-04-11  Jason Merrill  <jason@redhat.com>
765         * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
766         local variables, look them up instead.
767         (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
768         proxies and substitution in unevaluated context.
769         (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
770         before the iterators.
772         PR c++/23055
773         * pt.c (uses_deducible_template_parms): New.
774         (deducible_array_bound, deducible_expression): New.
775         (deducible_template_args): New.
776         (unify_one_argument): Call uses_deducible_template_parms.
778 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
780         PR c++/56913
781         * typeck2.c (build_m_component_ref): Protect error calls with
782         (complain & tf_error).
784 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
786         PR c++/54216
787         * parser.c (cp_parser_enum_specifier): Check for empty
788         anonymous enums and anonymous scoped enums.
790 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
792         PR c++/56895
793         * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
794         first before calling maybe_constant_value for warn_for_div_by_zero
795         or invalid shift count warning purposes.
797 2013-04-09  Jason Merrill  <jason@redhat.com>
799         PR c++/25466
800         * rtti.c (build_typeid): Check the address of the argument
801         rather than looking for an INDIRECT_REF.
803 2013-04-04  Jason Merrill  <jason@redhat.com>
805         PR c++/56838
806         PR c++/17232
807         * typeck2.c (abstract_virtuals_error_sfinae): Disable
808         complete_type again.
810 2013-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
812         PR c++/56871
813         * decl.c (validate_constexpr_redeclaration): Allow an explicit
814         specialization to be different wrt the constexpr specifier.
816 2013-04-06  Jason Merrill  <jason@redhat.com>
818         * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
819         noreturn attribute.
821 2013-04-05  Ed Smith-Rowland  <3dw4rd@verizon.net>
823         * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
824         cp_parser_ref_qualifier_opt.  Error if more than one ref-qual found.
826 2013-04-03  Jason Merrill  <jason@redhat.com>
828         * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
829         (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
830         (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
832         * mangle.c (write_type): When writing a function type with
833         function-cv-quals, don't add the unqualified type as a
834         substitution candidate.
836 2013-04-03  Paolo Carlini  <paolo.carlini@oracle.com>
838         PR c++/56815
839         * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
840         pedwarn.
842 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
844         PR debug/56819
845         * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
846         from args to new_args.
847         (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
848         r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
850 2013-04-02  Jason Merrill  <jason@redhat.com>
852         PR c++/56821
853         * mangle.c (write_function_type): Mangle ref-qualifier.
854         (write_nested_name): Likewise.
855         (canonicalize_for_substitution): Preserve ref-qualifier.
856         (write_type): Likewise.
858         PR c++/34949
859         * decl.c (begin_destructor_body): Clobber the object in a cleanup.
861 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
863         * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
864         * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
865         (for_each_template_parm_r): Use TYPE_TI_ARGS.
867 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
869         * cp-tree.h (TAGGED_TYPE_P): Remove.
870         (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
871         (TYPE_ANONYMOUS_P): Adjust.
872         * call.c (build_new_op_1): Likewise.
873         * class.c (find_abi_tags_r): Likewise.
874         * decl.c (warn_misplaced_attr_for_class_type, start_decl,
875         type_is_deprecated): Likewise.
876         * decl2.c (grokfield, min_vis_r): Likewise.
877         * pt.c (get_template_info): Likewise.
878         * tree.c (handle_abi_tag_attribute): Likewise.
880 2013-04-01  Jason Merrill  <jason@redhat.com>
882         * semantics.c (maybe_constant_value): Check
883         instantiation_dependent_expression_p.
884         * pt.c (build_non_dependent_expr): Don't check it here.
886         PR c++/56772
887         * init.c (build_new): Don't try to process an array initializer
888         at template definition time.
890         PR c++/56793
891         * typeck.c (finish_class_member_access_expr): Handle enum scope.
893         PR c++/56794
894         * parser.c (cp_parser_range_for): Don't try to do auto deduction
895         in a template if the type of the range is incomplete.
897         * call.c (add_function_candidate): Take the address of 'this' here.
898         (build_over_call): And here.
899         (build_new_method_call_1, build_op_call_1): Not here.
900         (build_user_type_conversion_1): Or here.
901         (add_candidates): Adjust.
903         * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
904         * class.c (same_signature_p): Use type_memfn_quals.
905         * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
906         FUNCTION_OR_METHOD_TYPE_CHECK.
907         * error.c (dump_type_suffix): Add padding before cv-qualifiers.
908         * pt.c (unify): Use static_fn_type.
910 2013-04-01  Bronek Kozicki <b.kozicki@gmail.com>
911             Jason Merrill  <jason@redhat.com>
913         Implement N2439 (ref-qualifiers for 'this')
914         * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
915         (FUNCTION_RVALUE_QUALIFIED): New.
916         (FUNCTION_OR_METHOD_TYPE_CHECK): New.
917         (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
918         (cp_ref_qualifier): New enum.
919         (cp_declarator): Add ref_qualifier.
920         * parser.c (cp_parser_ref_qualifier_seq_opt): New.
921         (cp_parser_direct_declarator): Use it.
922         (make_call_declarator): Adjust.
923         (cp_parser_lambda_declarator_opt): Adjust.
924         * call.c (add_function_candidate): Handle ref-qualifier overload
925         resolution semantics.
926         (standard_conversion): Adjust.
927         * class.c (add_method, same_signature_p): Compare ref-qualifiers.
928         * decl.c (grokdeclarator): Handle ref-qualifiers.
929         (grokfndecl): Check for invalid ref-qualifiers.
930         (static_fn_type, revert_static_member_fn): Adjust.
931         * decl2.c (build_memfn_type): Handle ref-qualifiers.
932         (check_classfn): Check them.
933         (cp_reconstruct_complex_type): Retain them.
934         * error.c (dump_ref_qualifier): New.
935         (dump_type_suffix, dump_function_decl): Use it.
936         (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
937         * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
938         (unify): Retain them.
939         * tree.c (cp_check_qualified_type): New.
940         (cp_build_qualified_type_real): Keep exception spec and ref-qual.
941         (build_ref_qualified_type): New.
942         (strip_typedefs, build_exception_variant): Keep ref-qualifier.
943         (cp_build_type_attribute_variant): Keep ref-qualifier.
944         * typeck.c (merge_types): Keep ref-qualifier.
945         (structural_comptypes): Compare ref-qualifier.
946         (type_memfn_rqual): New.
947         (apply_memfn_quals): Take ref-qual argument.
948         * typeck2.c (build_m_component_ref): Check ref-qualifier.
950 2013-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
952         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
953         (DECL_FUNCTION_TEMPLATE_P): Adjust.
955         * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
956         pp_cxx_qualified_id): Use get_containing_scope.
957         * parser.c (cp_parser_class_head): Likewise.
958         * pt.c (push_template_decl_real): Likewise.
960         * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
961         * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
963 2013-03-31  Paolo Carlini  <paolo.carlini@oracle.com>
965         * decl2.c (collect_candidates_for_java_method_aliases): Use
966         DECL_CLASS_SCOPE_P.
967         * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
968         (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
969         * decl.c (duplicate_decls): Likewise.
970         * parser.c (cp_parser_template_declaration_after_export): Likewise,
971         also DECL_DECLARES_TYPE_P.
972         * pt.c (instantiate_class_template_1): Likewise.
973         * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
974         (lookup_field_r): Likewise.
975         (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
976         (lookup_fnfields_slot_nolazy): Likewise.
977         * semantics.c (finish_member_declaration): Likewise.
978         * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
980 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
982         * pt.c (template_parms_to_args): Fix typo in comment.
984 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
986         * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
988 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
990         * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
991         (build_op_call_1): Likewise.
992         (build_over_call): Likewise.
993         (compare_ics): Likewise.
994         * class.c (build_base_path): Likewise.
995         (resolve_address_of_overloaded_function): Likewise.
996         * cp-tree.h: Likewise.
997         * cvt.c (cp_convert_to_pointer): Likewise.
998         (convert_to_reference): Likewise.
999         (ocp_convert): Likewise.
1000         (convert_force): Likewise, tidy.
1001         * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
1002         (pp_cxx_ptr_operator): Likewise.
1003         * decl.c (duplicate_decls): Likewise.
1004         (start_decl): Likewise.
1005         (grok_op_properties): Likewise.
1006         (start_preparsed_function): Likewise.
1007         (store_parm_decls): Likewise.
1008         (finish_function): Likewise.
1009         * decl2.c (delete_sanity): Likewise.
1010         (acceptable_java_type): Likewise.
1011         (grokbitfield): Likewise.
1012         (cp_reconstruct_complex_type): Likewise.
1013         * error.c (dump_type_prefix): Likewise.
1014         (dump_expr): Likewise.
1015         * except.c (push_eh_cleanup): Likewise.
1016         (complete_ptr_ref_or_void_ptr_p): Likewise.
1017         (can_convert_eh): Likewise.
1018         * init.c (build_new_1): Likewise.
1019         (build_delete): Likewise.
1020         (build_vec_delete): Likewise.
1021         * mangle.c (write_type): Likewise.
1022         * parser.c (lookup_literal_operator): Likewise.
1023         * pt.c (convert_nontype_argument_function): Likewise.
1024         (convert_nontype_argument): Likewise.
1025         (tsubst): Likewise.
1026         (unify): Likewise.
1027         (dependent_type_p_r): Likewise.
1028         * rtti.c (build_headof): Likewise.
1029         (build_typeid): Likewise.
1030         (build_dynamic_cast_1): Likewise.
1031         (target_incomplete_p): Likewise.
1032         (typeinfo_in_lib_p): Likewise.
1033         * semantics.c (finish_omp_for): Likewise.
1034         (cxx_eval_call_expression): Likewise.
1035         (maybe_resolve_dummy): Likewise.
1036         * tree.c (build_target_expr): Likewise.
1037         (cp_build_qualified_type_real): Likewise.
1038         * typeck.c (composite_pointer_type_r): Likewise.
1039         (composite_pointer_type): Likewise.
1040         (comp_except_types): Likewise.
1041         (cxx_sizeof_nowarn): Likewise.
1042         (string_conv_p): Likewise.
1043         (cp_build_array_ref): Likewise.
1044         (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
1045         (pointer_diff): Likewise.
1046         (cp_build_addr_expr_1): Likewise.
1047         (cp_build_unary_op): Likewise.
1048         (build_static_cast_1): Likewise.
1049         (cp_build_c_cast): Likewise.
1050         (comp_ptr_ttypes_real): Likewise.
1051         (ptr_reasonably_similar): Likewise.
1052         (comp_ptr_ttypes_const): Likewise.
1053         (casts_away_constness): Likewise.
1054         (check_literal_operator_args): Likewise.
1055         * typeck2.c (build_x_arrow): Likewise.
1056         (add_exception_specifier): Likewise.
1058 2013-03-29  Jason Merrill  <jason@redhat.com>
1060         N3582
1061         * cp-tree.h (AUTO_IS_DECLTYPE): New.
1062         * parser.c (cp_parser_decltype): Handle decltype(auto).
1063         (cp_parser_type_id_1): Allow auto without a late-specified
1064         return in C++1y.
1065         (cp_parser_primary_expression): Use the return value of
1066         finish_parenthesized_expr.
1067         (cp_parser_transaction_expression): Likewise.
1068         * semantics.c (force_paren_expr): New.
1069         (finish_parenthesized_expr): Use it.
1070         * call.c (build_conditional_expr_1): Likewise.
1071         * pt.c (do_auto_deduction): Handle decltype(auto).
1072         (tsubst_copy): Handle PAREN_EXPR.
1073         (tsubst_copy_and_build): Likewise.
1074         * error.c (dump_expr): Handle PAREN_EXPR.
1075         * cxx-pretty-print.c (pp_cxx_expression): Likewise.
1076         * mangle.c (write_expression): Ignore PAREN_EXPR.
1078         * parser.c (cp_parser_decltype_expr): Split out...
1079         (cp_parser_decltype): ...from here.
1081         PR c++/56774
1082         PR c++/35722
1083         * pt.c (unify_pack_expansion): Fix indexing.
1085 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1087         * call.c (build_java_interface_fn_ref): Likewise.
1088         (make_temporary_var_for_ref_to_temp): Likewise.
1089         * class.c (check_field_decls): Likewise.
1090         (layout_class_type): Likewise.
1091         (finish_struct_1): Likewise.
1092         (fixed_type_or_null): Likewise.
1093         (get_vtbl_decl_for_binfo): Likewise.
1094         * cp-gimplify.c (omp_var_to_track): Likewise.
1095         (cp_genericize_r): Likewise.
1096         * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
1097         * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
1098         (DECL_DISCRIMINATOR_P): Likewise.
1099         * decl.c (poplevel): Likewise.
1100         (decls_match): Likewise.
1101         (duplicate_decls): Likewise.
1102         (decl_jump_unsafe): Likewise.
1103         (start_decl): Likewise.
1104         (check_for_uninitialized_const_var): Likewise.
1105         (make_rtl_for_nonlocal_decl): Likewise.
1106         (cp_finish_decl): Likewise.
1107         (expand_static_init): Likewise.
1108         (local_variable_p): Likewise.
1109         (maybe_register_incomplete_var): Likewise.
1110         * decl2.c (grokfield): Likewise.
1111         (comdat_linkage): Likewise.
1112         (determine_visibility): Likewise.
1113         (import_export_decl): Likewise.
1114         (prune_vars_needing_no_initialization): Likewise.
1115         (decl_maybe_constant_var_p): Likewise.
1116         * error.c (dump_simple_decl): Likewise.
1117         (dump_template_decl): Likewise.
1118         (cp_printer): Likewise.
1119         * except.c (build_throw): Likewise.
1120         * init.c (build_vtbl_address): Likewise.
1121         (member_init_ok_or_else): Likewise.
1122         (build_aggr_init): Likewise.
1123         (expand_aggr_init_1): Likewise.
1124         (build_offset_ref): Likewise.
1125         (constant_value_1): Likewise.
1126         * mangle.c (write_mangled_name): Likewise.
1127         (write_prefix): Likewise.
1128         * name-lookup.c (supplement_binding_1): Likewise.
1129         (add_decl_to_level): Likewise.
1130         (pushdecl_maybe_friend_1): Likewise.
1131         (check_for_out_of_scope_variable): Likewise.
1132         (validate_nonmember_using_decl): Likewise.
1133         (lookup_name_innermost_nonclass_level_1): Likewise.
1134         (lookup_arg_dependent_1): Likewise.
1135         * parser.c (cp_parser_lambda_introducer): Likewise.
1136         (cp_parser_template_argument): Likewise.
1137         (cp_parser_single_declaration): Likewise.
1138         * pt.c (convert_nontype_argument): Likewise.
1139         (instantiate_class_template_1): Likewise.
1140         (tsubst_decl): Likewise.
1141         (tsubst_expr): Likewise.
1142         (do_decl_instantiation): Likewise.
1143         (do_type_instantiation): Likewise.
1144         (regenerate_decl_from_template): Likewise.
1145         (always_instantiate_p): Likewise.
1146         (instantiate_decl): Likewise.
1147         (type_dependent_expression_p): Likewise.
1148         (build_non_dependent_expr): Likewise.
1149         * repo.c (repo_emit_p): Likewise.
1150         * rtti.c (build_dynamic_cast_1): Likewise.
1151         * search.c (shared_member_p): Likewise.
1152         * semantics.c (outer_var_p): Likewise.
1153         (finish_id_expression): Likewise.
1154         (finish_omp_clauses): Likewise.
1155         (finish_decltype_type): Likewise.
1156         (ensure_literal_type_for_constexpr_object): Likewise.
1157         * tree.c (lvalue_kind): Likewise.
1158         (bot_replace): Likewise.
1159         (cp_tree_equal): Likewise.
1160         (handle_init_priority_attribute): Likewise.
1161         (decl_storage_duration): Likewise.
1162         * typeck.c (cxx_sizeof_expr): Likewise.
1163         (cxx_alignof_expr): Likewise.
1164         (decay_conversion): Likewise.
1165         (build_class_member_access_expr): Likewise.
1166         (cp_build_array_ref): Likewise.
1167         (cxx_mark_addressable): Likewise.
1168         (maybe_warn_about_returning_address_of_local): Likewise.
1169         (check_return_expr): Likewise.
1170         * typeck2.c (cxx_readonly_error): Likewise.
1171         (abstract_virtuals_error_sfinae): Likewise.
1172         (cxx_incomplete_type_diagnostic): Likewise.
1174 2013-03-28  Lawrence Crowl  <crowl@google.com>
1176         * Make-lang.in
1177         (CXX_PARSER_H): Add header dependence.
1178         * cp-tree.h
1179         (extern debug (cp_binding_level &)): New.
1180         (extern debug (cp_binding_level *)): New.
1181         * name-lookup.h
1182         (debug (cp_binding_level &)): New.
1183         (debug (cp_binding_level *)): New.
1184         * parser.c
1185         (debug (cp_parser &)): New.
1186         (debug (cp_parser *)): New.
1187         (debug (cp_token &)): New.
1188         (debug (cp_token *)): New.
1189         (debug (vec<cp_token, va_gc> &)): New.
1190         (debug (vec<cp_token, va_gc> *)): New.
1191         * parser.c: Add header dependence.
1192         (extern debug (cp_parser &)): New.
1193         (extern debug (cp_parser *)): New.
1194         (extern debug (cp_token &)): New.
1195         (extern debug (cp_token *)): New.
1196         (extern debug (vec<cp_token, va_gc> &)): New.
1197         (extern debug (vec<cp_token, va_gc> *)): New.
1199 2013-03-28  Jason Merrill  <jason@redhat.com>
1201         PR c++/17232
1202         PR c++/52748
1203         * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
1204         the type if tf_decltype is set.
1205         * pt.c (fn_type_unification): Add decltype_p parm.
1206         (get_bindings): Adjust.
1207         * cp-tree.h: Adjust.
1208         * class.c (resolve_address_of_overloaded_function): Adjust.
1209         * call.c (add_template_candidate_real, print_z_candidate): Adjust.
1211         PR c++/56679
1212         * parser.c (cp_parser_sizeof_pack): Split out from...
1213         (cp_parser_sizeof_operand): ...here.  Require (id).
1215         PR c++/56701
1216         * semantics.c (finish_this_expr): 'this' is an rvalue.
1217         * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
1219         PR c++/56710
1220         * semantics.c (finish_member_declaration): Don't push closure
1221         members.
1223         * name-lookup.c (pushdecl_maybe_friend_1): Use
1224         nonlambda_method_basetype and current_nonlambda_class_type.
1226         PR c++/56728
1227         * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
1228         conversion from integer to pointer.
1229         (cxx_eval_constant_expression): Likewise.
1230         (cxx_eval_indirect_ref): Use the folded operand if we still think
1231         this might be constant.
1233 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
1234             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1236         PR c++/56725
1237         * call.c (convert_like_real): Change series of two permerrors
1238         to permerror + inform (and likewise for two errors).
1239         (build_new_method_call_1): Likewise.
1240         * typeck.c (convert_for_initialization): Change additional
1241         warning or error to inform.
1243 2013-03-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1245         * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
1246         (first_aggr_init_expr): Likewise.
1247         (more_aggr_init_expr_args_p): Likewise.
1248         (type_of_this_parm): Likewise.
1249         (class_of_this_parm): Likewise.
1250         * name-lookup.h (get_global_value_if_present): Likewise.
1251         (is_typename_at_global_scope): Likewise.
1253 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
1255         * call.c (joust): Don't call inform for a permerror returning false.
1256         * parser.c (cp_parser_check_class_key): Likewise.
1257         * pt.c (tsubst_copy_and_build): Likewise.
1259 2013-03-27  Jason Merrill  <jason@redhat.com>
1261         PR c++/56749
1262         * semantics.c (finish_qualified_id_expr): Return early
1263         for enum scope.
1265 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1267         * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1268         * cvt.c (convert_to_void): Likewise.
1269         * error.c (dump_expr): Likewise.
1270         * mangle.c (write_expression): Likewise.
1271         * parser.c (cp_parser_template_argument): Likewise.
1272         * pt.c (convert_nontype_argument): Likewise.
1273         (tsubst_copy_and_build): Likewise.
1274         * rtti.c (build_typeid): Likewise.
1275         * semantics.c (finish_call_expr): Likewise.
1276         (finish_decltype_type): Likewise.
1277         (build_data_member_initialization): Likewise.
1278         * tree.c (is_dummy_object): Likewise.
1279         * typeck.c (decay_conversion): Likewise.
1280         (build_class_member_access_expr): Likewise.
1281         (cp_build_addr_expr_1): Likewise.
1282         (unary_complex_lvalue): Likewise.
1283         (check_return_expr): Likewise.
1284         * typeck2.c (cxx_readonly_error): Likewise.
1286 2013-03-26  Jason Merrill  <jason@redhat.com>
1288         PR c++/52597
1289         * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn.  Take tree.
1290         * semantics.c (finish_decltype_type): Check it before type_unknown_p.
1291         * cp-tree.h: Adjust prototype.
1293         PR c++/45282
1294         * typeck2.c (build_m_component_ref): Handle prvalue object.
1296 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1298         * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
1299         * decl.c (duplicate_decls): Likewise.
1300         (cp_finish_decl): Likewise.
1301         (check_class_member_definition_namespace): Likewise.
1302         * decl2.c (grokfield): Likewise.
1303         (decl_needed_p): Likewise.
1304         (import_export_decl): Likewise.
1305         (mark_used): Likewise.
1306         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1307         * pt.c (push_access_scope): Likewise.
1308         (instantiate_decl): Likewise.
1309         * ptree.c (cxx_print_decl): Likewise.
1310         * repo.c (repo_emit_p): Likewise.
1311         * semantics.c (note_decl_for_pch): Likewise.
1312         * tree.c (decl_linkage): Likewise.
1314 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
1316         PR c++/55951
1317         * decl.c (check_array_designated_initializer): Handle CONST_DECL
1318         as ce->index.
1320 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
1322         * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1323         error messages.
1325         * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1327 2013-03-25  Jason Merrill  <jason@redhat.com>
1329         PR c++/56699
1330         * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1331         class is derived from the type of the object.
1333         PR c++/52014
1334         * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1335         unevaluated context.
1337 2013-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
1339         PR c++/56722
1340         * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1341         DECL_TEMPLATE_INSTANTIATION.
1343 2013-03-22  Jason Merrill  <jason@redhat.com>
1345         PR c++/56684
1346         * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1347         and CONST_DECL.
1349 2013-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1351         * cp-tree.h (identifier_p): New.
1352         * call.c: Throughout, call identifier_p insstead of direct
1353         comparaison of TREE_CODE against IDENTIFIER_NODE.
1354         * decl.c: Likewisse.
1355         * decl2.c: Likewise.
1356         * init.c: Likewise.
1357         * mangle.c: Likewise.
1358         * name-lookup.c: Likewise.
1359         * parser.c: Likewise.
1360         * pt.c: Likewise.
1361         * search.c: Likewise.
1362         * semantics.c: Likewise.
1363         * tree.c: Likewise.
1364         * typeck.c: Likewise.
1365         * typeck2.c: Likewise.
1367 2013-03-21  Jakub Jelinek  <jakub@redhat.com>
1369         PR middle-end/48087
1370         * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1371         * call.c (build_temp): Likewise.
1372         * method.c (synthesize_method): Likewise.
1373         * typeck.c (convert_for_initialization): Likewise.
1375 2013-03-21  Marc Glisse  <marc.glisse@inria.fr>
1377         * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
1379 2013-03-21  Richard Biener  <rguenther@suse.de>
1381         * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
1382         DECL_DEBUG_EXPR_IS_FROM.  Guard properly.
1384 2013-03-20  Jason Merrill  <jason@redhat.com>
1386         PR c++/56646
1387         * parser.c (cp_parser_late_return_type_opt): Save and restore
1388         current_class_ptr/ref.
1390         PR c++/54532
1391         * expr.c (cplus_expand_constant): Do nothing if the class is
1392         incomplete.
1393         * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1394         * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1395         * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1396         (complete_vars): Likewise.
1398         * name-lookup.c (get_anonymous_namespace_name): Never use
1399         get_file_function_name.
1401         * pt.c (retrieve_specialization): Handle null tmpl argument.
1403         PR c++/17232
1404         PR c++/56642
1405         * pt.c (tsubst_decl): Check return value of register_specialization.
1406         * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1407         change.
1409 2013-03-17  Jason Merrill  <jason@redhat.com>
1411         PR c++/54359
1412         PR c++/56639
1413         * parser.c (cp_parser_direct_declarator): Bail if we see a
1414         qualified-id not at namespace scope.
1416         PR c++/17232
1417         PR c++/56642
1418         * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1419         change for now.
1421 2013-03-16  Jason Merrill  <jason@redhat.com>
1423         * decl.c (grokdeclarator): Assert that we won't see a pointer to
1424         METHOD_TYPE.
1426         PR c++/54277
1427         * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1428         (MAYBE_CLASS_TYPE_P): ...here.
1429         * semantics.c (lambda_capture_field_type): Only build a
1430         magic decltype for wildcard types.
1431         (lambda_proxy_type): Likewise.
1432         (finish_non_static_data_member): Get the quals from
1433         the object.
1435         PR c++/55931
1436         * parser.c (cp_parser_template_argument): Don't
1437         fold_non_dependent_expr.
1439         * parser.c (cp_parser_lambda_declarator_opt): Use
1440         cp_parser_trailing_type_id.
1442         PR c++/45917
1443         * parser.c (cp_parser_template_id): Don't forget access checks.
1445         PR c++/52374
1446         * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1448         PR c++/54764
1449         PR c++/55972
1450         * name-lookup.h (tag_scope): Add ts_lambda.
1451         * semantics.c (begin_lambda_type): Use it.
1452         * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1453         * pt.c (check_default_tmpl_args): Ignore lambdas.
1454         (push_template_decl_real): Handle lambdas.
1455         * tree.c (no_linkage_check): Adjust lambda check.
1457         PR c++/56039
1458         * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1460         PR c++/54359
1461         * parser.c (cp_parser_direct_declarator): Fix late return
1462         for out-of-class defn of member function.
1464         PR c++/55357
1465         * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1466         parms to avoid duplicate -Wshadow warnings.
1468         * search.c (lookup_base): Handle NULL_TREE.
1470         PR c++/56481
1471         * semantics.c (potential_constant_expression_1): Use of 'this' in
1472         a non-constexpr function makes the expression not potentially
1473         constant.
1475         N3276
1476         PR c++/52748
1477         * cp-tree.h (tsubst_flags): Add tf_decltype.
1478         * call.c (build_cxx_call): Don't build a temporary if it's set.
1479         (build_over_call): Make sure it's only passed to build_cxx_call.
1480         * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1481         (cp_parser_unary_expression): Likewise.
1482         (cp_parser_cast_expression): Likewise.
1483         (cp_parser_binary_expression): Likewise.
1484         (cp_parser_assignment_expression): Likewise.
1485         (cp_parser_postfix_expression): Likewise.  Pass tf_decltype.
1486         (cp_parser_expression): Add decltype_p.  Force a
1487         temporary for a call on the LHS of a comma.
1488         (cp_parser_decltype): Pass true to decltype_p parms.
1489         * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1490         (tsubst_copy_and_build): Pass tf_decltype down only for
1491         CALL_EXPR and the RHS of COMPOUND_EXPR.
1492         * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1494         * cp-tree.h (abstract_class_use): New enum.
1495         * typeck2.c (pending_abstract_type): Add use field.
1496         (abstract_virtuals_error_sfinae): Add overloads taking
1497         abstract_class_use instead of tree.
1498         * typeck.c (build_static_cast_1): Call it.
1499         * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1500         * pt.c: Adjust calls.
1501         * decl.c (cp_finish_decl): Don't handle functions specially.
1502         (grokdeclarator): Always check return type.
1503         * init.c (build_new_1): Adjust call.
1505         DR 337
1506         PR c++/17232
1507         * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1508         * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1510         DR 657
1511         * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1512         (tsubst_arg_types): Likewise.
1514         DR 1518
1515         PR c++/54835
1516         * call.c (convert_like_real): Check for explicit constructors
1517         even for value-initialization.
1519         PR c++/54946
1520         * pt.c (convert_nontype_argument): Handle invalid pointer.
1522         * parser.c (cp_parser_lambda_expression): Use nreverse.
1524         PR c++/56447
1525         PR c++/55532
1526         * pt.c (instantiate_class_template_1): Instantiate lambda capture
1527         list here.
1528         (tsubst_copy_and_build): Not here.
1530         PR c++/55017
1531         * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1533         PR c++/55240
1534         * parser.c (parsing_nsdmi): New.
1535         * semantics.c (outer_automatic_var_p): Check it.
1536         (finish_id_expression): Likewise.
1537         * cp-tree.h: Declare it.
1539         PR c++/55241
1540         * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1542         * parser.c (lookup_literal_operator): Correct parm/arg naming
1543         mixup.
1545         PR c++/56238
1546         * pt.c (fold_non_dependent_expr_sfinae): Check
1547         instantiation_dependent_expression_p.
1549         PR c++/56095
1550         * class.c (resolve_address_of_overloaded_function): Accept a
1551         reference to function for target_type.
1552         (instantiate_type): Likewise.
1553         * pt.c (convert_nontype_argument): Pass it to
1554         convert_nontype_argument_function.
1556 2013-03-16  Jakub Jelinek  <jakub@redhat.com>
1558         * tree.c (cp_tree_equal): Fix a pasto.
1560         PR c++/56607
1561         * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1562         pass op1 through maybe_constant_value first.
1564 2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>
1566         PR c++/56582
1567         * semantics.c (cxx_eval_array_reference): Check for negative index.
1569 2013-03-14  Jason Merrill  <jason@redhat.com>
1571         PR c++/56614
1572         * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1574         PR c++/56346
1575         * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1576         dso_handle parm on targets without __cxa_atexit.
1578 2013-03-11  Jason Merrill  <jason@redhat.com>
1580         PR c++/56567
1581         * typeck.c (check_return_expr): Disallow returning init list here.
1582         * semantics.c (apply_deduced_return_type): Not here.
1584 2013-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
1586         PR c++/51412
1587         * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1588         * error.c (dump_expr): Likewise.
1590 2013-03-08  Jason Merrill  <jason@redhat.com>
1592         PR c++/51884
1593         * class.c (modify_all_vtables): Mangle the vtable name before
1594         entering dfs_walk.
1596         * semantics.c (lambda_expr_this_capture): In unevaluated context,
1597         just return the nearest 'this'.
1599         PR c++/51494
1600         PR c++/52183
1601         PR c++/56222
1602         * tree.c (maybe_dummy_object): Don't capture 'this'.
1603         * semantics.c (maybe_resolve_dummy): New.
1604         (finish_non_static_data_member): Use it.
1605         (finish_qualified_id_expr): Don't test is_dummy_object.
1606         * cp-tree.h: Declare maybe_resolve_dummy.
1607         * call.c (build_new_method_call_1): Use it.
1609         PR c++/56567
1610         * semantics.c (apply_deduced_return_type): Don't allow returning
1611         std::initializer_list.
1613 2013-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
1615         PR c++/56534
1616         * parser.c (cp_parser_elaborated_type_specifier): Don't call
1617         check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1618         * decl.c (check_elaborated_type_specifier): Tidy.
1620 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
1622         PR c++/56543
1623         * tree.c (strip_typedefs): Don't copy args if they are NULL.
1625 2013-03-05  Jakub Jelinek  <jakub@redhat.com>
1627         * parser.c (cp_parser_braced_list): For {} initialize
1628         *non_constant_p to false.
1630 2013-03-04  Jason Merrill  <jason@redhat.com>
1632         PR c++/56464
1633         PR c++/54383
1634         * semantics.c (lambda_expr_this_capture): Handle NSDMI
1635         and non-class scopes.
1637 2013-03-01  Paolo Carlini  <paolo.carlini@oracle.com>
1639         * decl.c (grokdeclarator): Remove dead code.
1641 2013-02-28  Jason Merrill  <jason@redhat.com>
1643         PR c++/56481
1644         * semantics.c (potential_constant_expression_1): Use
1645         cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1647         PR c++/56243
1648         * call.c (build_over_call): Avoid virtual lookup in a template.
1650 2013-02-27  Jason Merrill  <jason@redhat.com>
1652         PR c++/56358
1653         PR c++/56323
1654         * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1655         of the base name for inheriting ctors.
1656         (push_class_level_binding_1): Remove inheriting ctor handling.
1657         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1658         * class.c (add_implicitly_declared_members): Adjust.
1660 2013-02-26  David Binderman  <dcb314@hotmail.com>
1662         PR c++/55632
1663         * decl.c (grokdeclarator): Tidy publicp assignment.
1665 2013-02-25  Aldy Hernandez  <aldyh@redhat.com>
1667         PR c++/56419
1668         * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1669         (build_transaction_expr): Same.
1671 2013-02-25  Jason Merrill  <jason@redhat.com>
1673         PR c++/56377
1674         * pt.c (fn_type_unification): Wait to call push_tinst_level until
1675         we know what args we're looking at.
1677         PR c++/56438
1678         * semantics.c (potential_constant_expression_1): In C++98, a cast
1679         to non-integral type can't be a constant expression.
1681 2013-02-24  Jakub Jelinek  <jakub@redhat.com>
1683         PR c++/56403
1684         * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1685         of CLASS_TYPE_P.
1687 2013-02-22  Jason Merrill  <jason@redhat.com>
1689         PR c++/40405
1690         * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1691         if we got the wrong number of template parms.
1693         PR c++/56377
1694         * pt.c (fn_type_unification): Use explicit args in template
1695         instantiation context.
1697         PR c++/56359
1698         * call.c (can_convert_arg): Discard access checks.
1700         PR c++/56395
1701         * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1702         args.
1704 2013-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
1706         PR c++/56373
1707         * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1708         * cvt.c (ocp_convert): Use the latter.
1709         (cp_convert_to_pointer): Likewise.
1710         * decl.c (check_default_argument): Likewise.
1711         * typeck.c (cp_build_binary_op): Likewise.
1712         * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1714 2013-02-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
1715             Paolo Carlini  <paolo.carlini@oracle.com>
1717         PR c++/51242
1718         * decl2.c (grokbitfield): Allow scoped enumeration types.
1720 2013-02-15  Jason Merrill  <jason@redhat.com>
1722         PR c++/54276
1723         * semantics.c (finish_id_expression): Also return the identifier
1724         for an outer local static.
1726         PR c++/56343
1727         * class.c (check_bases_and_members): Deduce noexcept after
1728         checking bases.
1730         PR c++/52026
1731         * semantics.c (finish_id_expression): In a template, return
1732         the identifier for a constant variable.
1734 2013-02-14  Jason Merrill  <jason@redhat.com>
1736         PR c++/54922
1737         * semantics.c (build_anon_member_initialization): New.
1738         (build_data_member_initialization): Use it.
1740         PR c++/55003
1741         * decl.c (cp_finish_decl): Force instantiation of an
1742         auto static data member.
1744         PR c++/55220
1745         * pt.c (unify): A pack expansion that is not the last template
1746         argument makes the entire template argument list non-deduced.
1748         PR c++/56323
1749         * name-lookup.c (do_class_using_decl): Handle typedefs with
1750         inheriting constructors.
1751         (push_class_level_binding_1): Allow inheriting from template
1752         template parameter, too.
1753         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1755         PR c++/55223
1756         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1757         default argument scope.
1758         * mangle.c (write_name): Likewise.
1760         PR c++/55232
1761         * error.c (find_typenames_r): Don't walk into a pack expansion.
1763 2013-02-13  Jason Merrill  <jason@redhat.com>
1765         PR c++/55670
1766         * parser.c (cp_parser_member_declaration): Check the declarator
1767         form when detecting a function declaration via typedef.
1769         PR c++/55680
1770         * pt.c (maybe_process_partial_specialization): A lambda
1771         isn't what's being specialized.
1773         PR c++/55710
1774         * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1775         TREE_USED.
1777         PR c++/55879
1778         * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1780         PR c++/55993
1781         * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1782         non-zero offsets, too.
1784         PR c++/56155
1785         * decl.c (build_enumerator): Always convert the value to a
1786         fixed underlying type.
1788         PR c++/56135
1789         * pt.c (tsubst_copy_and_build): Don't forget any new
1790         captures that arose from use of dependent names.
1792 2013-02-13  Jakub Jelinek  <jakub@redhat.com>
1794         PR c++/56302
1795         * semantics.c (finish_asm_stmt): If input constraints allow
1796         neither register nor memory, try maybe_constant_value to get
1797         a constant if possible.
1799 2013-02-12  Jason Merrill  <jason@redhat.com>
1801         PR c++/56285
1802         * method.c (add_one_base_init): Handle base constructor
1803         taking rvalue reference parm.
1805         PR c++/56291
1806         * semantics.c (sort_constexpr_mem_initializers): Handle
1807         vptr out of order.
1809 2013-02-09  Jason Merrill  <jason@redhat.com>
1811         PR c++/56268
1812         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1813         maybe_instantiate_noexcept.
1815         PR c++/56247
1816         * pt.c (eq_specializations): Set comparing_specializations.
1817         * tree.c (cp_tree_equal): Check it.
1818         * cp-tree.h: Declare it.
1820         * decl.c (decls_match): Check versions later.
1822         PR c++/56238
1823         * pt.c (build_non_dependent_expr): Don't try to fold
1824         instantiation-dependent expressions.
1825         (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1826         [BIND_EXPR]: Treat as dependent.
1828 2013-02-07  Jakub Jelinek  <jakub@redhat.com>
1830         PR c++/56241
1831         * init.c (build_vec_init): Don't append NULL values into new_vec.
1832         (build_zero_init_1): Don't push anything into v if recursive call
1833         returned NULL_TREE.
1834         (build_value_init_noctor): Don't push anything into v if
1835         build_value_init call returned NULL_TREE.
1837         PR c++/56239
1838         * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1839         (cp_parser_tokens_start_cast_expression): ... this.  Change parameter
1840         to cp_parser *, call cp_lexer_peek_token first.  For CPP_OPEN_PAREN,
1841         return true only if 2nd token isn't CPP_CLOSE_PAREN.
1842         (cp_parser_cast_expression): Adjust caller.
1844         PR c++/56237
1845         * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1846         only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1847         DECL_LANG_SPECIFIC (t).
1849 2013-02-07  Jason Merrill  <jason@redhat.com>
1851         PR c++/56235
1852         * method.c (do_build_copy_constructor): Don't bother turning
1853         scalars from lvalues to xvalues.
1854         (do_build_copy_assign): Likewise.
1856 2013-02-06  Jason Merrill  <jason@redhat.com>
1858         * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1860 2013-02-05  Jason Merrill  <jason@redhat.com>
1862         PR c++/54122
1863         * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1864         METHOD_TYPE.
1866         PR c++/56177
1867         * decl.c (start_preparsed_function): Update restype if we change
1868         decl1.
1870         PR c++/56208
1871         * pt.c (fn_type_unification): Discard any access checks from
1872         substituting explicit args.
1874 2013-01-31  Jason Merrill  <jason@redhat.com>
1876         PR c++/56162
1877         PR c++/56104
1878         * typeck.c (get_member_function_from_ptrfunc): Fix
1879         ptrmemfunc_vbit_in_delta case.
1881 2013-01-29  Jason Merrill  <jason@redhat.com>
1883         PR libstdc++/54314
1884         * class.c (build_ctor_vtbl_group): Give construction vtables
1885         hidden visibility.
1887 2013-01-25  Jason Merrill  <jason@redhat.com>
1889         PR c++/56095
1890         * pt.c (convert_nontype_argument_function): Handle invalid input.
1891         (convert_nontype_argument): Likewise.
1893         PR c++/56104
1894         * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1895         dynamic type has no virtual functions.
1897 2013-01-22  Paolo Carlini  <paolo.carlini@oracle.com>
1899         PR c++/55944
1900         * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1901         on TARGET_EXPR nodes.
1903 2013-01-22  Jason Merrill  <jason@redhat.com>
1905         PR c++/56071
1906         * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1908 2013-01-22  Dodji Seketeli  <dodji@redhat.com>
1910         PR c++/53609
1911         * pt.c (argument_pack_element_is_expansion_p)
1912         (make_argument_pack_select, use_pack_expansion_extra_args_p)
1913         (gen_elem_of_pack_expansion_instantiation): New static functions.
1914         (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1915         look through the possibly resulting pack expansion as well.
1916         (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1917         generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1918         Use gen_elem_of_pack_expansion_instantiation to build the
1919         instantiation piece-wise.  Don't use arg_from_parm_pack_p anymore,
1920         as gen_elem_of_pack_expansion_instantiation and the change in
1921         tsubst above generalize this particular case.
1922         (arg_from_parm_pack_p): Remove this for it's not used by
1923         tsubst_pack_expansion anymore.
1925 2013-01-21  Jason Merrill  <jason@redhat.com>
1927         PR c++/56059
1928         * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1929         template args count.
1931 2013-01-18  Jason Merrill  <jason@redhat.com>
1933         PR target/54908
1934         * decl2.c (get_local_tls_init_fn): New.
1935         (get_tls_init_fn): Handle flag_extern_tls_init.  Don't bother
1936         with aliases for internal variables.  Don't use weakrefs if
1937         the variable needs destruction.
1938         (generate_tls_wrapper): Mark the wrapper as const if no
1939         initialization is needed.
1940         (handle_tls_init): Don't require aliases.
1942 2013-01-15  Dodji Seketeli  <dodji@redhat.com>
1944         PR c++/55663
1945         * pt.c (coerce_innermost_template_parms): New static function.
1946         (instantiate_alias_template):  Use it here.
1948 2013-01-09  Jason Merrill  <jason@redhat.com>
1950         PR c++/55878
1951         * rtti.c (build_typeid, get_typeid): Add complain parm.
1952         (get_tinfo_decl_dynamic): Likewise.
1953         * cp-tree.h, parser.c, pt.c: Adjust.
1955         PR c++/55893
1956         * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1957         needs destruction.
1959 2013-01-09  Jakub Jelinek  <jakub@redhat.com>
1961         PR c/48418
1962         * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1963         call maybe_constant_value for the negative or too big shift
1964         count warnings.
1966 2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
1968         PR c++/55801
1969         * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1970         of the argument is true.
1972 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
1974         * parser.c (cp_parser_initializer_list): Move declaration
1975         of variable non_const to start of lexical block.
1977 2013-01-07  Jason Merrill  <jason@redhat.com>
1979         PR c++/55753
1980         * tree.c (build_aggr_init_expr): Do nothing in a template.
1981         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1982         a FUNCTION_DECL before tsubsting.
1984 2013-01-04  Dodji Seketeli  <dodji@redhat.com>
1986         PR c++/52343
1987         * pt.c (check_instantiated_arg): Allow type template arguments.
1989 2013-01-04  Jason Merrill  <jason@redhat.com>
1991         PR c++/55877
1992         * decl.c (reset_type_linkage, bt_reset_linkage): New.
1993         (grokdeclarator): Use reset_type_linkage.
1994         * name-lookup.c (binding_table_foreach): Handle null table.
1995         * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1997 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
1999         PR c++/54526 (again)
2000         * parser.c (cp_parser_template_id): Revert core of previous change
2001         (keep adjusted inform message).
2003 2013-01-03  Jason Merrill  <jason@redhat.com>
2005         PR c++/55419
2006         PR c++/55753
2007         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
2008         TREE_CONSTANT.
2010         PR c++/55842
2011         * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
2013         PR c++/55856
2014         * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
2016         PR c++/53650
2017         * call.c (type_has_extended_temps): New.
2018         * cp-tree.h: Declare it.
2019         * decl.c (check_initializer): Use build_aggr_init for arrays
2020         if it is false.
2021         * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
2023 2013-01-02  Jason Merrill  <jason@redhat.com>
2025         PR c++/54325
2026         * call.c (build_new_method_call_1): Don't use build_value_init for
2027         user-provided default constructors.
2029         * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
2031         PR c++/55032
2032         PR c++/55245
2033         * tree.c (build_cplus_array_type): Copy layout information
2034         to main variant if necessary.
2036 Copyright (C) 2013 Free Software Foundation, Inc.
2038 Copying and distribution of this file, with or without modification,
2039 are permitted in any medium without royalty provided the copyright
2040 notice and this notice are preserved.