[gcc]
[official-gcc.git] / gcc / cp / ChangeLog
blob47cb6d325477a841123042529f2a4b10e111fb81
1 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
3         PR c++/57211
4         * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
5         warnings about defaulted functions.
7 2013-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
9         * call.c (build_conditional_expr_1): Add location_t parameter.
10         (build_conditional_expr): Likewise.
11         * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
12         get_member_function_from_ptrfunc, build_x_conditional_expr,
13         cp_build_modify_expr): Update.
14         * init.c (build_new_1): Likewise.
15         * cp-tree.h: Update declaration.
17 2013-05-20  Jason Merrill  <jason@redhat.com>
19         PR c++/57016
20         * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
21         if there is one.
23         PR c++/57102
24         * decl.c (fndecl_declared_return_type): Also look in
25         DECL_SAVED_FUNCTION_DATA.
27 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
29         PR c++/12288
30         * parser.c (cp_parser_parameter_declaration): Check return value
31         of cp_parser_parse_and_diagnose_invalid_type_name.
33 2013-05-20  Jason Merrill  <jason@redhat.com>
35         PR c++/57319
36         * class.c (vbase_has_user_provided_move_assign): New.
37         * method.c (synthesized_method_walk): Check it.
38         * cp-tree.h: Declare it.
40         PR c++/57325
41         * tree.c (build_cplus_array_type): Copy layout info if element
42         type is complete.
44 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
46         PR c++/23608
47         * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
49 2013-05-20  Jason Merrill  <jason@redhat.com>
51         PR c++/57317
52         * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
53         whether a template has its own args.
55 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
57         PR c++/57327
58         * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
60 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
62         PR c++/10207
63         * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
64         instead of cp_parser_initializer_list for compound-literals.
66 2013-05-20  Marc Glisse  <marc.glisse@inria.fr>
68         PR c++/57175
69         * typeck.c (check_return_expr): Reverse the alignment comparison.
71 2013-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
73         PR c++/18126
74         * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
75         correctly sizeof compound-literal; update comments.
77 2013-05-16  Marc Glisse  <marc.glisse@inria.fr>
79         * call.c (build_conditional_expr_1): Use cp_build_binary_op
80         instead of directly calling fold_build2.
82 2013-05-16  Jason Merrill  <jason@redhat.com>
84         * Make-lang.in (cc1plus$(exeext)): Use link mutex.
86         PR c++/57279
87         * decl.c (grokdeclarator): Allow member function qualifiers in
88         TYPENAME context in C++11 mode.
90 2013-05-16  Dodji Seketeli  <dodji@redhat.com>
92         PR c++/56782 - Regression with empty pack expansions
93         * pt.c (use_pack_expansion_extra_args_p): When at least a
94         parameter pack has an empty argument pack, and another parameter
95         pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
96         mechanism.
98 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
100         * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
101         warning_at and permerror with warning_at/inform and permerror/
102         inform, respectively.
104 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
106         PR c++/31952
107         * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
108         redeclarations.
110 2013-05-14  Jason Merrill  <jason@redhat.com>
112         PR c++/57243
113         * parser.c (cp_parser_range_for): Call complete_type.
115         PR c++/57041
116         * pt.c (tsubst_copy_and_build): Don't recur into a designator.
118 2013-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
120         PR c++/53903
121         * method.c (defaulted_late_check): Check for compatible exception
122         specification out of class explicitly defaulted functions too.
124 2013-05-14  Jason Merrill  <jason@redhat.com>
126         PR c++/56998
127         * semantics.c (potential_constant_expression_1): Make sure the
128         called function is potentially constant.
129         * call.c (null_ptr_cst_p): Revert earlier change.
131 2013-05-13  Jason Merrill  <jason@redhat.com>
133         PR c++/56998
134         * call.c (null_ptr_cst_p): An expression with side-effects can't
135         be a C++03 null pointer constant.
137         PR c++/57041
138         * decl.c (reshape_init_class): Handle error_mark_node.
140         PR c++/57254
141         * typeck.c (merge_types): Propagate ref-qualifier
142         in METHOD_TYPE case.
144         PR c++/57253
145         * decl.c (grokdeclarator): Apply ref-qualifier
146         in the TYPENAME case.
148         PR c++/57252
149         * decl.c (decls_match): Compare ref-qualifiers.
151 2013-05-10  Jason Merrill  <jason@redhat.com>
153         PR c++/57196
154         * pt.c (convert_template_argument): Use dependent_template_arg_p,
155         not uses_template_parms.
157         PR c++/57047
158         * semantics.c (cxx_fold_indirect_ref): Fix thinko.
160         PR c++/55149
161         * semantics.c (add_capture): Error rather than abort on copy
162         capture of VLA.
163         * typeck.c (maybe_warn_about_returning_address_of_local): Don't
164         warn about capture proxy.
166 2013-05-09  Jason Merrill  <jason@redhat.com>
168         * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
170         PR c++/57222
171         * pt.c (lookup_template_class_1): Handle getting a template
172         template parameter as D1.
174         N3639 C++1y VLA diagnostics
175         * decl.c (grokdeclarator): Complain about reference, pointer, or
176         typedef to VLA.
177         (create_array_type_for_decl): Complain about array of VLA.
178         * pt.c (tsubst): Likewise.
179         * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
180         * semantics.c (finish_decltype_type): Complain about decltype of VLA.
181         * typeck.c (cp_build_addr_expr_1): Complain about VLA.
182         (cxx_sizeof_or_alignof_type): Likewise.
184         N3639 C++1y VLA support
185         * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
186         (check_array_initializer): Allow VLA init.
187         (reshape_init_array_1): Adjust.
188         (cp_finish_decl): Check for invalid VLA length.
189         * typeck2.c (process_init_constructor_array): Adjust.
190         (store_init_value): Use build_vec_init for VLAs.
191         * semantics.c (add_capture): Capture VLA as ptr+len.
192         (vla_capture_type): New.
193         (build_capture_proxy): Rebuild the VLA.
194         * typeck.c (build_simple_component_ref): Split out from...
195         (build_ptrmemfunc_access_expr): ...here.
196         * tree.c (array_of_runtime_bound_p): New.
197         * init.c (throw_bad_array_length): New.
198         (build_vec_init): Use it.
199         * parser.c (cp_convert_range_for): When iterating over a VLA,
200         use it directly rather than bind a reference.
201         * cp-tree.h: Declare new functions.
203 2013-05-08  Jason Merrill  <jason@redhat.com>
205         * except.c (is_admissible_throw_operand_or_catch_parameter): Check
206         variably_modified_type_p.
207         (expand_start_catch_block): Mark the typeinfo used here.
208         * semantics.c (finish_handler_parms): Not here.
210         * error.c (dump_type_suffix): Try harder on VLA length.
212         Core 624/N2932
213         * init.c (throw_bad_array_new_length): New.
214         (build_new_1): Use it.  Don't warn about braced-init-list.
215         (build_vec_init): Use it.
216         * call.c (build_operator_new_call): Use it.
218         PR c++/57068
219         * decl.c (grokdeclarator): Warn about ref-qualifiers here.
220         * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
221         * error.c (maybe_warn_cpp0x): s/0x/11/.
223 2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
225         PR c++/51226
226         * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
227         == error_mark_node.
229 2013-05-06  Marc Glisse  <marc.glisse@inria.fr>
231         * typeck.c (cp_build_binary_op): Call save_expr before
232         build_vector_from_val.
234 2013-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
236         PR c++/57183
237         * decl.c (cp_finish_decl): After do_auto_deduction copy the
238         qualifers with cp_apply_type_quals_to_decl.
240 2013-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
242         * pt.c (convert_nontype_argument): Add missing whitespace in
243         error message.
245 2013-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
247         PR c++/53745
248         * decl.c (build_enumerator): Improve error message.
250 2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
252         PR c++/14283
253         * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
254         messages for template types and fix column numbers.
256 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
258         PR c++/57132
259         * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
260         c_inhibit_evaluation_warnings around build_x_modify_expr call.
262 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
264         PR c++/57092
265         * semantics.c (finish_decltype_type): Handle instantiated template
266         non-type arguments.
268 2013-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
270         PR c++/56450
271         * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
273 2013-04-26  Jakub Jelinek  <jakub@redhat.com>
275         * error.c (cp_print_error_function): Adjust file_name_as_prefix
276         caller.
278 2013-04-25  Jason Merrill  <jason@redhat.com>
280         PR c++/56859
281         * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
283         PR c++/50261
284         * init.c (perform_member_init): Call reshape_init.
286 2013-04-24  Jason Merrill  <jason@redhat.com>
288         PR c++/53721
289         * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
291 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
293         * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
294         pedwarn to simply use OPT_Wpointer_arith.
295         (cp_build_unary_op): Likewise.
297 2013-04-24  Jason Merrill  <jason@redhat.com>
299         N3648: init-captures are named.
300         * semantics.c (add_capture): Don't prepend "__" to init-captures.
301         (build_capture_proxy): Adjust.
302         * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
304         N3648: Allow braced and parenthesized initializers.
305         * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
306         * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
307         * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
308         (add_capture): Collapse a parenthesized initializer into a single
309         expression.
310         * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
312 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
314         PR c++/56970
315         * init.c (build_offset_ref): Add tsubst_flags_t parameter.
316         * semantics.c (finish_qualified_id_expr): Likewise.
317         (finish_id_expression): Update.
318         * typeck.c (cp_build_addr_expr_1): Likewise.
319         * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
320         * cp-tree.h: Update declarations.
322 2013-04-22  Jason Merrill  <jason@redhat.com>
324         Core 1586
325         * parser.c (cp_parser_unqualified_id): Handle ~auto.
326         (cp_parser_pseudo_destructor_name): Likewise.
327         (cp_parser_postfix_dot_deref_expression): Adjust.
328         (cp_lexer_nth_token_is_keyword): New.
329         * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
330         * typeck.c (lookup_destructor): Handle ~auto.
332         * pt.c (fn_type_unification): Push tinst level around
333         type_unification_real if we aren't explaining.
334         * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
335         * error.c (dump_function_decl): Respect it.
336         (subst_to_string): Pass it.
338         PR c++/48665
339         * rtti.c (get_typeid): Diagnose qualified function type.
340         * pt.c (tsubst) [POINTER_TYPE]: Likewise.
342         * error.c (dump_aggr_type): Fix lambda detection.
343         (dump_simple_decl): Pretty-print capture field.
345         N3323
346         * cvt.c (build_expr_type_conversion): Two conversions that return
347         the same type aren't necessarily ambiguous.
349         N3648
350         * parser.c (cp_parser_lambda_introducer): Make lambda capture init
351         pedwarn unconditional except in C++1y mode.
353         * semantics.c (potential_constant_expression_1): Don't crash on
354         'this' in NSDMI.
356         Core 1612
357         * semantics.c (finish_id_expression): Reject capture of anonymous
358         union member.
360         Core 1609
361         * decl2.c (check_default_args): Check for pack expansion.
363         * mangle.c (write_type): Mangle decltype(auto).
365 2013-04-19  Jason Merrill  <jason@redhat.com>
367         N3638 changes to return type deduction
368         * decl.c (undeduced_auto_decl): New.
369         (require_deduced_type): New.
370         (fndecl_declared_return_type): New.
371         (decls_match): Use it.
372         (duplicate_decls): Don't check for auto return.
373         (grokdeclarator): Reject virtual auto.
374         * class.c (resolve_address_of_overloaded_function): Handle
375         auto function templates.
376         * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
377         * cp-tree.h: Declare new fns.
378         * error.c (dump_function_decl): Use fndecl_declared_return_type.
379         * search.c (check_final_overrider): Likewise.
380         * pt.c (make_decltype_auto): New.
381         (do_auto_deduction): Require plain decltype(auto).
382         (is_auto): Adjust.
384         DR 941
385         * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
386         template specializations.
388 2013-04-16  Ed Smith-Rowland  <3dw4rd@verizon.net>
390         Implement n3599 - Literal operator templates for strings.
391         * parser.c (make_string_pack (tree value)): New function.
392         (cp_parser_userdef_string_literal (cp_token *)): Use it
393         to construct calls to character string literal operator templates.
394         (cp_parser_template_declaration_after_export): Check for new string
395         literal operator template parameter form.
397 2013-04-15  Jason Merrill  <jason@redhat.com>
399         * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
401         PR c++/52748
402         * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
403         rather than a destructor name, it isn't an unqualified-name.
404         (tsubst_copy_and_build): Pass down decltype_flag to operator
405         handling code, too.
407         PR c++/56388
408         * semantics.c (insert_capture_proxy): Just use index 1 in the
409         stmt_list_stack.
411 2013-04-12  Jakub Jelinek  <jakub@redhat.com>
413         * error.c (cp_print_error_function,
414         print_instantiation_partial_context_line,
415         maybe_print_constexpr_context): Colorize locus strings.
417 2013-04-11  Jason Merrill  <jason@redhat.com>
419         PR c++/52748
420         * parser.c (complain_flags): New.
421         (cp_parser_postfix_expression): Use it.
422         (cp_parser_unary_expression): Likewise.
423         (cp_parser_binary_expression): Likewise.
424         (cp_parser_assignment_expression): Likewise.
425         (cp_parser_expression): Likewise.
426         (cp_parser_postfix_open_square_expression): Take decltype_p.
427         (cp_parser_builtin_offsetof): Adjust.
428         (cp_convert_range_for): Pass complain to finish_unary_op_expr.
429         * decl2.c (grok_array_decl): Add decltype_p parm.
430         * cp-tree.h: Adjust prototype.
431         * semantics.c (finish_unary_op_expr): Add complain parm.
433 2013-04-11  Jakub Jelinek  <jakub@redhat.com>
435         PR c++/56895
436         * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
437         calling maybe_constant_value for C++98.
439 2013-04-11  Jason Merrill  <jason@redhat.com>
441         PR c++/56901
442         * semantics.c (lambda_capture_field_type, lambda_proxy_type):
443         Strip references before checking WILDCARD_TYPE_P.
445 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
447         * call.c (build_conditional_expr_1, build_over_call): Protect
448         error calls with complain & tf_error.
449         * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
450         build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
451         build_ptrmemfunc): Likewise.
452         (lookup_destructor): Take tsubst_flags_t parameter, adjust.
454         * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
455         (convert_to_reference): Adjust.
457 2013-04-11  Jason Merrill  <jason@redhat.com>
459         * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
460         local variables, look them up instead.
461         (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
462         proxies and substitution in unevaluated context.
463         (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
464         before the iterators.
466         PR c++/23055
467         * pt.c (uses_deducible_template_parms): New.
468         (deducible_array_bound, deducible_expression): New.
469         (deducible_template_args): New.
470         (unify_one_argument): Call uses_deducible_template_parms.
472 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
474         PR c++/56913
475         * typeck2.c (build_m_component_ref): Protect error calls with
476         (complain & tf_error).
478 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
480         PR c++/54216
481         * parser.c (cp_parser_enum_specifier): Check for empty
482         anonymous enums and anonymous scoped enums.
484 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
486         PR c++/56895
487         * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
488         first before calling maybe_constant_value for warn_for_div_by_zero
489         or invalid shift count warning purposes.
491 2013-04-09  Jason Merrill  <jason@redhat.com>
493         PR c++/25466
494         * rtti.c (build_typeid): Check the address of the argument
495         rather than looking for an INDIRECT_REF.
497 2013-04-04  Jason Merrill  <jason@redhat.com>
499         PR c++/56838
500         PR c++/17232
501         * typeck2.c (abstract_virtuals_error_sfinae): Disable
502         complete_type again.
504 2013-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
506         PR c++/56871
507         * decl.c (validate_constexpr_redeclaration): Allow an explicit
508         specialization to be different wrt the constexpr specifier.
510 2013-04-06  Jason Merrill  <jason@redhat.com>
512         * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
513         noreturn attribute.
515 2013-04-05  Ed Smith-Rowland  <3dw4rd@verizon.net>
517         * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
518         cp_parser_ref_qualifier_opt.  Error if more than one ref-qual found.
520 2013-04-03  Jason Merrill  <jason@redhat.com>
522         * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
523         (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
524         (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
526         * mangle.c (write_type): When writing a function type with
527         function-cv-quals, don't add the unqualified type as a
528         substitution candidate.
530 2013-04-03  Paolo Carlini  <paolo.carlini@oracle.com>
532         PR c++/56815
533         * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
534         pedwarn.
536 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
538         PR debug/56819
539         * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
540         from args to new_args.
541         (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
542         r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
544 2013-04-02  Jason Merrill  <jason@redhat.com>
546         PR c++/56821
547         * mangle.c (write_function_type): Mangle ref-qualifier.
548         (write_nested_name): Likewise.
549         (canonicalize_for_substitution): Preserve ref-qualifier.
550         (write_type): Likewise.
552         PR c++/34949
553         * decl.c (begin_destructor_body): Clobber the object in a cleanup.
555 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
557         * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
558         * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
559         (for_each_template_parm_r): Use TYPE_TI_ARGS.
561 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
563         * cp-tree.h (TAGGED_TYPE_P): Remove.
564         (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
565         (TYPE_ANONYMOUS_P): Adjust.
566         * call.c (build_new_op_1): Likewise.
567         * class.c (find_abi_tags_r): Likewise.
568         * decl.c (warn_misplaced_attr_for_class_type, start_decl,
569         type_is_deprecated): Likewise.
570         * decl2.c (grokfield, min_vis_r): Likewise.
571         * pt.c (get_template_info): Likewise.
572         * tree.c (handle_abi_tag_attribute): Likewise.
574 2013-04-01  Jason Merrill  <jason@redhat.com>
576         * semantics.c (maybe_constant_value): Check
577         instantiation_dependent_expression_p.
578         * pt.c (build_non_dependent_expr): Don't check it here.
580         PR c++/56772
581         * init.c (build_new): Don't try to process an array initializer
582         at template definition time.
584         PR c++/56793
585         * typeck.c (finish_class_member_access_expr): Handle enum scope.
587         PR c++/56794
588         * parser.c (cp_parser_range_for): Don't try to do auto deduction
589         in a template if the type of the range is incomplete.
591         * call.c (add_function_candidate): Take the address of 'this' here.
592         (build_over_call): And here.
593         (build_new_method_call_1, build_op_call_1): Not here.
594         (build_user_type_conversion_1): Or here.
595         (add_candidates): Adjust.
597         * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
598         * class.c (same_signature_p): Use type_memfn_quals.
599         * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
600         FUNCTION_OR_METHOD_TYPE_CHECK.
601         * error.c (dump_type_suffix): Add padding before cv-qualifiers.
602         * pt.c (unify): Use static_fn_type.
604 2013-04-01  Bronek Kozicki <b.kozicki@gmail.com>
605             Jason Merrill  <jason@redhat.com>
607         Implement N2439 (ref-qualifiers for 'this')
608         * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
609         (FUNCTION_RVALUE_QUALIFIED): New.
610         (FUNCTION_OR_METHOD_TYPE_CHECK): New.
611         (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
612         (cp_ref_qualifier): New enum.
613         (cp_declarator): Add ref_qualifier.
614         * parser.c (cp_parser_ref_qualifier_seq_opt): New.
615         (cp_parser_direct_declarator): Use it.
616         (make_call_declarator): Adjust.
617         (cp_parser_lambda_declarator_opt): Adjust.
618         * call.c (add_function_candidate): Handle ref-qualifier overload
619         resolution semantics.
620         (standard_conversion): Adjust.
621         * class.c (add_method, same_signature_p): Compare ref-qualifiers.
622         * decl.c (grokdeclarator): Handle ref-qualifiers.
623         (grokfndecl): Check for invalid ref-qualifiers.
624         (static_fn_type, revert_static_member_fn): Adjust.
625         * decl2.c (build_memfn_type): Handle ref-qualifiers.
626         (check_classfn): Check them.
627         (cp_reconstruct_complex_type): Retain them.
628         * error.c (dump_ref_qualifier): New.
629         (dump_type_suffix, dump_function_decl): Use it.
630         (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
631         * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
632         (unify): Retain them.
633         * tree.c (cp_check_qualified_type): New.
634         (cp_build_qualified_type_real): Keep exception spec and ref-qual.
635         (build_ref_qualified_type): New.
636         (strip_typedefs, build_exception_variant): Keep ref-qualifier.
637         (cp_build_type_attribute_variant): Keep ref-qualifier.
638         * typeck.c (merge_types): Keep ref-qualifier.
639         (structural_comptypes): Compare ref-qualifier.
640         (type_memfn_rqual): New.
641         (apply_memfn_quals): Take ref-qual argument.
642         * typeck2.c (build_m_component_ref): Check ref-qualifier.
644 2013-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
646         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
647         (DECL_FUNCTION_TEMPLATE_P): Adjust.
649         * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
650         pp_cxx_qualified_id): Use get_containing_scope.
651         * parser.c (cp_parser_class_head): Likewise.
652         * pt.c (push_template_decl_real): Likewise.
654         * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
655         * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
657 2013-03-31  Paolo Carlini  <paolo.carlini@oracle.com>
659         * decl2.c (collect_candidates_for_java_method_aliases): Use
660         DECL_CLASS_SCOPE_P.
661         * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
662         (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
663         * decl.c (duplicate_decls): Likewise.
664         * parser.c (cp_parser_template_declaration_after_export): Likewise,
665         also DECL_DECLARES_TYPE_P.
666         * pt.c (instantiate_class_template_1): Likewise.
667         * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
668         (lookup_field_r): Likewise.
669         (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
670         (lookup_fnfields_slot_nolazy): Likewise.
671         * semantics.c (finish_member_declaration): Likewise.
672         * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
674 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
676         * pt.c (template_parms_to_args): Fix typo in comment.
678 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
680         * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
682 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
684         * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
685         (build_op_call_1): Likewise.
686         (build_over_call): Likewise.
687         (compare_ics): Likewise.
688         * class.c (build_base_path): Likewise.
689         (resolve_address_of_overloaded_function): Likewise.
690         * cp-tree.h: Likewise.
691         * cvt.c (cp_convert_to_pointer): Likewise.
692         (convert_to_reference): Likewise.
693         (ocp_convert): Likewise.
694         (convert_force): Likewise, tidy.
695         * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
696         (pp_cxx_ptr_operator): Likewise.
697         * decl.c (duplicate_decls): Likewise.
698         (start_decl): Likewise.
699         (grok_op_properties): Likewise.
700         (start_preparsed_function): Likewise.
701         (store_parm_decls): Likewise.
702         (finish_function): Likewise.
703         * decl2.c (delete_sanity): Likewise.
704         (acceptable_java_type): Likewise.
705         (grokbitfield): Likewise.
706         (cp_reconstruct_complex_type): Likewise.
707         * error.c (dump_type_prefix): Likewise.
708         (dump_expr): Likewise.
709         * except.c (push_eh_cleanup): Likewise.
710         (complete_ptr_ref_or_void_ptr_p): Likewise.
711         (can_convert_eh): Likewise.
712         * init.c (build_new_1): Likewise.
713         (build_delete): Likewise.
714         (build_vec_delete): Likewise.
715         * mangle.c (write_type): Likewise.
716         * parser.c (lookup_literal_operator): Likewise.
717         * pt.c (convert_nontype_argument_function): Likewise.
718         (convert_nontype_argument): Likewise.
719         (tsubst): Likewise.
720         (unify): Likewise.
721         (dependent_type_p_r): Likewise.
722         * rtti.c (build_headof): Likewise.
723         (build_typeid): Likewise.
724         (build_dynamic_cast_1): Likewise.
725         (target_incomplete_p): Likewise.
726         (typeinfo_in_lib_p): Likewise.
727         * semantics.c (finish_omp_for): Likewise.
728         (cxx_eval_call_expression): Likewise.
729         (maybe_resolve_dummy): Likewise.
730         * tree.c (build_target_expr): Likewise.
731         (cp_build_qualified_type_real): Likewise.
732         * typeck.c (composite_pointer_type_r): Likewise.
733         (composite_pointer_type): Likewise.
734         (comp_except_types): Likewise.
735         (cxx_sizeof_nowarn): Likewise.
736         (string_conv_p): Likewise.
737         (cp_build_array_ref): Likewise.
738         (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
739         (pointer_diff): Likewise.
740         (cp_build_addr_expr_1): Likewise.
741         (cp_build_unary_op): Likewise.
742         (build_static_cast_1): Likewise.
743         (cp_build_c_cast): Likewise.
744         (comp_ptr_ttypes_real): Likewise.
745         (ptr_reasonably_similar): Likewise.
746         (comp_ptr_ttypes_const): Likewise.
747         (casts_away_constness): Likewise.
748         (check_literal_operator_args): Likewise.
749         * typeck2.c (build_x_arrow): Likewise.
750         (add_exception_specifier): Likewise.
752 2013-03-29  Jason Merrill  <jason@redhat.com>
754         N3582
755         * cp-tree.h (AUTO_IS_DECLTYPE): New.
756         * parser.c (cp_parser_decltype): Handle decltype(auto).
757         (cp_parser_type_id_1): Allow auto without a late-specified
758         return in C++1y.
759         (cp_parser_primary_expression): Use the return value of
760         finish_parenthesized_expr.
761         (cp_parser_transaction_expression): Likewise.
762         * semantics.c (force_paren_expr): New.
763         (finish_parenthesized_expr): Use it.
764         * call.c (build_conditional_expr_1): Likewise.
765         * pt.c (do_auto_deduction): Handle decltype(auto).
766         (tsubst_copy): Handle PAREN_EXPR.
767         (tsubst_copy_and_build): Likewise.
768         * error.c (dump_expr): Handle PAREN_EXPR.
769         * cxx-pretty-print.c (pp_cxx_expression): Likewise.
770         * mangle.c (write_expression): Ignore PAREN_EXPR.
772         * parser.c (cp_parser_decltype_expr): Split out...
773         (cp_parser_decltype): ...from here.
775         PR c++/56774
776         PR c++/35722
777         * pt.c (unify_pack_expansion): Fix indexing.
779 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
781         * call.c (build_java_interface_fn_ref): Likewise.
782         (make_temporary_var_for_ref_to_temp): Likewise.
783         * class.c (check_field_decls): Likewise.
784         (layout_class_type): Likewise.
785         (finish_struct_1): Likewise.
786         (fixed_type_or_null): Likewise.
787         (get_vtbl_decl_for_binfo): Likewise.
788         * cp-gimplify.c (omp_var_to_track): Likewise.
789         (cp_genericize_r): Likewise.
790         * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
791         * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
792         (DECL_DISCRIMINATOR_P): Likewise.
793         * decl.c (poplevel): Likewise.
794         (decls_match): Likewise.
795         (duplicate_decls): Likewise.
796         (decl_jump_unsafe): Likewise.
797         (start_decl): Likewise.
798         (check_for_uninitialized_const_var): Likewise.
799         (make_rtl_for_nonlocal_decl): Likewise.
800         (cp_finish_decl): Likewise.
801         (expand_static_init): Likewise.
802         (local_variable_p): Likewise.
803         (maybe_register_incomplete_var): Likewise.
804         * decl2.c (grokfield): Likewise.
805         (comdat_linkage): Likewise.
806         (determine_visibility): Likewise.
807         (import_export_decl): Likewise.
808         (prune_vars_needing_no_initialization): Likewise.
809         (decl_maybe_constant_var_p): Likewise.
810         * error.c (dump_simple_decl): Likewise.
811         (dump_template_decl): Likewise.
812         (cp_printer): Likewise.
813         * except.c (build_throw): Likewise.
814         * init.c (build_vtbl_address): Likewise.
815         (member_init_ok_or_else): Likewise.
816         (build_aggr_init): Likewise.
817         (expand_aggr_init_1): Likewise.
818         (build_offset_ref): Likewise.
819         (constant_value_1): Likewise.
820         * mangle.c (write_mangled_name): Likewise.
821         (write_prefix): Likewise.
822         * name-lookup.c (supplement_binding_1): Likewise.
823         (add_decl_to_level): Likewise.
824         (pushdecl_maybe_friend_1): Likewise.
825         (check_for_out_of_scope_variable): Likewise.
826         (validate_nonmember_using_decl): Likewise.
827         (lookup_name_innermost_nonclass_level_1): Likewise.
828         (lookup_arg_dependent_1): Likewise.
829         * parser.c (cp_parser_lambda_introducer): Likewise.
830         (cp_parser_template_argument): Likewise.
831         (cp_parser_single_declaration): Likewise.
832         * pt.c (convert_nontype_argument): Likewise.
833         (instantiate_class_template_1): Likewise.
834         (tsubst_decl): Likewise.
835         (tsubst_expr): Likewise.
836         (do_decl_instantiation): Likewise.
837         (do_type_instantiation): Likewise.
838         (regenerate_decl_from_template): Likewise.
839         (always_instantiate_p): Likewise.
840         (instantiate_decl): Likewise.
841         (type_dependent_expression_p): Likewise.
842         (build_non_dependent_expr): Likewise.
843         * repo.c (repo_emit_p): Likewise.
844         * rtti.c (build_dynamic_cast_1): Likewise.
845         * search.c (shared_member_p): Likewise.
846         * semantics.c (outer_var_p): Likewise.
847         (finish_id_expression): Likewise.
848         (finish_omp_clauses): Likewise.
849         (finish_decltype_type): Likewise.
850         (ensure_literal_type_for_constexpr_object): Likewise.
851         * tree.c (lvalue_kind): Likewise.
852         (bot_replace): Likewise.
853         (cp_tree_equal): Likewise.
854         (handle_init_priority_attribute): Likewise.
855         (decl_storage_duration): Likewise.
856         * typeck.c (cxx_sizeof_expr): Likewise.
857         (cxx_alignof_expr): Likewise.
858         (decay_conversion): Likewise.
859         (build_class_member_access_expr): Likewise.
860         (cp_build_array_ref): Likewise.
861         (cxx_mark_addressable): Likewise.
862         (maybe_warn_about_returning_address_of_local): Likewise.
863         (check_return_expr): Likewise.
864         * typeck2.c (cxx_readonly_error): Likewise.
865         (abstract_virtuals_error_sfinae): Likewise.
866         (cxx_incomplete_type_diagnostic): Likewise.
868 2013-03-28  Lawrence Crowl  <crowl@google.com>
870         * Make-lang.in
871         (CXX_PARSER_H): Add header dependence.
872         * cp-tree.h
873         (extern debug (cp_binding_level &)): New.
874         (extern debug (cp_binding_level *)): New.
875         * name-lookup.h
876         (debug (cp_binding_level &)): New.
877         (debug (cp_binding_level *)): New.
878         * parser.c
879         (debug (cp_parser &)): New.
880         (debug (cp_parser *)): New.
881         (debug (cp_token &)): New.
882         (debug (cp_token *)): New.
883         (debug (vec<cp_token, va_gc> &)): New.
884         (debug (vec<cp_token, va_gc> *)): New.
885         * parser.c: Add header dependence.
886         (extern debug (cp_parser &)): New.
887         (extern debug (cp_parser *)): New.
888         (extern debug (cp_token &)): New.
889         (extern debug (cp_token *)): New.
890         (extern debug (vec<cp_token, va_gc> &)): New.
891         (extern debug (vec<cp_token, va_gc> *)): New.
893 2013-03-28  Jason Merrill  <jason@redhat.com>
895         PR c++/17232
896         PR c++/52748
897         * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
898         the type if tf_decltype is set.
899         * pt.c (fn_type_unification): Add decltype_p parm.
900         (get_bindings): Adjust.
901         * cp-tree.h: Adjust.
902         * class.c (resolve_address_of_overloaded_function): Adjust.
903         * call.c (add_template_candidate_real, print_z_candidate): Adjust.
905         PR c++/56679
906         * parser.c (cp_parser_sizeof_pack): Split out from...
907         (cp_parser_sizeof_operand): ...here.  Require (id).
909         PR c++/56701
910         * semantics.c (finish_this_expr): 'this' is an rvalue.
911         * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
913         PR c++/56710
914         * semantics.c (finish_member_declaration): Don't push closure
915         members.
917         * name-lookup.c (pushdecl_maybe_friend_1): Use
918         nonlambda_method_basetype and current_nonlambda_class_type.
920         PR c++/56728
921         * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
922         conversion from integer to pointer.
923         (cxx_eval_constant_expression): Likewise.
924         (cxx_eval_indirect_ref): Use the folded operand if we still think
925         this might be constant.
927 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
928             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
930         PR c++/56725
931         * call.c (convert_like_real): Change series of two permerrors
932         to permerror + inform (and likewise for two errors).
933         (build_new_method_call_1): Likewise.
934         * typeck.c (convert_for_initialization): Change additional
935         warning or error to inform.
937 2013-03-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
939         * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
940         (first_aggr_init_expr): Likewise.
941         (more_aggr_init_expr_args_p): Likewise.
942         (type_of_this_parm): Likewise.
943         (class_of_this_parm): Likewise.
944         * name-lookup.h (get_global_value_if_present): Likewise.
945         (is_typename_at_global_scope): Likewise.
947 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
949         * call.c (joust): Don't call inform for a permerror returning false.
950         * parser.c (cp_parser_check_class_key): Likewise.
951         * pt.c (tsubst_copy_and_build): Likewise.
953 2013-03-27  Jason Merrill  <jason@redhat.com>
955         PR c++/56749
956         * semantics.c (finish_qualified_id_expr): Return early
957         for enum scope.
959 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
961         * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
962         * cvt.c (convert_to_void): Likewise.
963         * error.c (dump_expr): Likewise.
964         * mangle.c (write_expression): Likewise.
965         * parser.c (cp_parser_template_argument): Likewise.
966         * pt.c (convert_nontype_argument): Likewise.
967         (tsubst_copy_and_build): Likewise.
968         * rtti.c (build_typeid): Likewise.
969         * semantics.c (finish_call_expr): Likewise.
970         (finish_decltype_type): Likewise.
971         (build_data_member_initialization): Likewise.
972         * tree.c (is_dummy_object): Likewise.
973         * typeck.c (decay_conversion): Likewise.
974         (build_class_member_access_expr): Likewise.
975         (cp_build_addr_expr_1): Likewise.
976         (unary_complex_lvalue): Likewise.
977         (check_return_expr): Likewise.
978         * typeck2.c (cxx_readonly_error): Likewise.
980 2013-03-26  Jason Merrill  <jason@redhat.com>
982         PR c++/52597
983         * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn.  Take tree.
984         * semantics.c (finish_decltype_type): Check it before type_unknown_p.
985         * cp-tree.h: Adjust prototype.
987         PR c++/45282
988         * typeck2.c (build_m_component_ref): Handle prvalue object.
990 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
992         * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
993         * decl.c (duplicate_decls): Likewise.
994         (cp_finish_decl): Likewise.
995         (check_class_member_definition_namespace): Likewise.
996         * decl2.c (grokfield): Likewise.
997         (decl_needed_p): Likewise.
998         (import_export_decl): Likewise.
999         (mark_used): Likewise.
1000         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1001         * pt.c (push_access_scope): Likewise.
1002         (instantiate_decl): Likewise.
1003         * ptree.c (cxx_print_decl): Likewise.
1004         * repo.c (repo_emit_p): Likewise.
1005         * semantics.c (note_decl_for_pch): Likewise.
1006         * tree.c (decl_linkage): Likewise.
1008 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
1010         PR c++/55951
1011         * decl.c (check_array_designated_initializer): Handle CONST_DECL
1012         as ce->index.
1014 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
1016         * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1017         error messages.
1019         * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1021 2013-03-25  Jason Merrill  <jason@redhat.com>
1023         PR c++/56699
1024         * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1025         class is derived from the type of the object.
1027         PR c++/52014
1028         * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1029         unevaluated context.
1031 2013-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
1033         PR c++/56722
1034         * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1035         DECL_TEMPLATE_INSTANTIATION.
1037 2013-03-22  Jason Merrill  <jason@redhat.com>
1039         PR c++/56684
1040         * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1041         and CONST_DECL.
1043 2013-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1045         * cp-tree.h (identifier_p): New.
1046         * call.c: Throughout, call identifier_p insstead of direct
1047         comparaison of TREE_CODE against IDENTIFIER_NODE.
1048         * decl.c: Likewisse.
1049         * decl2.c: Likewise.
1050         * init.c: Likewise.
1051         * mangle.c: Likewise.
1052         * name-lookup.c: Likewise.
1053         * parser.c: Likewise.
1054         * pt.c: Likewise.
1055         * search.c: Likewise.
1056         * semantics.c: Likewise.
1057         * tree.c: Likewise.
1058         * typeck.c: Likewise.
1059         * typeck2.c: Likewise.
1061 2013-03-21  Jakub Jelinek  <jakub@redhat.com>
1063         PR middle-end/48087
1064         * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1065         * call.c (build_temp): Likewise.
1066         * method.c (synthesize_method): Likewise.
1067         * typeck.c (convert_for_initialization): Likewise.
1069 2013-03-21  Marc Glisse  <marc.glisse@inria.fr>
1071         * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
1073 2013-03-21  Richard Biener  <rguenther@suse.de>
1075         * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
1076         DECL_DEBUG_EXPR_IS_FROM.  Guard properly.
1078 2013-03-20  Jason Merrill  <jason@redhat.com>
1080         PR c++/56646
1081         * parser.c (cp_parser_late_return_type_opt): Save and restore
1082         current_class_ptr/ref.
1084         PR c++/54532
1085         * expr.c (cplus_expand_constant): Do nothing if the class is
1086         incomplete.
1087         * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1088         * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1089         * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1090         (complete_vars): Likewise.
1092         * name-lookup.c (get_anonymous_namespace_name): Never use
1093         get_file_function_name.
1095         * pt.c (retrieve_specialization): Handle null tmpl argument.
1097         PR c++/17232
1098         PR c++/56642
1099         * pt.c (tsubst_decl): Check return value of register_specialization.
1100         * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1101         change.
1103 2013-03-17  Jason Merrill  <jason@redhat.com>
1105         PR c++/54359
1106         PR c++/56639
1107         * parser.c (cp_parser_direct_declarator): Bail if we see a
1108         qualified-id not at namespace scope.
1110         PR c++/17232
1111         PR c++/56642
1112         * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1113         change for now.
1115 2013-03-16  Jason Merrill  <jason@redhat.com>
1117         * decl.c (grokdeclarator): Assert that we won't see a pointer to
1118         METHOD_TYPE.
1120         PR c++/54277
1121         * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1122         (MAYBE_CLASS_TYPE_P): ...here.
1123         * semantics.c (lambda_capture_field_type): Only build a
1124         magic decltype for wildcard types.
1125         (lambda_proxy_type): Likewise.
1126         (finish_non_static_data_member): Get the quals from
1127         the object.
1129         PR c++/55931
1130         * parser.c (cp_parser_template_argument): Don't
1131         fold_non_dependent_expr.
1133         * parser.c (cp_parser_lambda_declarator_opt): Use
1134         cp_parser_trailing_type_id.
1136         PR c++/45917
1137         * parser.c (cp_parser_template_id): Don't forget access checks.
1139         PR c++/52374
1140         * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1142         PR c++/54764
1143         PR c++/55972
1144         * name-lookup.h (tag_scope): Add ts_lambda.
1145         * semantics.c (begin_lambda_type): Use it.
1146         * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1147         * pt.c (check_default_tmpl_args): Ignore lambdas.
1148         (push_template_decl_real): Handle lambdas.
1149         * tree.c (no_linkage_check): Adjust lambda check.
1151         PR c++/56039
1152         * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1154         PR c++/54359
1155         * parser.c (cp_parser_direct_declarator): Fix late return
1156         for out-of-class defn of member function.
1158         PR c++/55357
1159         * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1160         parms to avoid duplicate -Wshadow warnings.
1162         * search.c (lookup_base): Handle NULL_TREE.
1164         PR c++/56481
1165         * semantics.c (potential_constant_expression_1): Use of 'this' in
1166         a non-constexpr function makes the expression not potentially
1167         constant.
1169         N3276
1170         PR c++/52748
1171         * cp-tree.h (tsubst_flags): Add tf_decltype.
1172         * call.c (build_cxx_call): Don't build a temporary if it's set.
1173         (build_over_call): Make sure it's only passed to build_cxx_call.
1174         * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1175         (cp_parser_unary_expression): Likewise.
1176         (cp_parser_cast_expression): Likewise.
1177         (cp_parser_binary_expression): Likewise.
1178         (cp_parser_assignment_expression): Likewise.
1179         (cp_parser_postfix_expression): Likewise.  Pass tf_decltype.
1180         (cp_parser_expression): Add decltype_p.  Force a
1181         temporary for a call on the LHS of a comma.
1182         (cp_parser_decltype): Pass true to decltype_p parms.
1183         * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1184         (tsubst_copy_and_build): Pass tf_decltype down only for
1185         CALL_EXPR and the RHS of COMPOUND_EXPR.
1186         * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1188         * cp-tree.h (abstract_class_use): New enum.
1189         * typeck2.c (pending_abstract_type): Add use field.
1190         (abstract_virtuals_error_sfinae): Add overloads taking
1191         abstract_class_use instead of tree.
1192         * typeck.c (build_static_cast_1): Call it.
1193         * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1194         * pt.c: Adjust calls.
1195         * decl.c (cp_finish_decl): Don't handle functions specially.
1196         (grokdeclarator): Always check return type.
1197         * init.c (build_new_1): Adjust call.
1199         DR 337
1200         PR c++/17232
1201         * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1202         * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1204         DR 657
1205         * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1206         (tsubst_arg_types): Likewise.
1208         DR 1518
1209         PR c++/54835
1210         * call.c (convert_like_real): Check for explicit constructors
1211         even for value-initialization.
1213         PR c++/54946
1214         * pt.c (convert_nontype_argument): Handle invalid pointer.
1216         * parser.c (cp_parser_lambda_expression): Use nreverse.
1218         PR c++/56447
1219         PR c++/55532
1220         * pt.c (instantiate_class_template_1): Instantiate lambda capture
1221         list here.
1222         (tsubst_copy_and_build): Not here.
1224         PR c++/55017
1225         * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1227         PR c++/55240
1228         * parser.c (parsing_nsdmi): New.
1229         * semantics.c (outer_automatic_var_p): Check it.
1230         (finish_id_expression): Likewise.
1231         * cp-tree.h: Declare it.
1233         PR c++/55241
1234         * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1236         * parser.c (lookup_literal_operator): Correct parm/arg naming
1237         mixup.
1239         PR c++/56238
1240         * pt.c (fold_non_dependent_expr_sfinae): Check
1241         instantiation_dependent_expression_p.
1243         PR c++/56095
1244         * class.c (resolve_address_of_overloaded_function): Accept a
1245         reference to function for target_type.
1246         (instantiate_type): Likewise.
1247         * pt.c (convert_nontype_argument): Pass it to
1248         convert_nontype_argument_function.
1250 2013-03-16  Jakub Jelinek  <jakub@redhat.com>
1252         * tree.c (cp_tree_equal): Fix a pasto.
1254         PR c++/56607
1255         * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1256         pass op1 through maybe_constant_value first.
1258 2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>
1260         PR c++/56582
1261         * semantics.c (cxx_eval_array_reference): Check for negative index.
1263 2013-03-14  Jason Merrill  <jason@redhat.com>
1265         PR c++/56614
1266         * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1268         PR c++/56346
1269         * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1270         dso_handle parm on targets without __cxa_atexit.
1272 2013-03-11  Jason Merrill  <jason@redhat.com>
1274         PR c++/56567
1275         * typeck.c (check_return_expr): Disallow returning init list here.
1276         * semantics.c (apply_deduced_return_type): Not here.
1278 2013-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
1280         PR c++/51412
1281         * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1282         * error.c (dump_expr): Likewise.
1284 2013-03-08  Jason Merrill  <jason@redhat.com>
1286         PR c++/51884
1287         * class.c (modify_all_vtables): Mangle the vtable name before
1288         entering dfs_walk.
1290         * semantics.c (lambda_expr_this_capture): In unevaluated context,
1291         just return the nearest 'this'.
1293         PR c++/51494
1294         PR c++/52183
1295         PR c++/56222
1296         * tree.c (maybe_dummy_object): Don't capture 'this'.
1297         * semantics.c (maybe_resolve_dummy): New.
1298         (finish_non_static_data_member): Use it.
1299         (finish_qualified_id_expr): Don't test is_dummy_object.
1300         * cp-tree.h: Declare maybe_resolve_dummy.
1301         * call.c (build_new_method_call_1): Use it.
1303         PR c++/56567
1304         * semantics.c (apply_deduced_return_type): Don't allow returning
1305         std::initializer_list.
1307 2013-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
1309         PR c++/56534
1310         * parser.c (cp_parser_elaborated_type_specifier): Don't call
1311         check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1312         * decl.c (check_elaborated_type_specifier): Tidy.
1314 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
1316         PR c++/56543
1317         * tree.c (strip_typedefs): Don't copy args if they are NULL.
1319 2013-03-05  Jakub Jelinek  <jakub@redhat.com>
1321         * parser.c (cp_parser_braced_list): For {} initialize
1322         *non_constant_p to false.
1324 2013-03-04  Jason Merrill  <jason@redhat.com>
1326         PR c++/56464
1327         PR c++/54383
1328         * semantics.c (lambda_expr_this_capture): Handle NSDMI
1329         and non-class scopes.
1331 2013-03-01  Paolo Carlini  <paolo.carlini@oracle.com>
1333         * decl.c (grokdeclarator): Remove dead code.
1335 2013-02-28  Jason Merrill  <jason@redhat.com>
1337         PR c++/56481
1338         * semantics.c (potential_constant_expression_1): Use
1339         cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1341         PR c++/56243
1342         * call.c (build_over_call): Avoid virtual lookup in a template.
1344 2013-02-27  Jason Merrill  <jason@redhat.com>
1346         PR c++/56358
1347         PR c++/56323
1348         * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1349         of the base name for inheriting ctors.
1350         (push_class_level_binding_1): Remove inheriting ctor handling.
1351         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1352         * class.c (add_implicitly_declared_members): Adjust.
1354 2013-02-26  David Binderman  <dcb314@hotmail.com>
1356         PR c++/55632
1357         * decl.c (grokdeclarator): Tidy publicp assignment.
1359 2013-02-25  Aldy Hernandez  <aldyh@redhat.com>
1361         PR c++/56419
1362         * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1363         (build_transaction_expr): Same.
1365 2013-02-25  Jason Merrill  <jason@redhat.com>
1367         PR c++/56377
1368         * pt.c (fn_type_unification): Wait to call push_tinst_level until
1369         we know what args we're looking at.
1371         PR c++/56438
1372         * semantics.c (potential_constant_expression_1): In C++98, a cast
1373         to non-integral type can't be a constant expression.
1375 2013-02-24  Jakub Jelinek  <jakub@redhat.com>
1377         PR c++/56403
1378         * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1379         of CLASS_TYPE_P.
1381 2013-02-22  Jason Merrill  <jason@redhat.com>
1383         PR c++/40405
1384         * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1385         if we got the wrong number of template parms.
1387         PR c++/56377
1388         * pt.c (fn_type_unification): Use explicit args in template
1389         instantiation context.
1391         PR c++/56359
1392         * call.c (can_convert_arg): Discard access checks.
1394         PR c++/56395
1395         * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1396         args.
1398 2013-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
1400         PR c++/56373
1401         * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1402         * cvt.c (ocp_convert): Use the latter.
1403         (cp_convert_to_pointer): Likewise.
1404         * decl.c (check_default_argument): Likewise.
1405         * typeck.c (cp_build_binary_op): Likewise.
1406         * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1408 2013-02-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
1409             Paolo Carlini  <paolo.carlini@oracle.com>
1411         PR c++/51242
1412         * decl2.c (grokbitfield): Allow scoped enumeration types.
1414 2013-02-15  Jason Merrill  <jason@redhat.com>
1416         PR c++/54276
1417         * semantics.c (finish_id_expression): Also return the identifier
1418         for an outer local static.
1420         PR c++/56343
1421         * class.c (check_bases_and_members): Deduce noexcept after
1422         checking bases.
1424         PR c++/52026
1425         * semantics.c (finish_id_expression): In a template, return
1426         the identifier for a constant variable.
1428 2013-02-14  Jason Merrill  <jason@redhat.com>
1430         PR c++/54922
1431         * semantics.c (build_anon_member_initialization): New.
1432         (build_data_member_initialization): Use it.
1434         PR c++/55003
1435         * decl.c (cp_finish_decl): Force instantiation of an
1436         auto static data member.
1438         PR c++/55220
1439         * pt.c (unify): A pack expansion that is not the last template
1440         argument makes the entire template argument list non-deduced.
1442         PR c++/56323
1443         * name-lookup.c (do_class_using_decl): Handle typedefs with
1444         inheriting constructors.
1445         (push_class_level_binding_1): Allow inheriting from template
1446         template parameter, too.
1447         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1449         PR c++/55223
1450         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1451         default argument scope.
1452         * mangle.c (write_name): Likewise.
1454         PR c++/55232
1455         * error.c (find_typenames_r): Don't walk into a pack expansion.
1457 2013-02-13  Jason Merrill  <jason@redhat.com>
1459         PR c++/55670
1460         * parser.c (cp_parser_member_declaration): Check the declarator
1461         form when detecting a function declaration via typedef.
1463         PR c++/55680
1464         * pt.c (maybe_process_partial_specialization): A lambda
1465         isn't what's being specialized.
1467         PR c++/55710
1468         * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1469         TREE_USED.
1471         PR c++/55879
1472         * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1474         PR c++/55993
1475         * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1476         non-zero offsets, too.
1478         PR c++/56155
1479         * decl.c (build_enumerator): Always convert the value to a
1480         fixed underlying type.
1482         PR c++/56135
1483         * pt.c (tsubst_copy_and_build): Don't forget any new
1484         captures that arose from use of dependent names.
1486 2013-02-13  Jakub Jelinek  <jakub@redhat.com>
1488         PR c++/56302
1489         * semantics.c (finish_asm_stmt): If input constraints allow
1490         neither register nor memory, try maybe_constant_value to get
1491         a constant if possible.
1493 2013-02-12  Jason Merrill  <jason@redhat.com>
1495         PR c++/56285
1496         * method.c (add_one_base_init): Handle base constructor
1497         taking rvalue reference parm.
1499         PR c++/56291
1500         * semantics.c (sort_constexpr_mem_initializers): Handle
1501         vptr out of order.
1503 2013-02-09  Jason Merrill  <jason@redhat.com>
1505         PR c++/56268
1506         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1507         maybe_instantiate_noexcept.
1509         PR c++/56247
1510         * pt.c (eq_specializations): Set comparing_specializations.
1511         * tree.c (cp_tree_equal): Check it.
1512         * cp-tree.h: Declare it.
1514         * decl.c (decls_match): Check versions later.
1516         PR c++/56238
1517         * pt.c (build_non_dependent_expr): Don't try to fold
1518         instantiation-dependent expressions.
1519         (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1520         [BIND_EXPR]: Treat as dependent.
1522 2013-02-07  Jakub Jelinek  <jakub@redhat.com>
1524         PR c++/56241
1525         * init.c (build_vec_init): Don't append NULL values into new_vec.
1526         (build_zero_init_1): Don't push anything into v if recursive call
1527         returned NULL_TREE.
1528         (build_value_init_noctor): Don't push anything into v if
1529         build_value_init call returned NULL_TREE.
1531         PR c++/56239
1532         * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1533         (cp_parser_tokens_start_cast_expression): ... this.  Change parameter
1534         to cp_parser *, call cp_lexer_peek_token first.  For CPP_OPEN_PAREN,
1535         return true only if 2nd token isn't CPP_CLOSE_PAREN.
1536         (cp_parser_cast_expression): Adjust caller.
1538         PR c++/56237
1539         * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1540         only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1541         DECL_LANG_SPECIFIC (t).
1543 2013-02-07  Jason Merrill  <jason@redhat.com>
1545         PR c++/56235
1546         * method.c (do_build_copy_constructor): Don't bother turning
1547         scalars from lvalues to xvalues.
1548         (do_build_copy_assign): Likewise.
1550 2013-02-06  Jason Merrill  <jason@redhat.com>
1552         * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1554 2013-02-05  Jason Merrill  <jason@redhat.com>
1556         PR c++/54122
1557         * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1558         METHOD_TYPE.
1560         PR c++/56177
1561         * decl.c (start_preparsed_function): Update restype if we change
1562         decl1.
1564         PR c++/56208
1565         * pt.c (fn_type_unification): Discard any access checks from
1566         substituting explicit args.
1568 2013-01-31  Jason Merrill  <jason@redhat.com>
1570         PR c++/56162
1571         PR c++/56104
1572         * typeck.c (get_member_function_from_ptrfunc): Fix
1573         ptrmemfunc_vbit_in_delta case.
1575 2013-01-29  Jason Merrill  <jason@redhat.com>
1577         PR libstdc++/54314
1578         * class.c (build_ctor_vtbl_group): Give construction vtables
1579         hidden visibility.
1581 2013-01-25  Jason Merrill  <jason@redhat.com>
1583         PR c++/56095
1584         * pt.c (convert_nontype_argument_function): Handle invalid input.
1585         (convert_nontype_argument): Likewise.
1587         PR c++/56104
1588         * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1589         dynamic type has no virtual functions.
1591 2013-01-22  Paolo Carlini  <paolo.carlini@oracle.com>
1593         PR c++/55944
1594         * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1595         on TARGET_EXPR nodes.
1597 2013-01-22  Jason Merrill  <jason@redhat.com>
1599         PR c++/56071
1600         * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1602 2013-01-22  Dodji Seketeli  <dodji@redhat.com>
1604         PR c++/53609
1605         * pt.c (argument_pack_element_is_expansion_p)
1606         (make_argument_pack_select, use_pack_expansion_extra_args_p)
1607         (gen_elem_of_pack_expansion_instantiation): New static functions.
1608         (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1609         look through the possibly resulting pack expansion as well.
1610         (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1611         generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1612         Use gen_elem_of_pack_expansion_instantiation to build the
1613         instantiation piece-wise.  Don't use arg_from_parm_pack_p anymore,
1614         as gen_elem_of_pack_expansion_instantiation and the change in
1615         tsubst above generalize this particular case.
1616         (arg_from_parm_pack_p): Remove this for it's not used by
1617         tsubst_pack_expansion anymore.
1619 2013-01-21  Jason Merrill  <jason@redhat.com>
1621         PR c++/56059
1622         * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1623         template args count.
1625 2013-01-18  Jason Merrill  <jason@redhat.com>
1627         PR target/54908
1628         * decl2.c (get_local_tls_init_fn): New.
1629         (get_tls_init_fn): Handle flag_extern_tls_init.  Don't bother
1630         with aliases for internal variables.  Don't use weakrefs if
1631         the variable needs destruction.
1632         (generate_tls_wrapper): Mark the wrapper as const if no
1633         initialization is needed.
1634         (handle_tls_init): Don't require aliases.
1636 2013-01-15  Dodji Seketeli  <dodji@redhat.com>
1638         PR c++/55663
1639         * pt.c (coerce_innermost_template_parms): New static function.
1640         (instantiate_alias_template):  Use it here.
1642 2013-01-09  Jason Merrill  <jason@redhat.com>
1644         PR c++/55878
1645         * rtti.c (build_typeid, get_typeid): Add complain parm.
1646         (get_tinfo_decl_dynamic): Likewise.
1647         * cp-tree.h, parser.c, pt.c: Adjust.
1649         PR c++/55893
1650         * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1651         needs destruction.
1653 2013-01-09  Jakub Jelinek  <jakub@redhat.com>
1655         PR c/48418
1656         * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1657         call maybe_constant_value for the negative or too big shift
1658         count warnings.
1660 2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
1662         PR c++/55801
1663         * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1664         of the argument is true.
1666 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
1668         * parser.c (cp_parser_initializer_list): Move declaration
1669         of variable non_const to start of lexical block.
1671 2013-01-07  Jason Merrill  <jason@redhat.com>
1673         PR c++/55753
1674         * tree.c (build_aggr_init_expr): Do nothing in a template.
1675         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1676         a FUNCTION_DECL before tsubsting.
1678 2013-01-04  Dodji Seketeli  <dodji@redhat.com>
1680         PR c++/52343
1681         * pt.c (check_instantiated_arg): Allow type template arguments.
1683 2013-01-04  Jason Merrill  <jason@redhat.com>
1685         PR c++/55877
1686         * decl.c (reset_type_linkage, bt_reset_linkage): New.
1687         (grokdeclarator): Use reset_type_linkage.
1688         * name-lookup.c (binding_table_foreach): Handle null table.
1689         * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1691 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
1693         PR c++/54526 (again)
1694         * parser.c (cp_parser_template_id): Revert core of previous change
1695         (keep adjusted inform message).
1697 2013-01-03  Jason Merrill  <jason@redhat.com>
1699         PR c++/55419
1700         PR c++/55753
1701         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1702         TREE_CONSTANT.
1704         PR c++/55842
1705         * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1707         PR c++/55856
1708         * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1710         PR c++/53650
1711         * call.c (type_has_extended_temps): New.
1712         * cp-tree.h: Declare it.
1713         * decl.c (check_initializer): Use build_aggr_init for arrays
1714         if it is false.
1715         * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1717 2013-01-02  Jason Merrill  <jason@redhat.com>
1719         PR c++/54325
1720         * call.c (build_new_method_call_1): Don't use build_value_init for
1721         user-provided default constructors.
1723         * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1725         PR c++/55032
1726         PR c++/55245
1727         * tree.c (build_cplus_array_type): Copy layout information
1728         to main variant if necessary.
1730 Copyright (C) 2013 Free Software Foundation, Inc.
1732 Copying and distribution of this file, with or without modification,
1733 are permitted in any medium without royalty provided the copyright
1734 notice and this notice are preserved.