69728683651afb0bfd30e182e64b0160bf59579d
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2013-08-23  Gabriel Dos Reis  <gdr@integrable-solutiobs.net>
2
3         * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
4         destructor for the early printer.
5         * error.c (type_to_string): Use pp_buffer.
6
7 2013-08-22  Paolo Carlini  <paolo.carlini@oracle.com>
8
9         PR c++/56380
10         * class.c (check_field_decls): Check for const mutable and const
11         reference data members.
12
13 2013-08-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
14
15         * error.c (init_error): Remove calls to pp_construct and
16         pp_cxx_pretty_printer_init.  Initialize cxx_pp with placement-new.
17         * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
18         (cxx_pretty_printer_init): Remove.
19         * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
20         Rename from cxx_pretty_printer_init.  Adjust.
21         * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
22         initialization of C++ diagnostics pretty printer.
23
24 2013-08-21  Paolo Carlini  <paolo.carlini@oracle.com>
25
26         * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
27         * cp-tree.h (REFERENCE_REF_P): Likewise.
28         * semantics.c (finish_offsetof): Likewise.
29
30 2013-08-21  Paolo Carlini  <paolo.carlini@oracle.com>
31
32         PR c++/56130
33         * semantics.c (finish_id_expression): Handle deprecated references.
34
35 2013-08-20  Jason Merrill  <jason@redhat.com>
36
37         PR c++/58119
38         * cvt.c (build_expr_type_conversion): Don't complain about a
39         template that can't match the desired type category.
40
41 2013-08-20  Gabriel Dos Reis  <gdr@integrable-solutions.net>
42
43         * error.c (pp_ggc_formatted_text): New.
44         (type_as_string): Use it in lieu of pp_formatted_text.
45         (type_as_string_translate): Likewise.
46         (expr_as_string): Likewise.
47         (decl_as_string): Likewise.
48         (decl_as_string_translate): Likewise.
49         (lang_decl_name): Likewise.
50         (decl_to_string): Likewise.
51         (expr_to_string): Likewise.
52         (fndecl_to_string): Likewise.
53         (parm_to_string): Likewise.
54         (type_to_string): Likewise.
55         (args_to_string): Likewise.
56         (subst_to_string): Likewise.
57
58 2013-08-19  Balaji V. Iyer  <balaji.v.iyer@intel.com>
59
60         PR c/57490
61         * cp-array-notation.c (cp_expand_cond_array_notations): Added a
62         check for truth values.
63         (expand_array_notation_exprs): Added truth values case.  Removed an
64         unwanted else.  Added for-loop to walk through subtrees in default
65         case.
66         * call.c (build_cxx_call): Inherited the type of the array notation for
67         certain built-in array notation functions.
68
69 2013-08-19  Paolo Carlini  <paolo.carlini@oracle.com>
70
71         * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
72         Use cp_parser_lookup_name_simple.
73
74 2013-08-19  Paolo Carlini  <paolo.carlini@oracle.com>
75
76         * name-lookup.h (pop_bindings_and_leave_scope): Declare.
77         * name-lookup.c (pop_bindings_and_leave_scope): Define.
78         * parser.c (cp_parser_lambda_declarator_opt,
79         cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
80
81 2013-08-17  Jason Merrill  <jason@redhat.com>
82
83         PR c++/58083
84         * name-lookup.c (push_class_level_binding_1): It's OK to push a
85         lambda type after the enclosing type is complete.
86
87 2013-08-17  Gabriel Dos Reis  <gdr@integrable-solutions.net>
88
89         * error.c (dump_scope): Add a cxx_pretty_printer parameter.
90         Adjust callers.
91         (dump_template_argument): Likewise.
92         (dump_template_argument_list): Likewise.
93         (dump_template_parameter): Likewise.
94         (dump_template_bindings): Likewise.
95         (dump_alias_template_specialization): Likewise.
96         (dump_type): Likewise.
97         (dump_typename): Likewise.
98         (dump_aggr_type): Likewise.
99         (dump_type_prefix): Likewise.
100         (dump_type_suffix): Likewise.
101         (dump_global_iord): Likewise.
102         (dump_simple_decl): Likewise.
103         (dump_decl): Likewise.
104         (dump_template_decl): Likewise.
105         (dump_function_decl): Likewise.
106         (dump_parameters): Likewise.
107         (dump_ref_qualifier): Likewise.
108         (dump_exception_spec): Likewise.
109         (dump_function_name): Likewise.
110         (dump_template_parms): Likewise.
111         (dump_call_expr_args): Likewise.
112         (dump_aggr_init_expr_args): Likewise.
113         (dump_expr_list): Likewise.
114         (dump_expr_init_vec): Likewise.
115         (dump_expr): Likewise.
116         (dump_binary_op): Likewise.
117         (dump_unary_op): Likewise.
118
119 2013-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
120
121         PR c++/51912
122         * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
123         * decl.c (case_conversion): Use it.
124         * call.c (standard_conversion): Likewise.
125         (implicit_conversion): Adjust.
126
127 2013-08-13  Adam Butcher  <adam@jessamine.co.uk>
128
129         * pt.c: Grammar fix in comments ("it's" to "its").
130
131 2013-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
132
133         * decl.c (warn_extern_redeclared_static, duplicate_decls,
134         check_elaborated_type_specifier): Use error + inform.
135         * friend.c (make_friend_class): Likewise.
136         * semantics.c (finish_id_expression): Likewise.
137
138 2013-08-09  Paolo Carlini  <paolo.carlini@oracle.com>
139
140         Revert:
141         2013-08-07  Paolo Carlini  <paolo.carlini@oracle.com>
142
143         PR c++/46206
144         * name-lookup.c (lookup_name_real_1): Handle iter->type before
145         iter->value.
146
147 2013-08-07  Paolo Carlini  <paolo.carlini@oracle.com>
148
149         PR c++/46206
150         * name-lookup.c (lookup_name_real_1): Handle iter->type before
151         iter->value.
152
153 2013-08-06  Caroline Tice  <cmtice@google.com>
154
155         * Make-lang.in (*CXX_AND_OBJCXX_OBJS):  Add vtable-class-hierarchy.o to
156         list.
157         (vtable-class-hierarchy.o): Add build rule.
158         * cp-tree.h (vtv_start_verification_constructor_init_function): New
159         extern function decl.
160         (vtv_finish_verification_constructor_init_function): New extern
161         function decl.
162         (build_vtbl_address): New extern function decl.
163         (get_mangled_vtable_map_var_name): New extern function decl.
164         (vtv_compute_class_hierarchy_transitive_closure): New extern function
165         decl.
166         (vtv_generate_init_routine): New extern function decl.
167         (vtv_save_class_info): New extern function decl.
168         (vtv_recover_class_info): New extern function decl.
169         (vtv_build_vtable_verify_fndecl): New extern function decl.
170         * class.c (finish_struct_1): Add call to vtv_save_class_info if
171         flag_vtable_verify is true.
172         * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
173         * vtable-class-hierarchy.c: New file.
174         * mangle.c (get_mangled_vtable_map_var_name):  New function.
175         * decl2.c (start_objects): Update function comment.
176         (cp_write_global_declarations):  Call vtv_recover_class_info,
177         vtv_compute_class_hierarchy_transitive_closure and
178         vtv_build_vtable_verify_fndecl, before calling
179         finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
180         flag_vtable_verify is true.
181         (vtv_start_verification_constructor_init_function): New function.
182         (vtv_finish_verification_constructor_init_function): New function.
183         * init.c (build_vtbl_address): Remove static qualifier from function.
184
185 2013-08-06  Jason Merrill  <jason@redhat.com>
186
187         PR c++/57825
188         * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
189
190 2013-08-05  Paolo Carlini  <paolo.carlini@oracle.com>
191
192         PR c++/58080
193         * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
194         (cp_build_binary_op): Adjust.
195
196 2013-08-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
197
198         * cxx-pretty-print.h (pp_c_base): Remove.
199         (cxx_pretty_printer): Derive from c_pretty_printer.
200         Adjust macros using pp_c_base.
201         * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
202         * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
203         (pp_cxx_colon_colon): Likewise.
204         (pp_cxx_separate_with): Likewise.
205         (pp_cxx_storage_class_specifier): Do not call pp_c_base.
206         (pp_cxx_expression_list): Likewise.
207         (pp_cxx_space_for_pointer_operator): Likewise.
208         (pp_cxx_init_declarator): Likewise.
209         (pp_cxx_call_argument_list): Likewise.
210         (pp_cxx_constant): Likewise.
211         (pp_cxx_postfix_expression): Likewise.
212         (pp_cxx_new_expression): Likewise.
213         (pp_cxx_unary_expression): Likewise.
214         (pp_cxx_cast_expression): Likewise.
215         (pp_cxx_conditional_expression): Likewise.
216         (pp_cxx_assignment_expression): Likewise.
217         (pp_cxx_expression): Likewise.
218         (pp_cxx_function_specifier): Likewise.
219         (pp_cxx_decl_specifier_seq): Likewise.
220         (pp_cxx_simple_type_specifier): Likewise.
221         (pp_cxx_type_specifier_seq): Likewise.
222         (pp_cxx_ptr_operator): Likewise.
223         (pp_cxx_parameter_declaration_clause): Likewise.
224         (pp_cxx_direct_declarator): Likewise.
225         (pp_cxx_direct_abstract_declarator): Likewise.
226         (pp_cxx_type_id): Likewise.
227         (pp_cxx_statement): Likewise.
228         (pp_cxx_pretty_printer_init): Tidy.
229         * error.c (init_error): Do not use pp_base.
230         (dump_aggr_type): Likewise.
231         (dump_type_prefix): Likewise.
232         (dump_type_suffix): Likewise.
233         (dump_global_iord): Likewise.
234         (dump_decl): Likewise.
235         (dump_function_decl): Likewise.
236         (dump_ref_qualifier): Likewise.
237         (reinit_cxx_pp): Likewise.
238         (decl_as_dwarf_string): Likewise.
239         (lang_decl_dwarf_name): Likewise.
240         (type_to_string): Likewise.
241         (cv_to_string): Likewise.
242         (cxx_print_error_function): Likewise.
243         (cp_diagnostic_starter): Likewise.
244         (cp_diagnostic_finalizer): Likewise.
245         (cp_print_error_function): Likewise.
246         (print_instantiation_context): Likewise.
247         (cp_printer): Likewise.
248
249 2013-08-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
250
251         * error.c (dump_type_prefix): Use specialized pretty printer
252         functions instead of pp_string or operators and punctuators.
253         (dump_decl): Likewise.
254         (dump_expr): Likewise.
255
256 2013-08-03  Jason Merrill  <jason@redhat.com>
257
258         DR 1286
259         * pt.c (get_underlying_template): New.
260         (convert_template_argument, lookup_template_class_1): Use it.
261
262         DR 1430
263         PR c++/51239
264         * pt.c (pack_expansion_args_count): Rename from
265         any_pack_expanson_args_p.
266         (coerce_template_parms): Reject pack expansion to
267         non-pack template parameter of alias template.
268
269 2013-08-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
270
271         * error.c (dump_aggr_type): Use specialized pretty printer
272         functions instead of pp_character.
273         (dump_type_prefix): Likewise.
274         (dump_simple_decl): Likewise.
275         (type_to_string): Likewise.
276
277 2013-08-02  Paolo Carlini  <paolo.carlini@oracle.com>
278
279         * cp-tree.h (finish_stmt): Do not declare.
280         * decl.c (finish_stmt): Do not define.
281         * parser.c (cp_parser_expression_statement,
282         cp_parser_declaration_statement,
283         cp_parser_transaction_cancel): Don't call finish_stmt.
284         * semantics.c (finish_expr_stmt, finish_if_stmt,
285         finish_while_stmt, finish_do_stmt, finish_return_stmt,
286         finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
287         finish_transaction_stmt): Likewise.
288
289 2013-08-01  Fabien Chêne  <fabien@gcc.gnu.org>
290
291         PR c++/54537
292         * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
293         * name-lookup.c (do_nonmember_using_decl): Make sure we have an
294         OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
295         instead of issuing an error without mentioning the conflicting
296         declaration.
297
298 2013-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
299
300         * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
301         return value for error_mark_node.
302
303 2013-07-30  Paolo Carlini  <paolo.carlini@oracle.com>
304
305         PR c++/57673
306         * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
307         token->type == CPP_ELLIPSIS.
308
309 2013-07-30  Paolo Carlini  <paolo.carlini@oracle.com>
310
311         PR c++/57947
312         * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
313
314 2013-07-29  Jason Merrill  <jason@redhat.com>
315
316         PR c++/57901
317         * semantics.c (build_data_member_initialization, constexpr_fn_retval):
318         Use break_out_target_exprs instead of unshare_expr.
319
320 2013-07-29  Paolo Carlini  <paolo.carlini@oracle.com>
321
322         PR c++/57948
323         * call.c (initialize_reference): Don't crash when reference_binding
324         returns a conv with conv->kind == ck_ambig.
325
326 2013-07-29  Jason Merrill  <jason@redhat.com>
327
328         * mangle.c (write_name): Check for null context.
329         (write_unscoped_name): Allow PARM_DECL context.
330
331 2013-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
332
333         PR c++/57981
334         * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
335         (grokparms): Adjust.
336         * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
337         * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
338         a tsubst_flags_t parameter.
339         (tsubst_decl): Adjust.
340         * call.c (convert_default_arg): Likewise.
341         * cp-tree.h (check_default_argument, tsubst_default_argument):
342         Update declarations.
343
344 2013-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
345
346         PR c++/57880
347         * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
348         CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
349         CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
350         Fix string_len management, tidy.
351
352 2013-07-24  Paolo Carlini  <paolo.carlini@oracle.com>
353
354         PR c++/57942
355         * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
356         target type is incomplete; return a bool, not an int.
357         * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
358
359 2013-07-22  Paolo Carlini  <paolo.carlini@oracle.com>
360
361         * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
362         tf_warning_or_error.
363
364 2013-07-21   OndÃ…\99ej Bílka  <neleai@seznam.cz>
365
366         * class.c: Fix typos.
367         * cp-array-notation.c: Likewise.
368         * cp-objcp-common.c: Likewise.
369         * decl.c: Likewise.
370         * init.c: Likewise.
371         * mangle.c: Likewise.
372         * parser.c: Likewise.
373         * pt.c: Likewise.
374         * semantics.c: Likewise.
375
376 2013-07-14  Adam Butcher  <adam@jessamine.co.uk>
377
378         * semantics.c (build_lambda_expr),
379         (build_lambda_object), (begin_lambda_type), (lambda_return_type),
380         (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
381         (is_normal_capture_proxy), (insert_capture_proxy),
382         (insert_pending_capture_proxies), (lambda_proxy_type),
383         (build_capture_proxy), (vla_capture_type),
384         (register_capture_members), (add_default_capture),
385         (lambda_expr_this_capture), (maybe_resolve_dummy),
386         (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
387         (is_lambda_ignored_entity): Moved definitions into ...
388         * lambda.c: ... this new file.
389
390 2013-07-14  Marc Glisse  <marc.glisse@inria.fr>
391
392         * call.c (build_conditional_expr_1): Handle the case with 1 vector
393         and 2 scalars. Call save_expr before building a vector.
394         * typeck.c (cp_build_binary_op): Check complain before complaining.
395
396 2013-07-13  Lubos Lunak  <l.lunak@suse.cz>
397
398         PR c++/55203
399         * init.c (build_aggr_init): Check for warn_unused attribute.
400         * decl.c (poplevel): Likewise.
401
402 2013-07-13  Jason Merrill  <jason@redhat.com>
403
404         PR c++/57402
405         * init.c (build_vec_init): Use {} for arrays of class type.
406         (build_vec_delete): Don't take the address of the array.
407
408         PR c++/57793
409         * class.c (layout_class_type): Check for too-large class.
410
411         * call.c (can_convert): Allow user-defined conversions.
412         (can_convert_standard): New.
413         * cp-tree.h: Declare it.
414         * cvt.c (convert_to_reference): Use it.
415         * pt.c (convert_nontype_argument): Likewise.
416         * search.c (check_final_overrider): Likewise.
417         Don't worry about user-defined conversions.
418
419 2013-07-10  Paolo Carlini  <paolo.carlini@oracle.com>
420
421         PR c++/57869
422         * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
423         warn about casting between pointer-to-function and pointer-to-object.
424
425 2013-07-09  Jason Merrill  <jason@redhat.com>
426
427         PR c++/57402
428         * init.c (build_vec_init): Don't take shortcuts when initializing
429         a VLA.
430
431         PR c++/57471
432         * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
433
434         PR c++/57658
435         * semantics.c (finish_id_expression): Return the id for an
436         unevaluated outer variable.
437
438         PR c++/57526
439         * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
440         if the variable type uses 'auto'.
441
442         PR c++/57437
443         * typeck.c (check_return_expr): Lambda proxies aren't eligible
444         for nrv or return by move.
445
446         PR c++/57532
447         * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
448         a ref-qualifier in C++98 mode.
449
450         PR c++/57545
451         * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
452         argument to have the exact type of the parameter.
453
454         PR c++/57551
455         * semantics.c (cxx_eval_indirect_ref): Don't try to look through
456         a POINTER_PLUS_EXPR for type punning diagnostic.
457
458         PR c++/57831
459         * pt.c (tsubst_copy): Handle USING_DECL.
460
461 2013-07-09  Marc Glisse  <marc.glisse@inria.fr>
462
463         PR c++/53094
464         * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
465
466 2013-07-09  Marc Glisse  <marc.glisse@inria.fr>
467
468         PR c++/53000
469         * call.c (build_conditional_expr_1): Preserve xvalues.
470
471 2013-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
472
473         PR c++/51786
474         * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
475         also check declares_class_or_enum.
476
477 2013-07-08  Jason Merrill  <jason@redhat.com>
478
479         PR c++/57550
480         * pt.c (fn_type_unification): Only defer during substitution.
481         (type_unification_real): Defer during defarg substitution,
482         add checks parm to pass back deferred checks.
483         (unify, do_auto_deduction): Adjust.
484         * semantics.c (reopen_deferring_access_checks): New.
485         * cp-tree.h: Declare it.
486
487 2013-07-06  Paolo Carlini  <paolo.carlini@oracle.com>
488
489         PR c++/28262
490         * parser.c (cp_parser_init_declarator): If we are parsing a typedef
491         set parser->default_arg_ok_p to false before cp_parser_declarator.
492
493 2013-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
494
495         PR c++/14263
496         * class.c (build_base_path): Improve diagnostic.
497
498 2013-07-04  Paolo Carlini  <paolo.carlini@oracle.com>
499
500         PR c++/38634
501         * decl.c (start_preparsed_function): Return a bool, false if
502         push_template_decl fails.
503         (start_function): Adjust.
504         * cp-tree.h: Update.
505
506 2013-07-03  Jakub Jelinek  <jakub@redhat.com>
507
508         PR c++/57771
509         * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
510         Temporarily set parser->greater_than_is_operator_p for
511         cp_parser_expression and restore from saved value afterwards.
512
513 2013-06-28  Ed Smith-Rowland  <3dw4rd@verizon.net>
514
515         * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
516         * parser.c (cp_parser_operator()): Parse user-defined string
517         literal as literal operator.
518
519 2013-06-28  Paolo Carlini  <paolo.carlini@oracle.com>
520
521         PR c++/57645
522         * class.c (deduce_noexcept_on_destructors): Save, set, and restore
523         TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
524         destructors.
525
526 2013-06-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
527
528         * parser.c (cp_parser_array_notation): Removed rejection array notation
529         of type function pointers. Added handling of array expressions when
530         Cilk Plus is enabled.  Took out type-checking.
531         (cp_parser_postfix_open_square_expression): Moved normal array expr.
532         parsing into cp_parser_array_notation when cilkplus is enabled.
533         (cp_parser_compound_statement): Removed expansion of array notations.
534         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
535         (cp_parser_function_definition_after_declarator): Likewise.
536         (cp_parser_selection_statement): Removed error reporting.
537         (cp_parser_iteration_statement): Likewise.
538         (cp_parser_direct_declarator): Removed error checking/reporting if
539         array notations are used in the declarator.
540         * pt.c (instantiate_decl): Likewise.
541         (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
542         (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
543         (potential_constant_expression_1): Returned false for
544         ARRAY_NOTATION_REF case.
545         * cp-gimplify.c (cp_genericize): Added expansion of array notation
546         expressions here.
547         * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry 
548         parameters.  Replaced build_decls with get_temp_regvar with type as
549         ptrdiff.
550         (create_array_refs): Made the type-casting to ptrdiff_type.
551         (replace_invariant_var): Added a check for void return type before 
552         creating new var.  Replaced build_decl and build_min_nt_loc with
553         get_temp_regvar.
554         (expand_an_in_modify_expr): Ditto.  Replaced body of redundant else 
555         with gcc_unreachable.  Removed few unwanted checks.  Made induction 
556         variable type as ptrdiff_type.  Removed loc and complain arguments 
557         passed into make_triplet_val_inv.  Replaced all modify expression's 
558         code from NOP EXPR to INIT EXPR.  Replaced all forceful appending 
559         into stmt. list with the non-forceful one.  Replaced some integer 
560         conversion and equality-checking to using tree_int_cst_equal.
561         (expand_sec_reduce_builtin): All changes mentioned in above function
562         expand_an_in_modify_expr.  Made the new variable type of
563         SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
564         (expand_array_notation_exprs): Removed SWITCH_EXPR case.  Moved all
565         the error reporting from parser to this function.  Removed unwanted
566         statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
567         (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
568         in function pointers.
569         (cp_expand_cond_array_notations): Added a new if statements to check
570         if condition has a zero rank.  If so, then just return.
571         (expand_return_expr): Added a check for return expressions with a rank.
572         Replaced get_tmp_regvar with a create_temporary_var.
573         (build_array_notation_ref): Simplified and removed unwanted if-stmts.
574         Moved common code outside if-statements.  Moved type-checking from
575         parser to here.
576         * semantics.c (finish_return_stmt): Removed a check for return exprs.
577         with a rank.
578         * call.c (convert_like_real): Removed a check for array notation
579         expression in a function.
580         (build_over_call): Likewise.
581         (magic_varargs_p): Added a check for builtin array notation function.
582         Made this function non-static and removed its prototype.
583         * cp-tree.h (magic_varargs_p): New prototype.
584         * typeck.c (cp_build_function_call_vec): Removed automatic setting of
585         nargs to the param->length when builtin reduction function is used.
586         (convert_arguments): Replaced check for a constant_p function with
587         margic_varargs_p function call.
588         (cp_build_binary_op): Removed calling of the function
589         find_correct_array_notation_type.
590         (cp_build_addr_expr_1): Removed an unwanted if-statement.
591         (convert_for_assignment): Removed automatic return of rhs when array
592         notation builtin function is used.
593
594 2013-06-28  Paolo Carlini  <paolo.carlini@oracle.com>
595
596         PR c++/57682
597         * parser.c (cp_parser_save_member_function_body): Handle correctly
598         curly braces in function-try-block mem-initializers.
599
600 2013-06-27  Marc Glisse  <marc.glisse@inria.fr>
601
602         PR c++/57509
603         * typeck.c (cp_build_vec_perm_expr): New function.
604         * cp-tree.h: Declare it.
605         * parser.c (cp_parser_postfix_expression): Call it.
606         * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
607         (tsubst_copy_and_build): Likewise.
608
609 2013-06-27  Marc Glisse  <marc.glisse@inria.fr>
610
611         PR c++/57172
612         * pt.c (more_specialized_fn): If both arguments are references,
613         give priority to an lvalue.
614
615 2013-06-26  Jason Merrill  <jason@redhat.com>
616
617         * typeck2.c (store_init_value): Diagnose a non-constant
618         initializer for in-class static.
619
620         PR c++/57408
621         * semantics.c (add_capture): Set type to error_mark_node after
622         error.
623
624 2013-06-25  Ed Smith-Rowland  <3dw4rd@verizon.net>
625
626         PR c++/57640
627         * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
628         to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
629
630 2013-06-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
631
632         * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
633         * class.c (add_implicitly_declared_members): Likewise.
634         (check_field_decl): Likewise.
635         (finalize_literal_type_property): Likewise.
636         (check_bases_and_members): Likewise.
637         * decl.c (poplevel): Likewise.
638         (case_conversion): Likewise.
639         (check_initializer): Likewise.
640         (grokfndecl): Likewise.
641         (check_static_variable_definition): Likewise.
642         (compute_array_index_type): Likewise.
643         (grokdeclarator): Likewise.
644         (build_enumerator): Likewise.
645         * friend.c (make_friend_class): Likewise.
646         * lex.c (init_reswords): Likewise.
647         * method.c (synthesized_method_walk): Likewise.
648         (implicitly_declare_fn): Likewise.
649         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
650         (cp_parser_constant_expression): Likewise.
651         (cp_parser_for_init_statement): Likewise.
652         (cp_parser_block_declaration): Likewise.
653         (cp_parser_type_name): Likewise.
654         (cp_parser_enum_specifier): Likewise.
655         (cp_parser_enumerator_list): Likewise.
656         (cp_parser_member_declaration): Likewise.
657         (cp_nth_tokens_can_be_std_attribute_p): Likewise.
658         (cp_parser_template_declaration_after_export): Likewise.
659         * pt.c (convert_nontype_argument_function): Likewise.
660         (convert_nontype_argument): Likewise.
661         (convert_template_argument): Likewise.
662         (tsubst_copy_and_build): Likewise.
663         (build_non_dependent_expr): Likewise.
664         * semantics.c (non_const_var_error): Likewise.
665         (potential_constant_expression_1): Likewise.
666         * tree.c (lvalue_kind): Likewise.
667         (build_vec_init_expr): Likewise.
668         (cast_valid_in_integral_constant_expression_p): Likewise.
669         * typeck.c (build_x_conditional_expr): Likewise.
670         * typeck2.c (check_narrowing): Likewise.
671
672 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
673
674         * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
675         (expand_an_in_modify_expr): Changed a function call from the above
676         removed function to length_mismatch_in_expr_p.
677
678 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
679
680         * call.c (convert_like_real): Added a check if array notation is present
681         in expression.  If so, then no conversion of arguments is necessary.
682         (build_over_call): Likewise.
683         * typeck.c (cp_build_function_call_vec): Likewise.
684         (convert_for_assignment): Likewise.
685         (cp_build_array_ref): Reject array notations with a rank greater than 1
686         as an array's index.
687         (cp_build_binary_op): If array notations are preent in op, then call
688         find_correct_array_notation_type.
689         (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
690         * cp-array-notation.c: New file.
691         * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
692         as typed.
693         * cp-tree.h (fix_array_notation_exprs): New prototype.
694         * semantics.c (finish_return_stmt): Reject array notations as
695         return value.
696         (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
697         (potential_constant_expression_1): Likewise.
698         * tree.c (lvalue_kind): Likewise.
699         * error.c (dump_decl): Likewise.
700         (dump_expr): Likewise.
701         * pt.c (ARRAY_NOTATION_REF): Likewise.
702         (type_unification_real): Do not unify any arguments if array notations
703         are found in arg.
704         (instantiate_decl): Added a check for array notaitons inside the
705         function body.  If so, then expand them.
706         * parser.c (cp_parser_array_notation): New function.
707         (cp_parser_postfix_open_square_expression): Added a check for colons
708         inside square braces.  If found, then handle the array access as an
709         array notation access.  Also, disable auto-correction from a single
710         colon to scope when Cilk Plus is enabled.
711         (cp_parser_compound_statement): Added a check for array notations
712         inside the statement.  If found, then expand them.
713         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
714         (cp_parser_function_definition_after_declarator): Likewise.
715         (cp_parser_selection_statement): Searched for array notations inside
716         condition.  If so, then emit an error.
717         (cp_parser_iteration_statement): Likewise.
718         (cp_parser_direct_declarator): Reject array notations inside a
719         variable or array declaration.
720         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
721
722 2013-06-20  Jason Merrill  <jason@redhat.com>
723
724         PR c++/55149
725         * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
726         context if we're in C++14 mode.
727         * tree.c (array_of_runtime_bound_p): Return true for a dependent
728         bound that is not potentually constant.
729         * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
730         * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
731         * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
732         (build_capture_proxy): Set REFERENCE_VLA_OK.
733         (vla_capture_type): Make it a proper C++ class.
734         (add_capture): Set DECL_VLA_CAPTURE_P.  Don't pre-digest the
735         initializer.
736
737         * decl.c (compute_array_index_type): Use size_one_node.
738
739         * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
740         a partial specialization.
741         (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
742         specialization.
743         (most_specialized_class): Adjust.
744
745         * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
746         (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
747         TEMPLATE_DECL_CHECK.
748
749 2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
750
751         PR c++/57638
752         * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
753         TREE_TYPE (arg), not arg itself.
754
755 2013-06-18  Paolo Carlini  <paolo.carlini@oracle.com>
756
757         PR c++/53211
758         * pt.c (type_dependent_expression_p): Handle an array of unknown
759         bound depending on a variadic parameter.
760         * parser.c (cp_parser_range_for): Revert PR56794 changes.
761
762 2013-06-17  Richard Biener  <rguenther@suse.de>
763
764         * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
765
766 2013-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
767
768         PR c++/16128
769         * parser.c (cp_parser_expression_statement): Check whether
770         cp_parser_expression returns error_mark_node.
771
772 2013-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
773
774         PR c++/51413
775         * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
776
777 2013-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
778
779         PR c++/57599
780         * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
781         accessible base simply forward to build_static_cast.
782
783 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
784
785         PR c++/38958
786         * decl.c (poplevel): For the benefit of -Wunused-variable see
787         through references.
788
789 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
790
791         * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
792
793 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
794
795         PR c++/42021
796         * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
797         again diagnostic already emitted by cp_parser_lookup_name.
798
799 2013-06-11  Jan Hubicka  <jh@suse.cz>
800
801         PR c++/57551
802         * cp/pt.c (mark_decl_instantiated): Do not export explicit
803         instantiations of anonymous namespace templates.
804
805 2013-06-10  Jason Merrill  <jason@redhat.com>
806
807         * name-lookup.c (add_decl_to_level): Add decls in an anonymous
808         namespace to static_decls.
809
810 2013-06-07  Sriraman Tallam  <tmsriram@google.com>
811
812         PR c++/57548
813         * call.c (build_over_call):  Check if current_function_decl is
814         NULL.
815
816 2013-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
817
818         PR c++/53658
819         * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
820         not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
821
822 2013-06-06  Jason Merrill  <jason@redhat.com>
823
824         PR c++/55520
825         * semantics.c (add_capture): Diagnose capture of variable-size
826         type that is not a C++1y array of runtime bound.
827
828         * decl.c (grokdeclarator): Keep a decl with error type.
829         (grokfield, grokbitfield): Likewise.
830         * pt.c (instantiate_class_template_1): Likewise.
831         (tsubst_decl): Drop redundant error.
832         * class.c (walk_subobject_offsets): Handle erroneous fields.
833         * typeck2.c (process_init_constructor_record): Likewise.
834
835 2013-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
836
837         PR c++/51908
838         * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
839         parser->in_type_id_in_expr_p before calling cp_parser_type_id.
840
841 2013-06-03  Jan Hubicka  <jh@suse.cz>
842
843         * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
844         mark_decl_referenced.
845         (mark_needed): Likewise.
846
847 2013-06-03  Jason Merrill  <jason@redhat.com>
848
849         * class.c (mark_type_abi_tags): New.
850         (check_abi_tags): Use it.
851
852 2013-06-03  Paolo Carlini  <paolo.carlini@oracle.com>
853
854         PR c++/57419
855         * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
856         * semantics.c (finish_qualified_id_expr): Use it.
857         * cp-tree.h: Update.
858
859 2013-06-01  Jan Hubicka  <jh@suse.cz>
860
861         * decl2.c (cp_write_global_declarations): Replace same_body_alias
862         by symbol.cpp_implicit_alias.
863
864 2013-05-30  Jason Merrill  <jason@redhat.com>
865
866         PR c++/57404
867         * cp-lang.c (cp_classify_record): Handle structs without
868         TYPE_LANG_SPECIFIC.
869
870         PR c++/52377
871         * class.c (common_enclosing_class): New.
872         * cp-tree.h: Declare it.
873         * init.c (sort_mem_initializers): Don't splice out a union member
874         with an NSDMI.
875
876 2013-05-29  Jan Hubicka  <jh@suse.cz>
877
878         * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
879         * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
880
881 2013-05-25  Paolo Carlini  <paolo.carlini@oracle.com>
882
883         PR c++/25666
884         * decl2.c (check_classfn): Check for destructors declared as member
885         templates.
886
887 2013-05-24  Jason Merrill  <jason@redhat.com>
888
889         PR c++/56971
890         * pt.c (any_template_arguments_need_structural_equality_p): A
891         TEMPLATE_TEMPLATE_PARM can require structural type comparison.
892
893 2013-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
894
895         PR c++/19618
896         * class.c (check_bitfield_decl): Warn for bool and enum bitfields
897         with width exceeding the type.
898
899 2013-05-24  Jason Merrill  <jason@redhat.com>
900
901         PR c++/57391
902         * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
903         (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
904
905 2013-05-23  Jason Merrill  <jason@redhat.com>
906
907         PR c++/57388
908         * tree.c (build_ref_qualified_type): Clear
909         FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
910
911 2013-05-22  Jason Merrill  <jason@redhat.com>
912
913         PR c++/56930
914         * call.c (convert_like_real): Use cp_convert_and_check.
915         * cvt.c (cp_convert_and_check): Use maybe_constant_value.
916         * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
917         (potential_constant_expression_1): Handle OMP_ATOMIC*.
918
919         PR c++/56915
920         * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
921         isn't defined.
922
923 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
924
925         PR c++/57352
926         * parser.c (cp_parser_conversion_type_id): Set up
927         parser->type_definition_forbidden_message before calling
928         cp_parser_type_specifier_seq.
929
930 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
931
932         PR c++/57211
933         * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
934         warnings about defaulted functions.
935
936 2013-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
937
938         * call.c (build_conditional_expr_1): Add location_t parameter.
939         (build_conditional_expr): Likewise.
940         * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
941         get_member_function_from_ptrfunc, build_x_conditional_expr,
942         cp_build_modify_expr): Update.
943         * init.c (build_new_1): Likewise.
944         * cp-tree.h: Update declaration.
945
946 2013-05-20  Jason Merrill  <jason@redhat.com>
947
948         PR c++/57016
949         * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
950         if there is one.
951
952         PR c++/57102
953         * decl.c (fndecl_declared_return_type): Also look in
954         DECL_SAVED_FUNCTION_DATA.
955
956 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
957
958         PR c++/12288
959         * parser.c (cp_parser_parameter_declaration): Check return value
960         of cp_parser_parse_and_diagnose_invalid_type_name.
961
962 2013-05-20  Jason Merrill  <jason@redhat.com>
963
964         PR c++/57319
965         * class.c (vbase_has_user_provided_move_assign): New.
966         * method.c (synthesized_method_walk): Check it.
967         * cp-tree.h: Declare it.
968
969         PR c++/57325
970         * tree.c (build_cplus_array_type): Copy layout info if element
971         type is complete.
972
973 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
974
975         PR c++/23608
976         * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
977
978 2013-05-20  Jason Merrill  <jason@redhat.com>
979
980         PR c++/57317
981         * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
982         whether a template has its own args.
983
984 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
985
986         PR c++/57327
987         * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
988
989 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
990
991         PR c++/10207
992         * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
993         instead of cp_parser_initializer_list for compound-literals.
994
995 2013-05-20  Marc Glisse  <marc.glisse@inria.fr>
996
997         PR c++/57175
998         * typeck.c (check_return_expr): Reverse the alignment comparison.
999
1000 2013-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1001
1002         PR c++/18126
1003         * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
1004         correctly sizeof compound-literal; update comments.
1005
1006 2013-05-16  Marc Glisse  <marc.glisse@inria.fr>
1007
1008         * call.c (build_conditional_expr_1): Use cp_build_binary_op
1009         instead of directly calling fold_build2.
1010
1011 2013-05-16  Jason Merrill  <jason@redhat.com>
1012
1013         * Make-lang.in (cc1plus$(exeext)): Use link mutex.
1014
1015         PR c++/57279
1016         * decl.c (grokdeclarator): Allow member function qualifiers in
1017         TYPENAME context in C++11 mode.
1018
1019 2013-05-16  Dodji Seketeli  <dodji@redhat.com>
1020
1021         PR c++/56782 - Regression with empty pack expansions
1022         * pt.c (use_pack_expansion_extra_args_p): When at least a
1023         parameter pack has an empty argument pack, and another parameter
1024         pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
1025         mechanism.
1026
1027 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
1028
1029         * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
1030         warning_at and permerror with warning_at/inform and permerror/
1031         inform, respectively.
1032
1033 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
1034
1035         PR c++/31952
1036         * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
1037         redeclarations.
1038
1039 2013-05-14  Jason Merrill  <jason@redhat.com>
1040
1041         PR c++/57243
1042         * parser.c (cp_parser_range_for): Call complete_type.
1043
1044         PR c++/57041
1045         * pt.c (tsubst_copy_and_build): Don't recur into a designator.
1046
1047 2013-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
1048
1049         PR c++/53903
1050         * method.c (defaulted_late_check): Check for compatible exception
1051         specification out of class explicitly defaulted functions too.
1052
1053 2013-05-14  Jason Merrill  <jason@redhat.com>
1054
1055         PR c++/56998
1056         * semantics.c (potential_constant_expression_1): Make sure the
1057         called function is potentially constant.
1058         * call.c (null_ptr_cst_p): Revert earlier change.
1059
1060 2013-05-13  Jason Merrill  <jason@redhat.com>
1061
1062         PR c++/56998
1063         * call.c (null_ptr_cst_p): An expression with side-effects can't
1064         be a C++03 null pointer constant.
1065
1066         PR c++/57041
1067         * decl.c (reshape_init_class): Handle error_mark_node.
1068
1069         PR c++/57254
1070         * typeck.c (merge_types): Propagate ref-qualifier
1071         in METHOD_TYPE case.
1072
1073         PR c++/57253
1074         * decl.c (grokdeclarator): Apply ref-qualifier
1075         in the TYPENAME case.
1076
1077         PR c++/57252
1078         * decl.c (decls_match): Compare ref-qualifiers.
1079
1080 2013-05-10  Jason Merrill  <jason@redhat.com>
1081
1082         PR c++/57196
1083         * pt.c (convert_template_argument): Use dependent_template_arg_p,
1084         not uses_template_parms.
1085
1086         PR c++/57047
1087         * semantics.c (cxx_fold_indirect_ref): Fix thinko.
1088
1089         PR c++/55149
1090         * semantics.c (add_capture): Error rather than abort on copy
1091         capture of VLA.
1092         * typeck.c (maybe_warn_about_returning_address_of_local): Don't
1093         warn about capture proxy.
1094
1095 2013-05-09  Jason Merrill  <jason@redhat.com>
1096
1097         * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
1098
1099         PR c++/57222
1100         * pt.c (lookup_template_class_1): Handle getting a template
1101         template parameter as D1.
1102
1103         N3639 C++1y VLA diagnostics
1104         * decl.c (grokdeclarator): Complain about reference, pointer, or
1105         typedef to VLA.
1106         (create_array_type_for_decl): Complain about array of VLA.
1107         * pt.c (tsubst): Likewise.
1108         * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
1109         * semantics.c (finish_decltype_type): Complain about decltype of VLA.
1110         * typeck.c (cp_build_addr_expr_1): Complain about VLA.
1111         (cxx_sizeof_or_alignof_type): Likewise.
1112
1113         N3639 C++1y VLA support
1114         * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
1115         (check_array_initializer): Allow VLA init.
1116         (reshape_init_array_1): Adjust.
1117         (cp_finish_decl): Check for invalid VLA length.
1118         * typeck2.c (process_init_constructor_array): Adjust.
1119         (store_init_value): Use build_vec_init for VLAs.
1120         * semantics.c (add_capture): Capture VLA as ptr+len.
1121         (vla_capture_type): New.
1122         (build_capture_proxy): Rebuild the VLA.
1123         * typeck.c (build_simple_component_ref): Split out from...
1124         (build_ptrmemfunc_access_expr): ...here.
1125         * tree.c (array_of_runtime_bound_p): New.
1126         * init.c (throw_bad_array_length): New.
1127         (build_vec_init): Use it.
1128         * parser.c (cp_convert_range_for): When iterating over a VLA,
1129         use it directly rather than bind a reference.
1130         * cp-tree.h: Declare new functions.
1131
1132 2013-05-08  Jason Merrill  <jason@redhat.com>
1133
1134         * except.c (is_admissible_throw_operand_or_catch_parameter): Check
1135         variably_modified_type_p.
1136         (expand_start_catch_block): Mark the typeinfo used here.
1137         * semantics.c (finish_handler_parms): Not here.
1138
1139         * error.c (dump_type_suffix): Try harder on VLA length.
1140
1141         Core 624/N2932
1142         * init.c (throw_bad_array_new_length): New.
1143         (build_new_1): Use it.  Don't warn about braced-init-list.
1144         (build_vec_init): Use it.
1145         * call.c (build_operator_new_call): Use it.
1146
1147         PR c++/57068
1148         * decl.c (grokdeclarator): Warn about ref-qualifiers here.
1149         * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
1150         * error.c (maybe_warn_cpp0x): s/0x/11/.
1151
1152 2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
1153
1154         PR c++/51226
1155         * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
1156         == error_mark_node.
1157
1158 2013-05-06  Marc Glisse  <marc.glisse@inria.fr>
1159
1160         * typeck.c (cp_build_binary_op): Call save_expr before
1161         build_vector_from_val.
1162
1163 2013-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
1164
1165         PR c++/57183
1166         * decl.c (cp_finish_decl): After do_auto_deduction copy the
1167         qualifers with cp_apply_type_quals_to_decl.
1168
1169 2013-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
1170
1171         * pt.c (convert_nontype_argument): Add missing whitespace in
1172         error message.
1173
1174 2013-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1175
1176         PR c++/53745
1177         * decl.c (build_enumerator): Improve error message.
1178
1179 2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
1180
1181         PR c++/14283
1182         * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
1183         messages for template types and fix column numbers.
1184
1185 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
1186
1187         PR c++/57132
1188         * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
1189         c_inhibit_evaluation_warnings around build_x_modify_expr call.
1190
1191 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
1192
1193         PR c++/57092
1194         * semantics.c (finish_decltype_type): Handle instantiated template
1195         non-type arguments.
1196
1197 2013-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
1198
1199         PR c++/56450
1200         * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
1201
1202 2013-04-26  Jakub Jelinek  <jakub@redhat.com>
1203
1204         * error.c (cp_print_error_function): Adjust file_name_as_prefix
1205         caller.
1206
1207 2013-04-25  Jason Merrill  <jason@redhat.com>
1208
1209         PR c++/56859
1210         * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
1211
1212         PR c++/50261
1213         * init.c (perform_member_init): Call reshape_init.
1214
1215 2013-04-24  Jason Merrill  <jason@redhat.com>
1216
1217         PR c++/53721
1218         * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
1219
1220 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
1221
1222         * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
1223         pedwarn to simply use OPT_Wpointer_arith.
1224         (cp_build_unary_op): Likewise.
1225
1226 2013-04-24  Jason Merrill  <jason@redhat.com>
1227
1228         N3648: init-captures are named.
1229         * semantics.c (add_capture): Don't prepend "__" to init-captures.
1230         (build_capture_proxy): Adjust.
1231         * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
1232
1233         N3648: Allow braced and parenthesized initializers.
1234         * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
1235         * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
1236         * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
1237         (add_capture): Collapse a parenthesized initializer into a single
1238         expression.
1239         * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
1240
1241 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
1242
1243         PR c++/56970
1244         * init.c (build_offset_ref): Add tsubst_flags_t parameter.
1245         * semantics.c (finish_qualified_id_expr): Likewise.
1246         (finish_id_expression): Update.
1247         * typeck.c (cp_build_addr_expr_1): Likewise.
1248         * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
1249         * cp-tree.h: Update declarations.
1250
1251 2013-04-22  Jason Merrill  <jason@redhat.com>
1252
1253         Core 1586
1254         * parser.c (cp_parser_unqualified_id): Handle ~auto.
1255         (cp_parser_pseudo_destructor_name): Likewise.
1256         (cp_parser_postfix_dot_deref_expression): Adjust.
1257         (cp_lexer_nth_token_is_keyword): New.
1258         * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
1259         * typeck.c (lookup_destructor): Handle ~auto.
1260
1261         * pt.c (fn_type_unification): Push tinst level around
1262         type_unification_real if we aren't explaining.
1263         * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
1264         * error.c (dump_function_decl): Respect it.
1265         (subst_to_string): Pass it.
1266
1267         PR c++/48665
1268         * rtti.c (get_typeid): Diagnose qualified function type.
1269         * pt.c (tsubst) [POINTER_TYPE]: Likewise.
1270
1271         * error.c (dump_aggr_type): Fix lambda detection.
1272         (dump_simple_decl): Pretty-print capture field.
1273
1274         N3323
1275         * cvt.c (build_expr_type_conversion): Two conversions that return
1276         the same type aren't necessarily ambiguous.
1277
1278         N3648
1279         * parser.c (cp_parser_lambda_introducer): Make lambda capture init
1280         pedwarn unconditional except in C++1y mode.
1281
1282         * semantics.c (potential_constant_expression_1): Don't crash on
1283         'this' in NSDMI.
1284
1285         Core 1612
1286         * semantics.c (finish_id_expression): Reject capture of anonymous
1287         union member.
1288
1289         Core 1609
1290         * decl2.c (check_default_args): Check for pack expansion.
1291
1292         * mangle.c (write_type): Mangle decltype(auto).
1293
1294 2013-04-19  Jason Merrill  <jason@redhat.com>
1295
1296         N3638 changes to return type deduction
1297         * decl.c (undeduced_auto_decl): New.
1298         (require_deduced_type): New.
1299         (fndecl_declared_return_type): New.
1300         (decls_match): Use it.
1301         (duplicate_decls): Don't check for auto return.
1302         (grokdeclarator): Reject virtual auto.
1303         * class.c (resolve_address_of_overloaded_function): Handle
1304         auto function templates.
1305         * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
1306         * cp-tree.h: Declare new fns.
1307         * error.c (dump_function_decl): Use fndecl_declared_return_type.
1308         * search.c (check_final_overrider): Likewise.
1309         * pt.c (make_decltype_auto): New.
1310         (do_auto_deduction): Require plain decltype(auto).
1311         (is_auto): Adjust.
1312
1313         DR 941
1314         * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
1315         template specializations.
1316
1317 2013-04-16  Ed Smith-Rowland  <3dw4rd@verizon.net>
1318
1319         Implement n3599 - Literal operator templates for strings.
1320         * parser.c (make_string_pack (tree value)): New function.
1321         (cp_parser_userdef_string_literal (cp_token *)): Use it
1322         to construct calls to character string literal operator templates.
1323         (cp_parser_template_declaration_after_export): Check for new string
1324         literal operator template parameter form.
1325
1326 2013-04-15  Jason Merrill  <jason@redhat.com>
1327
1328         * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
1329
1330         PR c++/52748
1331         * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
1332         rather than a destructor name, it isn't an unqualified-name.
1333         (tsubst_copy_and_build): Pass down decltype_flag to operator
1334         handling code, too.
1335
1336         PR c++/56388
1337         * semantics.c (insert_capture_proxy): Just use index 1 in the
1338         stmt_list_stack.
1339
1340 2013-04-12  Jakub Jelinek  <jakub@redhat.com>
1341
1342         * error.c (cp_print_error_function,
1343         print_instantiation_partial_context_line,
1344         maybe_print_constexpr_context): Colorize locus strings.
1345
1346 2013-04-11  Jason Merrill  <jason@redhat.com>
1347
1348         PR c++/52748
1349         * parser.c (complain_flags): New.
1350         (cp_parser_postfix_expression): Use it.
1351         (cp_parser_unary_expression): Likewise.
1352         (cp_parser_binary_expression): Likewise.
1353         (cp_parser_assignment_expression): Likewise.
1354         (cp_parser_expression): Likewise.
1355         (cp_parser_postfix_open_square_expression): Take decltype_p.
1356         (cp_parser_builtin_offsetof): Adjust.
1357         (cp_convert_range_for): Pass complain to finish_unary_op_expr.
1358         * decl2.c (grok_array_decl): Add decltype_p parm.
1359         * cp-tree.h: Adjust prototype.
1360         * semantics.c (finish_unary_op_expr): Add complain parm.
1361
1362 2013-04-11  Jakub Jelinek  <jakub@redhat.com>
1363
1364         PR c++/56895
1365         * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
1366         calling maybe_constant_value for C++98.
1367
1368 2013-04-11  Jason Merrill  <jason@redhat.com>
1369
1370         PR c++/56901
1371         * semantics.c (lambda_capture_field_type, lambda_proxy_type):
1372         Strip references before checking WILDCARD_TYPE_P.
1373
1374 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
1375
1376         * call.c (build_conditional_expr_1, build_over_call): Protect
1377         error calls with complain & tf_error.
1378         * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
1379         build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
1380         build_ptrmemfunc): Likewise.
1381         (lookup_destructor): Take tsubst_flags_t parameter, adjust.
1382
1383         * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
1384         (convert_to_reference): Adjust.
1385
1386 2013-04-11  Jason Merrill  <jason@redhat.com>
1387
1388         * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
1389         local variables, look them up instead.
1390         (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
1391         proxies and substitution in unevaluated context.
1392         (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
1393         before the iterators.
1394
1395         PR c++/23055
1396         * pt.c (uses_deducible_template_parms): New.
1397         (deducible_array_bound, deducible_expression): New.
1398         (deducible_template_args): New.
1399         (unify_one_argument): Call uses_deducible_template_parms.
1400
1401 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
1402
1403         PR c++/56913
1404         * typeck2.c (build_m_component_ref): Protect error calls with
1405         (complain & tf_error).
1406
1407 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
1408
1409         PR c++/54216
1410         * parser.c (cp_parser_enum_specifier): Check for empty
1411         anonymous enums and anonymous scoped enums.
1412
1413 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
1414
1415         PR c++/56895
1416         * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
1417         first before calling maybe_constant_value for warn_for_div_by_zero
1418         or invalid shift count warning purposes.
1419
1420 2013-04-09  Jason Merrill  <jason@redhat.com>
1421
1422         PR c++/25466
1423         * rtti.c (build_typeid): Check the address of the argument
1424         rather than looking for an INDIRECT_REF.
1425
1426 2013-04-04  Jason Merrill  <jason@redhat.com>
1427
1428         PR c++/56838
1429         PR c++/17232
1430         * typeck2.c (abstract_virtuals_error_sfinae): Disable
1431         complete_type again.
1432
1433 2013-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
1434
1435         PR c++/56871
1436         * decl.c (validate_constexpr_redeclaration): Allow an explicit
1437         specialization to be different wrt the constexpr specifier.
1438
1439 2013-04-06  Jason Merrill  <jason@redhat.com>
1440
1441         * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
1442         noreturn attribute.
1443
1444 2013-04-05  Ed Smith-Rowland  <3dw4rd@verizon.net>
1445
1446         * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
1447         cp_parser_ref_qualifier_opt.  Error if more than one ref-qual found.
1448
1449 2013-04-03  Jason Merrill  <jason@redhat.com>
1450
1451         * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
1452         (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
1453         (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
1454
1455         * mangle.c (write_type): When writing a function type with
1456         function-cv-quals, don't add the unqualified type as a
1457         substitution candidate.
1458
1459 2013-04-03  Paolo Carlini  <paolo.carlini@oracle.com>
1460
1461         PR c++/56815
1462         * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
1463         pedwarn.
1464
1465 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
1466
1467         PR debug/56819
1468         * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
1469         from args to new_args.
1470         (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
1471         r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
1472
1473 2013-04-02  Jason Merrill  <jason@redhat.com>
1474
1475         PR c++/56821
1476         * mangle.c (write_function_type): Mangle ref-qualifier.
1477         (write_nested_name): Likewise.
1478         (canonicalize_for_substitution): Preserve ref-qualifier.
1479         (write_type): Likewise.
1480
1481         PR c++/34949
1482         * decl.c (begin_destructor_body): Clobber the object in a cleanup.
1483
1484 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
1485
1486         * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
1487         * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
1488         (for_each_template_parm_r): Use TYPE_TI_ARGS.
1489
1490 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
1491
1492         * cp-tree.h (TAGGED_TYPE_P): Remove.
1493         (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
1494         (TYPE_ANONYMOUS_P): Adjust.
1495         * call.c (build_new_op_1): Likewise.
1496         * class.c (find_abi_tags_r): Likewise.
1497         * decl.c (warn_misplaced_attr_for_class_type, start_decl,
1498         type_is_deprecated): Likewise.
1499         * decl2.c (grokfield, min_vis_r): Likewise.
1500         * pt.c (get_template_info): Likewise.
1501         * tree.c (handle_abi_tag_attribute): Likewise.
1502
1503 2013-04-01  Jason Merrill  <jason@redhat.com>
1504
1505         * semantics.c (maybe_constant_value): Check
1506         instantiation_dependent_expression_p.
1507         * pt.c (build_non_dependent_expr): Don't check it here.
1508
1509         PR c++/56772
1510         * init.c (build_new): Don't try to process an array initializer
1511         at template definition time.
1512
1513         PR c++/56793
1514         * typeck.c (finish_class_member_access_expr): Handle enum scope.
1515
1516         PR c++/56794
1517         * parser.c (cp_parser_range_for): Don't try to do auto deduction
1518         in a template if the type of the range is incomplete.
1519
1520         * call.c (add_function_candidate): Take the address of 'this' here.
1521         (build_over_call): And here.
1522         (build_new_method_call_1, build_op_call_1): Not here.
1523         (build_user_type_conversion_1): Or here.
1524         (add_candidates): Adjust.
1525
1526         * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
1527         * class.c (same_signature_p): Use type_memfn_quals.
1528         * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
1529         FUNCTION_OR_METHOD_TYPE_CHECK.
1530         * error.c (dump_type_suffix): Add padding before cv-qualifiers.
1531         * pt.c (unify): Use static_fn_type.
1532
1533 2013-04-01  Bronek Kozicki <b.kozicki@gmail.com>
1534             Jason Merrill  <jason@redhat.com>
1535
1536         Implement N2439 (ref-qualifiers for 'this')
1537         * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
1538         (FUNCTION_RVALUE_QUALIFIED): New.
1539         (FUNCTION_OR_METHOD_TYPE_CHECK): New.
1540         (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
1541         (cp_ref_qualifier): New enum.
1542         (cp_declarator): Add ref_qualifier.
1543         * parser.c (cp_parser_ref_qualifier_seq_opt): New.
1544         (cp_parser_direct_declarator): Use it.
1545         (make_call_declarator): Adjust.
1546         (cp_parser_lambda_declarator_opt): Adjust.
1547         * call.c (add_function_candidate): Handle ref-qualifier overload
1548         resolution semantics.
1549         (standard_conversion): Adjust.
1550         * class.c (add_method, same_signature_p): Compare ref-qualifiers.
1551         * decl.c (grokdeclarator): Handle ref-qualifiers.
1552         (grokfndecl): Check for invalid ref-qualifiers.
1553         (static_fn_type, revert_static_member_fn): Adjust.
1554         * decl2.c (build_memfn_type): Handle ref-qualifiers.
1555         (check_classfn): Check them.
1556         (cp_reconstruct_complex_type): Retain them.
1557         * error.c (dump_ref_qualifier): New.
1558         (dump_type_suffix, dump_function_decl): Use it.
1559         (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
1560         * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
1561         (unify): Retain them.
1562         * tree.c (cp_check_qualified_type): New.
1563         (cp_build_qualified_type_real): Keep exception spec and ref-qual.
1564         (build_ref_qualified_type): New.
1565         (strip_typedefs, build_exception_variant): Keep ref-qualifier.
1566         (cp_build_type_attribute_variant): Keep ref-qualifier.
1567         * typeck.c (merge_types): Keep ref-qualifier.
1568         (structural_comptypes): Compare ref-qualifier.
1569         (type_memfn_rqual): New.
1570         (apply_memfn_quals): Take ref-qual argument.
1571         * typeck2.c (build_m_component_ref): Check ref-qualifier.
1572
1573 2013-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
1574
1575         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
1576         (DECL_FUNCTION_TEMPLATE_P): Adjust.
1577
1578         * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
1579         pp_cxx_qualified_id): Use get_containing_scope.
1580         * parser.c (cp_parser_class_head): Likewise.
1581         * pt.c (push_template_decl_real): Likewise.
1582
1583         * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
1584         * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
1585
1586 2013-03-31  Paolo Carlini  <paolo.carlini@oracle.com>
1587
1588         * decl2.c (collect_candidates_for_java_method_aliases): Use
1589         DECL_CLASS_SCOPE_P.
1590         * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
1591         (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
1592         * decl.c (duplicate_decls): Likewise.
1593         * parser.c (cp_parser_template_declaration_after_export): Likewise,
1594         also DECL_DECLARES_TYPE_P.
1595         * pt.c (instantiate_class_template_1): Likewise.
1596         * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
1597         (lookup_field_r): Likewise.
1598         (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
1599         (lookup_fnfields_slot_nolazy): Likewise.
1600         * semantics.c (finish_member_declaration): Likewise.
1601         * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
1602
1603 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1604
1605         * pt.c (template_parms_to_args): Fix typo in comment.
1606
1607 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
1608
1609         * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
1610
1611 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
1612
1613         * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
1614         (build_op_call_1): Likewise.
1615         (build_over_call): Likewise.
1616         (compare_ics): Likewise.
1617         * class.c (build_base_path): Likewise.
1618         (resolve_address_of_overloaded_function): Likewise.
1619         * cp-tree.h: Likewise.
1620         * cvt.c (cp_convert_to_pointer): Likewise.
1621         (convert_to_reference): Likewise.
1622         (ocp_convert): Likewise.
1623         (convert_force): Likewise, tidy.
1624         * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
1625         (pp_cxx_ptr_operator): Likewise.
1626         * decl.c (duplicate_decls): Likewise.
1627         (start_decl): Likewise.
1628         (grok_op_properties): Likewise.
1629         (start_preparsed_function): Likewise.
1630         (store_parm_decls): Likewise.
1631         (finish_function): Likewise.
1632         * decl2.c (delete_sanity): Likewise.
1633         (acceptable_java_type): Likewise.
1634         (grokbitfield): Likewise.
1635         (cp_reconstruct_complex_type): Likewise.
1636         * error.c (dump_type_prefix): Likewise.
1637         (dump_expr): Likewise.
1638         * except.c (push_eh_cleanup): Likewise.
1639         (complete_ptr_ref_or_void_ptr_p): Likewise.
1640         (can_convert_eh): Likewise.
1641         * init.c (build_new_1): Likewise.
1642         (build_delete): Likewise.
1643         (build_vec_delete): Likewise.
1644         * mangle.c (write_type): Likewise.
1645         * parser.c (lookup_literal_operator): Likewise.
1646         * pt.c (convert_nontype_argument_function): Likewise.
1647         (convert_nontype_argument): Likewise.
1648         (tsubst): Likewise.
1649         (unify): Likewise.
1650         (dependent_type_p_r): Likewise.
1651         * rtti.c (build_headof): Likewise.
1652         (build_typeid): Likewise.
1653         (build_dynamic_cast_1): Likewise.
1654         (target_incomplete_p): Likewise.
1655         (typeinfo_in_lib_p): Likewise.
1656         * semantics.c (finish_omp_for): Likewise.
1657         (cxx_eval_call_expression): Likewise.
1658         (maybe_resolve_dummy): Likewise.
1659         * tree.c (build_target_expr): Likewise.
1660         (cp_build_qualified_type_real): Likewise.
1661         * typeck.c (composite_pointer_type_r): Likewise.
1662         (composite_pointer_type): Likewise.
1663         (comp_except_types): Likewise.
1664         (cxx_sizeof_nowarn): Likewise.
1665         (string_conv_p): Likewise.
1666         (cp_build_array_ref): Likewise.
1667         (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
1668         (pointer_diff): Likewise.
1669         (cp_build_addr_expr_1): Likewise.
1670         (cp_build_unary_op): Likewise.
1671         (build_static_cast_1): Likewise.
1672         (cp_build_c_cast): Likewise.
1673         (comp_ptr_ttypes_real): Likewise.
1674         (ptr_reasonably_similar): Likewise.
1675         (comp_ptr_ttypes_const): Likewise.
1676         (casts_away_constness): Likewise.
1677         (check_literal_operator_args): Likewise.
1678         * typeck2.c (build_x_arrow): Likewise.
1679         (add_exception_specifier): Likewise.
1680
1681 2013-03-29  Jason Merrill  <jason@redhat.com>
1682
1683         N3582
1684         * cp-tree.h (AUTO_IS_DECLTYPE): New.
1685         * parser.c (cp_parser_decltype): Handle decltype(auto).
1686         (cp_parser_type_id_1): Allow auto without a late-specified
1687         return in C++1y.
1688         (cp_parser_primary_expression): Use the return value of
1689         finish_parenthesized_expr.
1690         (cp_parser_transaction_expression): Likewise.
1691         * semantics.c (force_paren_expr): New.
1692         (finish_parenthesized_expr): Use it.
1693         * call.c (build_conditional_expr_1): Likewise.
1694         * pt.c (do_auto_deduction): Handle decltype(auto).
1695         (tsubst_copy): Handle PAREN_EXPR.
1696         (tsubst_copy_and_build): Likewise.
1697         * error.c (dump_expr): Handle PAREN_EXPR.
1698         * cxx-pretty-print.c (pp_cxx_expression): Likewise.
1699         * mangle.c (write_expression): Ignore PAREN_EXPR.
1700
1701         * parser.c (cp_parser_decltype_expr): Split out...
1702         (cp_parser_decltype): ...from here.
1703
1704         PR c++/56774
1705         PR c++/35722
1706         * pt.c (unify_pack_expansion): Fix indexing.
1707
1708 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1709
1710         * call.c (build_java_interface_fn_ref): Likewise.
1711         (make_temporary_var_for_ref_to_temp): Likewise.
1712         * class.c (check_field_decls): Likewise.
1713         (layout_class_type): Likewise.
1714         (finish_struct_1): Likewise.
1715         (fixed_type_or_null): Likewise.
1716         (get_vtbl_decl_for_binfo): Likewise.
1717         * cp-gimplify.c (omp_var_to_track): Likewise.
1718         (cp_genericize_r): Likewise.
1719         * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
1720         * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
1721         (DECL_DISCRIMINATOR_P): Likewise.
1722         * decl.c (poplevel): Likewise.
1723         (decls_match): Likewise.
1724         (duplicate_decls): Likewise.
1725         (decl_jump_unsafe): Likewise.
1726         (start_decl): Likewise.
1727         (check_for_uninitialized_const_var): Likewise.
1728         (make_rtl_for_nonlocal_decl): Likewise.
1729         (cp_finish_decl): Likewise.
1730         (expand_static_init): Likewise.
1731         (local_variable_p): Likewise.
1732         (maybe_register_incomplete_var): Likewise.
1733         * decl2.c (grokfield): Likewise.
1734         (comdat_linkage): Likewise.
1735         (determine_visibility): Likewise.
1736         (import_export_decl): Likewise.
1737         (prune_vars_needing_no_initialization): Likewise.
1738         (decl_maybe_constant_var_p): Likewise.
1739         * error.c (dump_simple_decl): Likewise.
1740         (dump_template_decl): Likewise.
1741         (cp_printer): Likewise.
1742         * except.c (build_throw): Likewise.
1743         * init.c (build_vtbl_address): Likewise.
1744         (member_init_ok_or_else): Likewise.
1745         (build_aggr_init): Likewise.
1746         (expand_aggr_init_1): Likewise.
1747         (build_offset_ref): Likewise.
1748         (constant_value_1): Likewise.
1749         * mangle.c (write_mangled_name): Likewise.
1750         (write_prefix): Likewise.
1751         * name-lookup.c (supplement_binding_1): Likewise.
1752         (add_decl_to_level): Likewise.
1753         (pushdecl_maybe_friend_1): Likewise.
1754         (check_for_out_of_scope_variable): Likewise.
1755         (validate_nonmember_using_decl): Likewise.
1756         (lookup_name_innermost_nonclass_level_1): Likewise.
1757         (lookup_arg_dependent_1): Likewise.
1758         * parser.c (cp_parser_lambda_introducer): Likewise.
1759         (cp_parser_template_argument): Likewise.
1760         (cp_parser_single_declaration): Likewise.
1761         * pt.c (convert_nontype_argument): Likewise.
1762         (instantiate_class_template_1): Likewise.
1763         (tsubst_decl): Likewise.
1764         (tsubst_expr): Likewise.
1765         (do_decl_instantiation): Likewise.
1766         (do_type_instantiation): Likewise.
1767         (regenerate_decl_from_template): Likewise.
1768         (always_instantiate_p): Likewise.
1769         (instantiate_decl): Likewise.
1770         (type_dependent_expression_p): Likewise.
1771         (build_non_dependent_expr): Likewise.
1772         * repo.c (repo_emit_p): Likewise.
1773         * rtti.c (build_dynamic_cast_1): Likewise.
1774         * search.c (shared_member_p): Likewise.
1775         * semantics.c (outer_var_p): Likewise.
1776         (finish_id_expression): Likewise.
1777         (finish_omp_clauses): Likewise.
1778         (finish_decltype_type): Likewise.
1779         (ensure_literal_type_for_constexpr_object): Likewise.
1780         * tree.c (lvalue_kind): Likewise.
1781         (bot_replace): Likewise.
1782         (cp_tree_equal): Likewise.
1783         (handle_init_priority_attribute): Likewise.
1784         (decl_storage_duration): Likewise.
1785         * typeck.c (cxx_sizeof_expr): Likewise.
1786         (cxx_alignof_expr): Likewise.
1787         (decay_conversion): Likewise.
1788         (build_class_member_access_expr): Likewise.
1789         (cp_build_array_ref): Likewise.
1790         (cxx_mark_addressable): Likewise.
1791         (maybe_warn_about_returning_address_of_local): Likewise.
1792         (check_return_expr): Likewise.
1793         * typeck2.c (cxx_readonly_error): Likewise.
1794         (abstract_virtuals_error_sfinae): Likewise.
1795         (cxx_incomplete_type_diagnostic): Likewise.
1796
1797 2013-03-28  Lawrence Crowl  <crowl@google.com>
1798
1799         * Make-lang.in
1800         (CXX_PARSER_H): Add header dependence.
1801         * cp-tree.h
1802         (extern debug (cp_binding_level &)): New.
1803         (extern debug (cp_binding_level *)): New.
1804         * name-lookup.h
1805         (debug (cp_binding_level &)): New.
1806         (debug (cp_binding_level *)): New.
1807         * parser.c
1808         (debug (cp_parser &)): New.
1809         (debug (cp_parser *)): New.
1810         (debug (cp_token &)): New.
1811         (debug (cp_token *)): New.
1812         (debug (vec<cp_token, va_gc> &)): New.
1813         (debug (vec<cp_token, va_gc> *)): New.
1814         * parser.c: Add header dependence.
1815         (extern debug (cp_parser &)): New.
1816         (extern debug (cp_parser *)): New.
1817         (extern debug (cp_token &)): New.
1818         (extern debug (cp_token *)): New.
1819         (extern debug (vec<cp_token, va_gc> &)): New.
1820         (extern debug (vec<cp_token, va_gc> *)): New.
1821
1822 2013-03-28  Jason Merrill  <jason@redhat.com>
1823
1824         PR c++/17232
1825         PR c++/52748
1826         * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
1827         the type if tf_decltype is set.
1828         * pt.c (fn_type_unification): Add decltype_p parm.
1829         (get_bindings): Adjust.
1830         * cp-tree.h: Adjust.
1831         * class.c (resolve_address_of_overloaded_function): Adjust.
1832         * call.c (add_template_candidate_real, print_z_candidate): Adjust.
1833
1834         PR c++/56679
1835         * parser.c (cp_parser_sizeof_pack): Split out from...
1836         (cp_parser_sizeof_operand): ...here.  Require (id).
1837
1838         PR c++/56701
1839         * semantics.c (finish_this_expr): 'this' is an rvalue.
1840         * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
1841
1842         PR c++/56710
1843         * semantics.c (finish_member_declaration): Don't push closure
1844         members.
1845
1846         * name-lookup.c (pushdecl_maybe_friend_1): Use
1847         nonlambda_method_basetype and current_nonlambda_class_type.
1848
1849         PR c++/56728
1850         * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
1851         conversion from integer to pointer.
1852         (cxx_eval_constant_expression): Likewise.
1853         (cxx_eval_indirect_ref): Use the folded operand if we still think
1854         this might be constant.
1855
1856 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
1857             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1858
1859         PR c++/56725
1860         * call.c (convert_like_real): Change series of two permerrors
1861         to permerror + inform (and likewise for two errors).
1862         (build_new_method_call_1): Likewise.
1863         * typeck.c (convert_for_initialization): Change additional
1864         warning or error to inform.
1865
1866 2013-03-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1867
1868         * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
1869         (first_aggr_init_expr): Likewise.
1870         (more_aggr_init_expr_args_p): Likewise.
1871         (type_of_this_parm): Likewise.
1872         (class_of_this_parm): Likewise.
1873         * name-lookup.h (get_global_value_if_present): Likewise.
1874         (is_typename_at_global_scope): Likewise.
1875
1876 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
1877
1878         * call.c (joust): Don't call inform for a permerror returning false.
1879         * parser.c (cp_parser_check_class_key): Likewise.
1880         * pt.c (tsubst_copy_and_build): Likewise.
1881
1882 2013-03-27  Jason Merrill  <jason@redhat.com>
1883
1884         PR c++/56749
1885         * semantics.c (finish_qualified_id_expr): Return early
1886         for enum scope.
1887
1888 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1889
1890         * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1891         * cvt.c (convert_to_void): Likewise.
1892         * error.c (dump_expr): Likewise.
1893         * mangle.c (write_expression): Likewise.
1894         * parser.c (cp_parser_template_argument): Likewise.
1895         * pt.c (convert_nontype_argument): Likewise.
1896         (tsubst_copy_and_build): Likewise.
1897         * rtti.c (build_typeid): Likewise.
1898         * semantics.c (finish_call_expr): Likewise.
1899         (finish_decltype_type): Likewise.
1900         (build_data_member_initialization): Likewise.
1901         * tree.c (is_dummy_object): Likewise.
1902         * typeck.c (decay_conversion): Likewise.
1903         (build_class_member_access_expr): Likewise.
1904         (cp_build_addr_expr_1): Likewise.
1905         (unary_complex_lvalue): Likewise.
1906         (check_return_expr): Likewise.
1907         * typeck2.c (cxx_readonly_error): Likewise.
1908
1909 2013-03-26  Jason Merrill  <jason@redhat.com>
1910
1911         PR c++/52597
1912         * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn.  Take tree.
1913         * semantics.c (finish_decltype_type): Check it before type_unknown_p.
1914         * cp-tree.h: Adjust prototype.
1915
1916         PR c++/45282
1917         * typeck2.c (build_m_component_ref): Handle prvalue object.
1918
1919 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1920
1921         * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
1922         * decl.c (duplicate_decls): Likewise.
1923         (cp_finish_decl): Likewise.
1924         (check_class_member_definition_namespace): Likewise.
1925         * decl2.c (grokfield): Likewise.
1926         (decl_needed_p): Likewise.
1927         (import_export_decl): Likewise.
1928         (mark_used): Likewise.
1929         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1930         * pt.c (push_access_scope): Likewise.
1931         (instantiate_decl): Likewise.
1932         * ptree.c (cxx_print_decl): Likewise.
1933         * repo.c (repo_emit_p): Likewise.
1934         * semantics.c (note_decl_for_pch): Likewise.
1935         * tree.c (decl_linkage): Likewise.
1936
1937 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
1938
1939         PR c++/55951
1940         * decl.c (check_array_designated_initializer): Handle CONST_DECL
1941         as ce->index.
1942
1943 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
1944
1945         * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1946         error messages.
1947
1948         * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1949
1950 2013-03-25  Jason Merrill  <jason@redhat.com>
1951
1952         PR c++/56699
1953         * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1954         class is derived from the type of the object.
1955
1956         PR c++/52014
1957         * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1958         unevaluated context.
1959
1960 2013-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
1961
1962         PR c++/56722
1963         * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1964         DECL_TEMPLATE_INSTANTIATION.
1965
1966 2013-03-22  Jason Merrill  <jason@redhat.com>
1967
1968         PR c++/56684
1969         * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1970         and CONST_DECL.
1971
1972 2013-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1973
1974         * cp-tree.h (identifier_p): New.
1975         * call.c: Throughout, call identifier_p insstead of direct
1976         comparaison of TREE_CODE against IDENTIFIER_NODE.
1977         * decl.c: Likewisse.
1978         * decl2.c: Likewise.
1979         * init.c: Likewise.
1980         * mangle.c: Likewise.
1981         * name-lookup.c: Likewise.
1982         * parser.c: Likewise.
1983         * pt.c: Likewise.
1984         * search.c: Likewise.
1985         * semantics.c: Likewise.
1986         * tree.c: Likewise.
1987         * typeck.c: Likewise.
1988         * typeck2.c: Likewise.
1989
1990 2013-03-21  Jakub Jelinek  <jakub@redhat.com>
1991
1992         PR middle-end/48087
1993         * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1994         * call.c (build_temp): Likewise.
1995         * method.c (synthesize_method): Likewise.
1996         * typeck.c (convert_for_initialization): Likewise.
1997
1998 2013-03-21  Marc Glisse  <marc.glisse@inria.fr>
1999
2000         * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
2001
2002 2013-03-21  Richard Biener  <rguenther@suse.de>
2003
2004         * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
2005         DECL_DEBUG_EXPR_IS_FROM.  Guard properly.
2006
2007 2013-03-20  Jason Merrill  <jason@redhat.com>
2008
2009         PR c++/56646
2010         * parser.c (cp_parser_late_return_type_opt): Save and restore
2011         current_class_ptr/ref.
2012
2013         PR c++/54532
2014         * expr.c (cplus_expand_constant): Do nothing if the class is
2015         incomplete.
2016         * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
2017         * typeck2.c (store_init_value): Use reduced_constant_expression_p.
2018         * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
2019         (complete_vars): Likewise.
2020
2021         * name-lookup.c (get_anonymous_namespace_name): Never use
2022         get_file_function_name.
2023
2024         * pt.c (retrieve_specialization): Handle null tmpl argument.
2025
2026         PR c++/17232
2027         PR c++/56642
2028         * pt.c (tsubst_decl): Check return value of register_specialization.
2029         * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
2030         change.
2031
2032 2013-03-17  Jason Merrill  <jason@redhat.com>
2033
2034         PR c++/54359
2035         PR c++/56639
2036         * parser.c (cp_parser_direct_declarator): Bail if we see a
2037         qualified-id not at namespace scope.
2038
2039         PR c++/17232
2040         PR c++/56642
2041         * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
2042         change for now.
2043
2044 2013-03-16  Jason Merrill  <jason@redhat.com>
2045
2046         * decl.c (grokdeclarator): Assert that we won't see a pointer to
2047         METHOD_TYPE.
2048
2049         PR c++/54277
2050         * cp-tree.h (WILDCARD_TYPE_P): Split out from...
2051         (MAYBE_CLASS_TYPE_P): ...here.
2052         * semantics.c (lambda_capture_field_type): Only build a
2053         magic decltype for wildcard types.
2054         (lambda_proxy_type): Likewise.
2055         (finish_non_static_data_member): Get the quals from
2056         the object.
2057
2058         PR c++/55931
2059         * parser.c (cp_parser_template_argument): Don't
2060         fold_non_dependent_expr.
2061
2062         * parser.c (cp_parser_lambda_declarator_opt): Use
2063         cp_parser_trailing_type_id.
2064
2065         PR c++/45917
2066         * parser.c (cp_parser_template_id): Don't forget access checks.
2067
2068         PR c++/52374
2069         * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
2070
2071         PR c++/54764
2072         PR c++/55972
2073         * name-lookup.h (tag_scope): Add ts_lambda.
2074         * semantics.c (begin_lambda_type): Use it.
2075         * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
2076         * pt.c (check_default_tmpl_args): Ignore lambdas.
2077         (push_template_decl_real): Handle lambdas.
2078         * tree.c (no_linkage_check): Adjust lambda check.
2079
2080         PR c++/56039
2081         * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
2082
2083         PR c++/54359
2084         * parser.c (cp_parser_direct_declarator): Fix late return
2085         for out-of-class defn of member function.
2086
2087         PR c++/55357
2088         * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
2089         parms to avoid duplicate -Wshadow warnings.
2090
2091         * search.c (lookup_base): Handle NULL_TREE.
2092
2093         PR c++/56481
2094         * semantics.c (potential_constant_expression_1): Use of 'this' in
2095         a non-constexpr function makes the expression not potentially
2096         constant.
2097
2098         N3276
2099         PR c++/52748
2100         * cp-tree.h (tsubst_flags): Add tf_decltype.
2101         * call.c (build_cxx_call): Don't build a temporary if it's set.
2102         (build_over_call): Make sure it's only passed to build_cxx_call.
2103         * parser.c (cp_parser_primary_expression): Add decltype_p parm.
2104         (cp_parser_unary_expression): Likewise.
2105         (cp_parser_cast_expression): Likewise.
2106         (cp_parser_binary_expression): Likewise.
2107         (cp_parser_assignment_expression): Likewise.
2108         (cp_parser_postfix_expression): Likewise.  Pass tf_decltype.
2109         (cp_parser_expression): Add decltype_p.  Force a
2110         temporary for a call on the LHS of a comma.
2111         (cp_parser_decltype): Pass true to decltype_p parms.
2112         * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
2113         (tsubst_copy_and_build): Pass tf_decltype down only for
2114         CALL_EXPR and the RHS of COMPOUND_EXPR.
2115         * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
2116
2117         * cp-tree.h (abstract_class_use): New enum.
2118         * typeck2.c (pending_abstract_type): Add use field.
2119         (abstract_virtuals_error_sfinae): Add overloads taking
2120         abstract_class_use instead of tree.
2121         * typeck.c (build_static_cast_1): Call it.
2122         * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
2123         * pt.c: Adjust calls.
2124         * decl.c (cp_finish_decl): Don't handle functions specially.
2125         (grokdeclarator): Always check return type.
2126         * init.c (build_new_1): Adjust call.
2127
2128         DR 337
2129         PR c++/17232
2130         * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
2131         * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
2132
2133         DR 657
2134         * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
2135         (tsubst_arg_types): Likewise.
2136
2137         DR 1518
2138         PR c++/54835
2139         * call.c (convert_like_real): Check for explicit constructors
2140         even for value-initialization.
2141
2142         PR c++/54946
2143         * pt.c (convert_nontype_argument): Handle invalid pointer.
2144
2145         * parser.c (cp_parser_lambda_expression): Use nreverse.
2146
2147         PR c++/56447
2148         PR c++/55532
2149         * pt.c (instantiate_class_template_1): Instantiate lambda capture
2150         list here.
2151         (tsubst_copy_and_build): Not here.
2152
2153         PR c++/55017
2154         * method.c (walk_field_subobs): Disallow copy of rvalue ref.
2155
2156         PR c++/55240
2157         * parser.c (parsing_nsdmi): New.
2158         * semantics.c (outer_automatic_var_p): Check it.
2159         (finish_id_expression): Likewise.
2160         * cp-tree.h: Declare it.
2161
2162         PR c++/55241
2163         * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
2164
2165         * parser.c (lookup_literal_operator): Correct parm/arg naming
2166         mixup.
2167
2168         PR c++/56238
2169         * pt.c (fold_non_dependent_expr_sfinae): Check
2170         instantiation_dependent_expression_p.
2171
2172         PR c++/56095
2173         * class.c (resolve_address_of_overloaded_function): Accept a
2174         reference to function for target_type.
2175         (instantiate_type): Likewise.
2176         * pt.c (convert_nontype_argument): Pass it to
2177         convert_nontype_argument_function.
2178
2179 2013-03-16  Jakub Jelinek  <jakub@redhat.com>
2180
2181         * tree.c (cp_tree_equal): Fix a pasto.
2182
2183         PR c++/56607
2184         * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
2185         pass op1 through maybe_constant_value first.
2186
2187 2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>
2188
2189         PR c++/56582
2190         * semantics.c (cxx_eval_array_reference): Check for negative index.
2191
2192 2013-03-14  Jason Merrill  <jason@redhat.com>
2193
2194         PR c++/56614
2195         * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
2196
2197         PR c++/56346
2198         * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
2199         dso_handle parm on targets without __cxa_atexit.
2200
2201 2013-03-11  Jason Merrill  <jason@redhat.com>
2202
2203         PR c++/56567
2204         * typeck.c (check_return_expr): Disallow returning init list here.
2205         * semantics.c (apply_deduced_return_type): Not here.
2206
2207 2013-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
2208
2209         PR c++/51412
2210         * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
2211         * error.c (dump_expr): Likewise.
2212
2213 2013-03-08  Jason Merrill  <jason@redhat.com>
2214
2215         PR c++/51884
2216         * class.c (modify_all_vtables): Mangle the vtable name before
2217         entering dfs_walk.
2218
2219         * semantics.c (lambda_expr_this_capture): In unevaluated context,
2220         just return the nearest 'this'.
2221
2222         PR c++/51494
2223         PR c++/52183
2224         PR c++/56222
2225         * tree.c (maybe_dummy_object): Don't capture 'this'.
2226         * semantics.c (maybe_resolve_dummy): New.
2227         (finish_non_static_data_member): Use it.
2228         (finish_qualified_id_expr): Don't test is_dummy_object.
2229         * cp-tree.h: Declare maybe_resolve_dummy.
2230         * call.c (build_new_method_call_1): Use it.
2231
2232         PR c++/56567
2233         * semantics.c (apply_deduced_return_type): Don't allow returning
2234         std::initializer_list.
2235
2236 2013-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
2237
2238         PR c++/56534
2239         * parser.c (cp_parser_elaborated_type_specifier): Don't call
2240         check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
2241         * decl.c (check_elaborated_type_specifier): Tidy.
2242
2243 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
2244
2245         PR c++/56543
2246         * tree.c (strip_typedefs): Don't copy args if they are NULL.
2247
2248 2013-03-05  Jakub Jelinek  <jakub@redhat.com>
2249
2250         * parser.c (cp_parser_braced_list): For {} initialize
2251         *non_constant_p to false.
2252
2253 2013-03-04  Jason Merrill  <jason@redhat.com>
2254
2255         PR c++/56464
2256         PR c++/54383
2257         * semantics.c (lambda_expr_this_capture): Handle NSDMI
2258         and non-class scopes.
2259
2260 2013-03-01  Paolo Carlini  <paolo.carlini@oracle.com>
2261
2262         * decl.c (grokdeclarator): Remove dead code.
2263
2264 2013-02-28  Jason Merrill  <jason@redhat.com>
2265
2266         PR c++/56481
2267         * semantics.c (potential_constant_expression_1): Use
2268         cxx_eval_outermost_constant_expr rather than maybe_constant_value.
2269
2270         PR c++/56243
2271         * call.c (build_over_call): Avoid virtual lookup in a template.
2272
2273 2013-02-27  Jason Merrill  <jason@redhat.com>
2274
2275         PR c++/56358
2276         PR c++/56323
2277         * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
2278         of the base name for inheriting ctors.
2279         (push_class_level_binding_1): Remove inheriting ctor handling.
2280         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2281         * class.c (add_implicitly_declared_members): Adjust.
2282
2283 2013-02-26  David Binderman  <dcb314@hotmail.com>
2284
2285         PR c++/55632
2286         * decl.c (grokdeclarator): Tidy publicp assignment.
2287
2288 2013-02-25  Aldy Hernandez  <aldyh@redhat.com>
2289
2290         PR c++/56419
2291         * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
2292         (build_transaction_expr): Same.
2293
2294 2013-02-25  Jason Merrill  <jason@redhat.com>
2295
2296         PR c++/56377
2297         * pt.c (fn_type_unification): Wait to call push_tinst_level until
2298         we know what args we're looking at.
2299
2300         PR c++/56438
2301         * semantics.c (potential_constant_expression_1): In C++98, a cast
2302         to non-integral type can't be a constant expression.
2303
2304 2013-02-24  Jakub Jelinek  <jakub@redhat.com>
2305
2306         PR c++/56403
2307         * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
2308         of CLASS_TYPE_P.
2309
2310 2013-02-22  Jason Merrill  <jason@redhat.com>
2311
2312         PR c++/40405
2313         * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
2314         if we got the wrong number of template parms.
2315
2316         PR c++/56377
2317         * pt.c (fn_type_unification): Use explicit args in template
2318         instantiation context.
2319
2320         PR c++/56359
2321         * call.c (can_convert_arg): Discard access checks.
2322
2323         PR c++/56395
2324         * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
2325         args.
2326
2327 2013-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
2328
2329         PR c++/56373
2330         * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
2331         * cvt.c (ocp_convert): Use the latter.
2332         (cp_convert_to_pointer): Likewise.
2333         * decl.c (check_default_argument): Likewise.
2334         * typeck.c (cp_build_binary_op): Likewise.
2335         * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
2336
2337 2013-02-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
2338             Paolo Carlini  <paolo.carlini@oracle.com>
2339
2340         PR c++/51242
2341         * decl2.c (grokbitfield): Allow scoped enumeration types.
2342
2343 2013-02-15  Jason Merrill  <jason@redhat.com>
2344
2345         PR c++/54276
2346         * semantics.c (finish_id_expression): Also return the identifier
2347         for an outer local static.
2348
2349         PR c++/56343
2350         * class.c (check_bases_and_members): Deduce noexcept after
2351         checking bases.
2352
2353         PR c++/52026
2354         * semantics.c (finish_id_expression): In a template, return
2355         the identifier for a constant variable.
2356
2357 2013-02-14  Jason Merrill  <jason@redhat.com>
2358
2359         PR c++/54922
2360         * semantics.c (build_anon_member_initialization): New.
2361         (build_data_member_initialization): Use it.
2362
2363         PR c++/55003
2364         * decl.c (cp_finish_decl): Force instantiation of an
2365         auto static data member.
2366
2367         PR c++/55220
2368         * pt.c (unify): A pack expansion that is not the last template
2369         argument makes the entire template argument list non-deduced.
2370
2371         PR c++/56323
2372         * name-lookup.c (do_class_using_decl): Handle typedefs with
2373         inheriting constructors.
2374         (push_class_level_binding_1): Allow inheriting from template
2375         template parameter, too.
2376         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
2377
2378         PR c++/55223
2379         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
2380         default argument scope.
2381         * mangle.c (write_name): Likewise.
2382
2383         PR c++/55232
2384         * error.c (find_typenames_r): Don't walk into a pack expansion.
2385
2386 2013-02-13  Jason Merrill  <jason@redhat.com>
2387
2388         PR c++/55670
2389         * parser.c (cp_parser_member_declaration): Check the declarator
2390         form when detecting a function declaration via typedef.
2391
2392         PR c++/55680
2393         * pt.c (maybe_process_partial_specialization): A lambda
2394         isn't what's being specialized.
2395
2396         PR c++/55710
2397         * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
2398         TREE_USED.
2399
2400         PR c++/55879
2401         * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
2402
2403         PR c++/55993
2404         * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
2405         non-zero offsets, too.
2406
2407         PR c++/56155
2408         * decl.c (build_enumerator): Always convert the value to a
2409         fixed underlying type.
2410
2411         PR c++/56135
2412         * pt.c (tsubst_copy_and_build): Don't forget any new
2413         captures that arose from use of dependent names.
2414
2415 2013-02-13  Jakub Jelinek  <jakub@redhat.com>
2416
2417         PR c++/56302
2418         * semantics.c (finish_asm_stmt): If input constraints allow
2419         neither register nor memory, try maybe_constant_value to get
2420         a constant if possible.
2421
2422 2013-02-12  Jason Merrill  <jason@redhat.com>
2423
2424         PR c++/56285
2425         * method.c (add_one_base_init): Handle base constructor
2426         taking rvalue reference parm.
2427
2428         PR c++/56291
2429         * semantics.c (sort_constexpr_mem_initializers): Handle
2430         vptr out of order.
2431
2432 2013-02-09  Jason Merrill  <jason@redhat.com>
2433
2434         PR c++/56268
2435         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
2436         maybe_instantiate_noexcept.
2437
2438         PR c++/56247
2439         * pt.c (eq_specializations): Set comparing_specializations.
2440         * tree.c (cp_tree_equal): Check it.
2441         * cp-tree.h: Declare it.
2442
2443         * decl.c (decls_match): Check versions later.
2444
2445         PR c++/56238
2446         * pt.c (build_non_dependent_expr): Don't try to fold
2447         instantiation-dependent expressions.
2448         (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
2449         [BIND_EXPR]: Treat as dependent.
2450
2451 2013-02-07  Jakub Jelinek  <jakub@redhat.com>
2452
2453         PR c++/56241
2454         * init.c (build_vec_init): Don't append NULL values into new_vec.
2455         (build_zero_init_1): Don't push anything into v if recursive call
2456         returned NULL_TREE.
2457         (build_value_init_noctor): Don't push anything into v if
2458         build_value_init call returned NULL_TREE.
2459
2460         PR c++/56239
2461         * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
2462         (cp_parser_tokens_start_cast_expression): ... this.  Change parameter
2463         to cp_parser *, call cp_lexer_peek_token first.  For CPP_OPEN_PAREN,
2464         return true only if 2nd token isn't CPP_CLOSE_PAREN.
2465         (cp_parser_cast_expression): Adjust caller.
2466
2467         PR c++/56237
2468         * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
2469         only if DECL_DISCRIMINATOR_SET_P (t) rather than just
2470         DECL_LANG_SPECIFIC (t).
2471
2472 2013-02-07  Jason Merrill  <jason@redhat.com>
2473
2474         PR c++/56235
2475         * method.c (do_build_copy_constructor): Don't bother turning
2476         scalars from lvalues to xvalues.
2477         (do_build_copy_assign): Likewise.
2478
2479 2013-02-06  Jason Merrill  <jason@redhat.com>
2480
2481         * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
2482
2483 2013-02-05  Jason Merrill  <jason@redhat.com>
2484
2485         PR c++/54122
2486         * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
2487         METHOD_TYPE.
2488
2489         PR c++/56177
2490         * decl.c (start_preparsed_function): Update restype if we change
2491         decl1.
2492
2493         PR c++/56208
2494         * pt.c (fn_type_unification): Discard any access checks from
2495         substituting explicit args.
2496
2497 2013-01-31  Jason Merrill  <jason@redhat.com>
2498
2499         PR c++/56162
2500         PR c++/56104
2501         * typeck.c (get_member_function_from_ptrfunc): Fix
2502         ptrmemfunc_vbit_in_delta case.
2503
2504 2013-01-29  Jason Merrill  <jason@redhat.com>
2505
2506         PR libstdc++/54314
2507         * class.c (build_ctor_vtbl_group): Give construction vtables
2508         hidden visibility.
2509
2510 2013-01-25  Jason Merrill  <jason@redhat.com>
2511
2512         PR c++/56095
2513         * pt.c (convert_nontype_argument_function): Handle invalid input.
2514         (convert_nontype_argument): Likewise.
2515
2516         PR c++/56104
2517         * typeck.c (get_member_function_from_ptrfunc): Optimize if the
2518         dynamic type has no virtual functions.
2519
2520 2013-01-22  Paolo Carlini  <paolo.carlini@oracle.com>
2521
2522         PR c++/55944
2523         * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
2524         on TARGET_EXPR nodes.
2525
2526 2013-01-22  Jason Merrill  <jason@redhat.com>
2527
2528         PR c++/56071
2529         * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
2530
2531 2013-01-22  Dodji Seketeli  <dodji@redhat.com>
2532
2533         PR c++/53609
2534         * pt.c (argument_pack_element_is_expansion_p)
2535         (make_argument_pack_select, use_pack_expansion_extra_args_p)
2536         (gen_elem_of_pack_expansion_instantiation): New static functions.
2537         (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
2538         look through the possibly resulting pack expansion as well.
2539         (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
2540         generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
2541         Use gen_elem_of_pack_expansion_instantiation to build the
2542         instantiation piece-wise.  Don't use arg_from_parm_pack_p anymore,
2543         as gen_elem_of_pack_expansion_instantiation and the change in
2544         tsubst above generalize this particular case.
2545         (arg_from_parm_pack_p): Remove this for it's not used by
2546         tsubst_pack_expansion anymore.
2547
2548 2013-01-21  Jason Merrill  <jason@redhat.com>
2549
2550         PR c++/56059
2551         * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
2552         template args count.
2553
2554 2013-01-18  Jason Merrill  <jason@redhat.com>
2555
2556         PR target/54908
2557         * decl2.c (get_local_tls_init_fn): New.
2558         (get_tls_init_fn): Handle flag_extern_tls_init.  Don't bother
2559         with aliases for internal variables.  Don't use weakrefs if
2560         the variable needs destruction.
2561         (generate_tls_wrapper): Mark the wrapper as const if no
2562         initialization is needed.
2563         (handle_tls_init): Don't require aliases.
2564
2565 2013-01-15  Dodji Seketeli  <dodji@redhat.com>
2566
2567         PR c++/55663
2568         * pt.c (coerce_innermost_template_parms): New static function.
2569         (instantiate_alias_template):  Use it here.
2570
2571 2013-01-09  Jason Merrill  <jason@redhat.com>
2572
2573         PR c++/55878
2574         * rtti.c (build_typeid, get_typeid): Add complain parm.
2575         (get_tinfo_decl_dynamic): Likewise.
2576         * cp-tree.h, parser.c, pt.c: Adjust.
2577
2578         PR c++/55893
2579         * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
2580         needs destruction.
2581
2582 2013-01-09  Jakub Jelinek  <jakub@redhat.com>
2583
2584         PR c/48418
2585         * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
2586         call maybe_constant_value for the negative or too big shift
2587         count warnings.
2588
2589 2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
2590
2591         PR c++/55801
2592         * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
2593         of the argument is true.
2594
2595 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
2596
2597         * parser.c (cp_parser_initializer_list): Move declaration
2598         of variable non_const to start of lexical block.
2599
2600 2013-01-07  Jason Merrill  <jason@redhat.com>
2601
2602         PR c++/55753
2603         * tree.c (build_aggr_init_expr): Do nothing in a template.
2604         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
2605         a FUNCTION_DECL before tsubsting.
2606
2607 2013-01-04  Dodji Seketeli  <dodji@redhat.com>
2608
2609         PR c++/52343
2610         * pt.c (check_instantiated_arg): Allow type template arguments.
2611
2612 2013-01-04  Jason Merrill  <jason@redhat.com>
2613
2614         PR c++/55877
2615         * decl.c (reset_type_linkage, bt_reset_linkage): New.
2616         (grokdeclarator): Use reset_type_linkage.
2617         * name-lookup.c (binding_table_foreach): Handle null table.
2618         * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
2619
2620 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
2621
2622         PR c++/54526 (again)
2623         * parser.c (cp_parser_template_id): Revert core of previous change
2624         (keep adjusted inform message).
2625
2626 2013-01-03  Jason Merrill  <jason@redhat.com>
2627
2628         PR c++/55419
2629         PR c++/55753
2630         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
2631         TREE_CONSTANT.
2632
2633         PR c++/55842
2634         * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
2635
2636         PR c++/55856
2637         * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
2638
2639         PR c++/53650
2640         * call.c (type_has_extended_temps): New.
2641         * cp-tree.h: Declare it.
2642         * decl.c (check_initializer): Use build_aggr_init for arrays
2643         if it is false.
2644         * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
2645
2646 2013-01-02  Jason Merrill  <jason@redhat.com>
2647
2648         PR c++/54325
2649         * call.c (build_new_method_call_1): Don't use build_value_init for
2650         user-provided default constructors.
2651
2652         * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
2653
2654         PR c++/55032
2655         PR c++/55245
2656         * tree.c (build_cplus_array_type): Copy layout information
2657         to main variant if necessary.
2658 \f
2659 Copyright (C) 2013 Free Software Foundation, Inc.
2660
2661 Copying and distribution of this file, with or without modification,
2662 are permitted in any medium without royalty provided the copyright
2663 notice and this notice are preserved.