/cp
[official-gcc.git] / gcc / cp / ChangeLog
blob694aaae6de361f223c818884fcae1de2050acd88
1 2013-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
3         PR c++/29234
4         PR c++/56037
5         * parser.c (cp_parser_cast_expression): If we aren't looking at
6         a cast-expression don't call cp_parser_type_id.
7         (cp_parser_postfix_expression): Likewise for compound-literal.
8         (cp_parser_tokens_start_cast_expression): Adjust.
10 2013-11-01  Edward Smith-Rowland  <3dw4rd@verizon.net>
12         PR c++/58708
13         * parser.c (make_string_pack): Discover non-const type and size
14         of character and build parm pack with correct type and chars.
16 2013-11-01  Trevor Saunders  <tsaunders@mozilla.com>
18         * semantics.c (build_anon_member_initialization): Convert fields to be
19         a stack_vec.
21 2013-11-01  Marc Glisse  <marc.glisse@inria.fr>
23         PR c++/58834
24         * pt.c (type_dependent_expression_p): Handle null argument.
26 2013-11-01  Jakub Jelinek  <jakub@redhat.com>
28         * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
29         check_dup_generic at the end, unless remove is true.
30         (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
31         remove = true;.
33 2013-10-31  Jakub Jelinek  <jakub@redhat.com>
35         * semantics.c (finish_omp_clauses): Diagnose aligned clause
36         with decl that is not pointer nor array nor reference to those.
38 2013-10-31  Jason Merrill  <jason@redhat.com>
40         * semantics.c (cxx_eval_call_expression): Handle trivial
41         value-initialization.
42         * typeck2.c (store_init_value): Call maybe_constant_init after
43         cxx_constant_value.
45         * decl.c (cxx_maybe_build_cleanup): Always set LOOKUP_NONVIRTUAL.
46         * decl2.c (build_cleanup): Just call cxx_maybe_build_cleanup.
48         PR c++/58162
49         * parser.c (cp_parser_late_parse_one_default_arg): Set
50         TARGET_EXPR_DIRECT_INIT_P.
52         * class.c (type_build_ctor_call): Return early in C++98 mode.
53         (type_build_dtor_call): Likewise.
55 2013-10-31  Paolo Carlini  <paolo.carlini@oracle.com>
57         PR c++/58932
58         Revert:
59         2013-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
61         PR c++/58466
62         * pt.c (most_specialized_class): Bump processing_template_decl for
63         get_class_bindings.
65 2013-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
67         PR c++/58581
68         * call.c (build_over_call): Check return value of mark_used.
70 2013-10-30  Jason Merrill  <jason@redhat.com>
72         * semantics.c (finish_compound_literal): Don't create a static variable
73         inside cp_unevaluated_operand.
75         * init.c (push_base_cleanups): Check ANON_AGGR_TYPE_P.
77 2013-10-30  Tobias Burnus  <burnus@net-b.de>
79         PR other/33426
80         * cp-tree.h (RANGE_FOR_IVDEP): Define.
81         (cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
82         finish_for_cond): Take 'bool ivdep' parameter.
83         * cp-array-notation.c (create_an_loop): Update call.
84         * init.c (build_vec_init): Ditto.
85         * pt.c (tsubst_expr): Ditto.
86         * parser.c (cp_parser_iteration_statement, cp_parser_for,
87         cp_parser_range_for, cp_convert_range_for): Update calls.
88         (cp_parser_pragma): Accept GCC ivdep for 'while' and 'do'.
89         * semantics.c (finish_while_stmt_cond, finish_do_stmt,
90         finish_for_cond): Optionally build ivdep annotation.
92 2013-10-30  Jason Merrill  <jason@redhat.com>
94         * decl.c (cp_finish_decl): Never throw for VLA bound == 0.
96 2013-10-29  David Malcolm  <dmalcolm@redhat.com>
98         Patch autogenerated by refactor_symtab.py from
99         https://github.com/davidmalcolm/gcc-refactoring-scripts
100         revision 58bb219cc090b2f4516a9297d868c245495ee622
102         * call.c (mark_versions_used): Update for conversion of symtab types
103         to a true class hierarchy.
104         * decl2.c (cp_write_global_declarations): Likewise.
105         (clear_decl_external): Likewise.
106         (build_java_method_aliases): Likewise.
107         (collect_candidates_for_java_method_aliases): Likewise.
108         (mark_needed): Likewise.
109         (var_finalized_p): Likewise.
110         (maybe_make_one_only): Likewise.
111         (maybe_emit_vtables): Likewise.
112         * lambda.c (maybe_add_lambda_conv_op): Likewise.
113         * method.c (use_thunk): Likewise.
114         * optimize.c (maybe_clone_body): Likewise.
115         * tree.c (cp_fix_function_decl_p): Likewise.
117 2013-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
119         PR c++/58888
120         * decl2.c (grokfield): Handle auto like NSDMI.
122 2013-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
124         PR c++/58878
125         * pt.c (check_template_shadow): Don't skip declarations in inline
126         member templates.
128 2013-10-25  Tobias Burnus  <burnus@net-b.de>
130         PR other/33426
131         * parser.c (cp_parser_iteration_statement,
132         cp_parser_for, cp_parser_c_for, cp_parser_pragma): Handle
133         IVDEP pragma.
135 2013-10-24  Marek Polacek  <polacek@redhat.com>
137         PR c++/58705
138         * typeck2.c (check_narrowing): Don't check narrowing when the scalar
139         initializer is empty.
141 2013-10-23  Jason Merrill  <jason@redhat.com>
143         LWG 2165
144         * method.c (defaulted_late_check): Delete on eh-spec mismatch.
145         (maybe_explain_implicit_delete): Explain it.
147         * error.c (eh_spec_to_string): New.
148         (cp_printer): Use it for %X.
150         In C++11 a trivial [cd]tor might not be callable.
151         * class.c (user_provided_p): A function deleted on its declation
152         in the class is not user-provided.
153         (type_build_ctor_call): Also force a ctor call if we
154         might have a deleted or private trivial ctor.
155         (type_build_dtor_call): New.
156         (deduce_noexcept_on_destructors): Remove obsolete code.
157         * cp-tree.h: Declare type_build_dtor_call.
158         * decl.c (expand_static_init): Make sure trivial dtors are callable.
159         (cxx_maybe_build_cleanup): Likewise.
160         * except.c (build_throw): Likewise.
161         * init.c (build_value_init): Handle trivial but not callable ctors.
162         (perform_target_ctor): Make sure trivial dtor is callable.
163         (perform_member_init): Likewise.
164         (expand_cleanup_for_base): Likewise.
165         (build_vec_delete_1): Likewise.
166         (build_delete): Likewise.
167         (push_base_cleanups): Likewise.
168         (build_new_1): Avoid redundant error.
169         * method.c (synthesized_method_walk): Can't ever exit early in C++11.
170         Always process the subobject destructor.
171         * semantics.c (finish_compound_literal): Make sure trivial dtor is
172         callable.
173         * typeck2.c (split_nonconstant_init): Likewise.
175 2013-10-23  Edward Smith-Rowland  <3dw4rd@verizon.net>
177         Implement C++14 [[deprecated]] modulo [[gnu::deprecated]] bugs.
178         * parser.c (cp_parser_std_attribute): Interpret [[deprecated]]
179         as [[gnu::deprecated]].
181 2013-10-22  Paolo Carlini  <paolo.carlini@oracle.com>
183         PR c++/58816
184         * pt.c (apply_late_template_attributes): Use get_attribute_name,
185         not TREE_PURPOSE.
187 2013-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
189         PR c++/58466
190         * pt.c (most_specialized_class): Bump processing_template_decl for
191         get_class_bindings.
193 2013-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
195         * parser.c (cp_parser_lookup_name): Tidy.
197 2013-10-17  Andrew MacLeod  <amacleod@redhat.com>
199         * parser.c: Include omp-low.h.
200         * semantics.c: Likewise.
202 2013-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
204         PR c++/58596
205         * lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
206         cp_unevaluated_operand case.
208 2013-10-16  Jason Merrill  <jason@redhat.com>
210         * pt.c (apply_late_template_attributes): Use
211         attribute_takes_identifier_p.
213         * error.c (dump_exception_spec): Print "noexcept" rather than
214         "noexcept (true)".
216         Core 1591
217         * pt.c (unify_array_domain): Split out from unify.
218         (unify): Use it for list deduction, too.
220         PR c++/57850
221         * decl2.c (dump_tu): Split out from...
222         (cp_write_global_declarations): ...here.  Call it in PCH mode.
224 2013-10-16  Paolo Carlini  <paolo.carlini@oracle.com>
226         * pt.c (tsubst): Fix typo in last commit.
228 2013-10-16  Paulo Matos  <pmatos@broadcom.com>
230         * error.c (code_to_string): Use new wrapper get_tree_code_name.
231         * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
232         * pt.c (tsubst): Likewise.
233         * semantics.c (cxx_eval_constant_expression,
234         potential_constant_expression_1): Likewise.
235         * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
236         add_substitution, find_substitution): Likewise.
238 2013-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
240         PR c++/58707
241         * parser.c (cp_parser_postfix_open_square_expression): Set
242         parser->greater_than_is_operator_p for the argument.
244 2013-10-11  Paolo Carlini  <paolo.carlini@oracle.com>
246         PR c++/58633
247         * parser.c (cp_parser_commit_to_topmost_tentative_parse): New.
248         (cp_parser_pseudo_destructor_name): Use it.
250 2013-10-11  Paolo Carlini  <paolo.carlini@oracle.com>
252         PR c++/31671
253         * pt.c (convert_nontype_argument): Set expr_type to
254         TREE_TYPE (probe_type).
256 2013-10-11  Jakub Jelinek  <jakub@redhat.com>
258         * decl.c (duplicate_decls): Error out for redeclaration of UDRs.
259         (declare_simd_adjust_this): New function.
260         (grokfndecl): If "omp declare simd" attribute is present,
261         call declare_simd_adjust_this if needed and
262         c_omp_declare_simd_clauses_to_numbers.
263         * cp-array-notation.c (expand_array_notation_exprs): Handle
264         OMP_TASKGROUP.
265         * cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
266         OMP_DISTRIBUTE.  Handle is_invisiref_parm decls in
267         OMP_CLAUSE_REDUCTION.
268         (cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
269         OMP_FOR.
270         (cxx_omp_privatize_by_reference): Return true for
271         is_invisiref_parm decls.
272         (cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
273         caller.
274         * pt.c (apply_late_template_attributes): For "omp declare simd"
275         attribute call tsubst_omp_clauses,
276         c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
277         and c_omp_declare_simd_clauses_to_numbers.
278         (instantiate_class_template_1): Call cp_check_omp_declare_reduction
279         for UDRs.
280         (tsubst_decl): Handle UDRs.
281         (tsubst_omp_clauses): Add declare_simd argument, if true don't
282         call finish_omp_clauses.  Handle new OpenMP 4.0 clauses.
283         Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
284         OMP_CLAUSE_REDUCTION.
285         (tsubst_expr): For UDRs call pushdecl and
286         cp_check_omp_declare_reduction.  Adjust tsubst_omp_clauses
287         callers.  Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
288         OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
289         Adjust finish_omp_atomic caller.
290         (tsubst_omp_udr): New function.
291         (instantiate_decl): For UDRs at block scope, don't call
292         start_preparsed_function/finish_function.  Call tsubst_omp_udr.
293         * semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
294         use it instead of need_default_ctor || need_copy_ctor.
295         (struct cp_check_omp_declare_reduction_data): New type.
296         (handle_omp_array_sections_1, handle_omp_array_sections,
297         omp_reduction_id, omp_reduction_lookup,
298         cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
299         cp_check_omp_declare_reduction, clone_omp_udr,
300         find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
301         (finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
302         reductions.
303         (finish_omp_for): Add CODE argument, use it instead of hardcoded
304         OMP_FOR.  Adjust c_finish_omp_for caller.
305         (finish_omp_atomic): Add seq_cst argument, adjust
306         c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
307         atomic variants.
308         (finish_omp_cancel, finish_omp_cancellation_point): New functions.
309         * decl2.c (mark_used): Force immediate instantiation of
310         DECL_OMP_DECLARE_REDUCTION_P decls.
311         (is_late_template_attribute): Return true for "omp declare simd"
312         attribute.
313         (cp_omp_mappable_type): New function.
314         (cplus_decl_attributes): Add implicit "omp declare target" attribute
315         if requested.
316         * parser.c (cp_debug_parser): Print
317         parser->colon_doesnt_start_class_def_p.
318         (cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
319         functions.
320         (enum pragma_context): Add pragma_member and pragma_objc_icode.
321         (cp_parser_binary_expression): Handle no_toplevel_fold_p
322         even for binary operations other than comparison.
323         (cp_parser_linkage_specification): Call
324         cp_ensure_no_omp_declare_simd if needed.
325         (cp_parser_namespace_definition): Likewise.
326         (cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
327         (cp_parser_direct_declarator): Pass declarator to
328         cp_parser_late_return_type_opt.
329         (cp_parser_late_return_type_opt): Add declarator argument,
330         call cp_parser_late_parsing_omp_declare_simd for declare simd.
331         (cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
332         Parse UDRs before all other methods.
333         (cp_parser_member_specification_opt): Use pragma_member instead of
334         pragma_external.
335         (cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
336         (cp_parser_function_definition_from_specifiers_and_declarator,
337         cp_parser_save_member_function_body): Likewise.
338         (cp_parser_late_parsing_for_member): Handle UDRs specially.
339         (cp_parser_next_token_starts_class_definition_p): Don't allow
340         CPP_COLON if colon_doesnt_start_class_def_p flag is true.
341         (cp_parser_objc_interstitial_code): Use pragma_objc_icode
342         instead of pragma_external.
343         (cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
344         (cp_parser_omp_var_list_no_open): Parse array sections for
345         OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.  Add COLON argument,
346         if non-NULL, allow parsing to end with a colon rather than close
347         paren.
348         (cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
349         caller.
350         (cp_parser_omp_clause_reduction): Handle user defined reductions.
351         (cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
352         cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
353         cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
354         cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
355         cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
356         cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
357         cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
358         cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
359         functions.
360         (cp_parser_omp_all_clauses): Add finish_p argument.  Don't call
361         finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
362         (cp_parser_omp_atomic): Parse seq_cst clause, pass
363         true if it is present to finish_omp_atomic.  Handle new OpenMP 4.0
364         atomic forms.
365         (cp_parser_omp_for_loop): Add CODE argument, pass it through
366         to finish_omp_for.  Change last argument to cclauses,
367         and adjust uses to grab parallel clauses from the array of all
368         the split clauses.
369         (cp_omp_split_clauses): New function.
370         (cp_parser_omp_simd): New function.
371         (cp_parser_omp_for): Add p_name, mask and cclauses arguments.
372         Allow the function to be called also when parsing combined constructs,
373         and call c_parser_omp_simd when parsing for simd.
374         (cp_parser_omp_sections_scope): If section-sequence doesn't start with
375         #pragma omp section, require exactly one structured-block instead of
376         sequence of statements.
377         (cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
378         Allow the function to be called also when parsing combined constructs.
379         (cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
380         Allow the function to be called also when parsing combined
381         constructs.
382         (cp_parser_omp_taskgroup, cp_parser_omp_cancel,
383         cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
384         cp_parser_omp_teams, cp_parser_omp_target_data,
385         cp_parser_omp_target_update, cp_parser_omp_target,
386         cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
387         cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
388         cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
389         cp_parser_omp_declare): New functions.
390         (cp_parser_omp_construct): Add p_name and mask vars.  Handle
391         PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
392         PRAGMA_OMP_TEAMS.  Adjust cp_parser_omp_for, cp_parser_omp_parallel
393         and cp_parser_omp_sections callers.
394         (cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
395         PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
396         PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
397         PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
398         Handle pragma_member and pragma_objc_icode like pragma_external.
399         (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
400         OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
401         (OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
402         (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
403         OMP_CLAUSE_DEPEND.
404         (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
405         OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
406         OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
407         OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
408         OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
409         * parser.h (struct cp_omp_declare_simd_data): New type.
410         (struct cp_parser): Add colon_doesnt_start_class_def_p and
411         omp_declare_simd fields.
412         * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
413         * cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
414         bit.
415         (DECL_OMP_DECLARE_REDUCTION_P): Define.
416         (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
417         (struct saved_scope): Add omp_declare_target_attribute field.
418         (cp_omp_mappable_type, omp_reduction_id,
419         cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
420         finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
421         (finish_omp_for): Add CODE argument.
422         (finish_omp_atomic): Add seq_cst argument.
423         (cxx_omp_create_clause_info): Add need_dtor argument.
425 2013-10-09  Marek Polacek  <polacek@redhat.com>
427         PR c++/58635
428         * semantics.c (finish_return_stmt): Return error_mark_node
429         when error_operand_p of the expr is true.
430         (build_transaction_expr): Check for EXPR_P before setting the
431         expr location.
433 2013-10-08  Paolo Carlini  <paolo.carlini@oracle.com>
435         PR c++/58568
436         * lambda.c (begin_lambda_type): Check return value of xref_tag
437         for error_mark_node; tidy.
438         * decl.c (grokdeclarator): Tweak error message.
440 2013-10-08  Paolo Carlini  <paolo.carlini@oracle.com>
442         PR c++/58665
443         Revert:
444         2013-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
446         PR c++/58448
447         * pt.c (tsubst): Use error_operand_p on parameter t.
449 2013-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
451         PR c++/58126
452         * class.c (check_bases): Propagate CLASSTYPE_READONLY_FIELDS_NEED_INIT
453         and CLASSTYPE_REF_FIELDS_NEED_INIT from bases to derived.
454         * init.c (diagnose_uninitialized_cst_or_ref_member_1): Extend error
455         messages about uninitialized const and references members to mention
456         the base class.
458 2013-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
460         PR c++/56060
461         * pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
463 2013-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
465         PR c++/58560
466         * typeck2.c (build_functional_cast): Use error_operand_p on exp.
468 2013-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
470         PR c++/58503
471         * parser.c (cp_parser_perform_range_for_lookup): If eventually
472         either *begin or *end is type-dependent, return NULL_TREE.
473         (do_range_for_auto_deduction): If cp_parser_perform_range_for_lookup
474         returns NULL_TREE, don't actually do_auto_deduction.
476 2013-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
478         PR c++/58448
479         * pt.c (tsubst): Use error_operand_p on parameter t.
481 2013-10-04  Marc Glisse  <marc.glisse@inria.fr>
483         PR c++/19476
484         * decl.c (cxx_init_decl_processing): Set operator_new_flag.
486 2013-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
488         PR c++/58584
489         * decl2.c (save_template_attributes): Handle error_mark_node as
490         *attr_p argument.
491         (cp_check_const_attributes): Likewise for attributes.
492         * parser.c (cp_parser_std_attribute_spec): When alignas_expr is an
493         error_mark_node call cp_parser_skip_to_end_of_statement.
495 2013-10-03  Easwaran Raman  <eraman@google.com>
497         PR c++/33911
498         * parser.c (cp_parser_init_declarator): Do not drop attributes
499         of template member functions.
501 2013-10-03  Marek Polacek  <polacek@redhat.com>
503         PR c++/58510
504         * init.c (sort_mem_initializers): Splice when giving an error.
506 2013-10-02  Paolo Carlini  <paolo.carlini@oracle.com>
508         PR c++/58535
509         * parser.c (cp_parser_function_specifier_opt): Upon error about
510         virtual templates don't set ds_virtual.
511         (finish_fully_implicit_template): Reject virtual implicit templates.
513 2013-10-02  Paolo Carlini  <paolo.carlini@oracle.com>
515         PR c++/58565
516         * semantics.c (potential_constant_expression_1): Handle LABEL_EXPR.
518 2013-10-01  Paolo Carlini  <paolo.carlini@oracle.com>
520         PR c++/58563
521         * parser.c (cp_parser_lookup_name): Check make_typename_type return
522         value for error_mark_node.
524 2013-09-25  Tom Tromey  <tromey@redhat.com>
526         * Make-lang.in (CXX_TREE_H, CXX_PARSER_H, CXX_PRETTY_PRINT_H):
527         Remove.
529 2013-09-25  Tom Tromey  <tromey@redhat.com>
531         * Make-lang.in (g++spec.o): Remove.
532         (CFLAGS-cp/g++spec.o): New variable.
533         (GXX_OBJS): Reference cp/g++spec.o.
534         (cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
535         (cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
536         (cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
537         (cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
538         (cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
539         (cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
540         (cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
541         (cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.
543 2013-09-25  Tom Tromey  <tromey@redhat.com>
545         * Make-lang.in (g++spec.o): Don't use subshell.
547 2013-09-25  Marek Polacek  <polacek@redhat.com>
549         PR c++/58516
550         * semantics.c (finish_transaction_stmt): Check for EXPR_P before
551         setting the expr location.
553 2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
555         PR c++/58500
556         * type-utils.h (find_type_usage): Only traverse one type level into
557         member function pointers.
559 2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
561         * parser.c (cp_parser_init_declarator): Defer calling
562         finish_fully_implicit_template for forward declarations until after
563         other decl processing is complete.  Cleanup for clarity: Extract 'else'
564         case after 'if' containing unconditional return.
566 2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
568         * parser.c (make_generic_type_name): Spell generic type names '<autoN>'
569         rather than '__GenN'.
571 2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
573         * lambda.c (maybe_add_lambda_conv_op): Don't check for instantiated
574         callop in the case of generic lambdas.
576 2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
578         * parser.c (make_generic_type_name): Use global count rather than
579         parameter and ...
580         (add_implicit_template_parms): ... propagate interface change here.
582 2013-09-20  Paolo Carlini  <paolo.carlini@oracle.com>
584         PR c++/58481
585         * pt.c (tsubst_copy): Use current_nonlambda_class_type to
586         call tsubst_baselink.
588 2013-09-18  Paolo Carlini  <paolo.carlini@oracle.com>
590         PR c++/58457
591         * class.c (instantiate_type): Loosen a bit the gcc_assert.
593 2013-09-18  Marek Polacek  <polacek@redhat.com>
595         PR sanitize/58443
596         * typeck.c (cp_build_binary_op): Properly honor -fsanitize options.
597         Remove unnecessary check.
599 2013-09-18  Marek Polacek  <polacek@redhat.com>
601         PR sanitizer/58411
602         * typeck.c (cp_build_binary_op): Don't sanitize function if it has the
603         no_sanitize_undefined attribute.
605 2013-09-17  Paolo Carlini  <paolo.carlini@oracle.com>
607         PR c++/58435
608         * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account
609         the cp_type_quals (r) too.
611 2013-09-16  Adam Butcher  <adam@jessamine.co.uk>
613         * cp-tree.h (type_uses_auto_or_concept): Declare.
614         (is_auto_or_concept): Declare.
615         * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
616         -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
617         * type-utils.h: New header defining ...
618         (find_type_usage): ... this new function based on pt.c (type_uses_auto)
619         for searching a type tree given a predicate.
620         * pt.c (type_uses_auto): Reimplement via type-utils.h (find_type_usage).
621         (is_auto_or_concept): New function.
622         (type_uses_auto_or_concept): New function.
623         * parser.h (struct cp_parser): Add fully_implicit_function_template_p.
624         * parser.c (cp_parser_new): Initialize
625         fully_implicit_function_template_p.
626         (cp_parser_new): Initialize fully_implicit_function_template_p.
627         (cp_parser_lambda_expression): Copy and restore value of
628         fully_implicit_function_template_p as per other parser fields.
629         (cp_parser_parameter_declaration_list): Count generic
630         parameters and call ...
631         (add_implicit_template_parms): ... this new function to synthesize them
632         with help from type-utils.h (find_type_usage), ...
633         (tree_type_is_auto_or_concept): ... this new static function and ...
634         (make_generic_type_name): ... this new static function.
635         (cp_parser_direct_declarator): Account for implicit template parameters.
636         (cp_parser_lambda_declarator_opt): Finish fully implicit template if
637         necessary by calling ...
638         (finish_fully_implicit_template): ... this new function.
639         (cp_parser_init_declarator): Likewise.
640         (cp_parser_function_definition_after_declarator): Likewise.
641         (cp_parser_member_declaration): Likewise.
642         * Make-lang.in (cp/pt.o): Add dependency on type-utils.h.
643         (cp/parser.o): Likewise.
645 2013-09-16  Adam Butcher  <adam@jessamine.co.uk>
647         * parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
648         list with std=c++1y or std=gnu++1y.
649         (cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
650         operator template to avoid adding template result to symbol table.
651         * lambda.c (lambda_function): Return template result if call operator is
652         a template.
653         (maybe_add_lambda_conv_op): Move declarations to point of use.  Refactor
654         operator call building in order to support conversion of a non-capturing
655         lambda template to a function pointer with help from ...
656         (prepare_op_call): ... this new function.
657         * decl2.c (check_member_template): Don't reject lambda call operator
658         template in local [lambda] class.
659         * pt.c (instantiate_class_template_1): Don't instantiate lambda call
660         operator template when instantiating lambda class.
662 2013-09-16  Adam Butcher  <adam@jessamine.co.uk>
664         * pt.c (make_auto_1): Use input_location rather than BUILTINS_LOCATION.
666 2013-09-15  Jason Merrill  <jason@redhat.com>
668         Core DR 904
669         PR c++/41933
670         * parser.c (cp_parser_lambda_introducer): Handle variadic capture.
671         * lambda.c (add_capture): Handle variadic capture.
672         (add_default_capture, lambda_capture_field_type): Likewise.
673         (build_capture_proxy, register_capture_members): Likewise.
674         * pt.c (register_specialization): Allow FIELD_DECL.
675         (retrieve_specialization): Likewise.
676         (find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
677         (tsubst_pack_expansion): Handle FIELD_DECL packs.
678         (gen_elem_of_pack_expansion_instantiation): Likewise.
679         (instantiate_class_template_1): Likewise.
680         (tsubst_decl, tsubst_copy): Likewise.
681         (tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
682         (tsubst_copy_and_build) [VAR_DECL]: Likewise.
683         * semantics.c (finish_non_static_data_member): Don't try to represent
684         the type of a COMPOUND_REF of a FIELD_DECL pack.
686         PR c++/41933
687         * cp-tree.h (DECL_PACK_P): Replace FUNCTION_PARAMETER_PACK_P.
688         * cxx-pretty-print.c (direct_declarator): Adjust.
689         * decl2.c (cp_build_parm_decl): Adjust.
690         * pt.c (function_parameter_pack_p): Adjust.
691         (find_parameter_packs_r, push_template_decl_real): Adjust.
692         (tsubst_pack_expansion, tsubst_decl): Adjust.
693         (regenerate_decl_from_template, instantiate_decl): Adjust.
695         * lambda.c (add_capture): Don't add DECL_LANG_SPECIFIC.
697 2013-09-13  Jason Merrill  <jason@redhat.com>
699         PR c++/58273
700         * pt.c (any_type_dependent_elements_p): Actually check for
701         type-dependence, not value-dependence.
703 2013-09-13  Jacek Caban  <jacek@codeweavers.com>
705         * decl.c: Use new cxx_implicit_extern_c hook
707 2013-09-12  Brooks Moses  <bmoses@google.com>
709         PR driver/42955
710         * Make-lang.in: Do not install driver binaries in $(target)/bin.
712 2013-09-12  Adam Butcher  <adam@jessamine.co.uk>
714         * pt.c (instantiate_decl): Save/restore cp_unevaluated_operand and
715         c_inhibit_evaluation_warnings.  Reset if instantiating within a
716         function-local template.
718 2013-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
720         * semantics.c (finish_pseudo_destructor_expr): Add location_t
721         parameter.
722         * pt.c (unify_arg_conversion): Use EXPR_LOC_OR_HERE.
723         (tsubst_copy_and_build): Adjust finish_pseudo_destructor_expr
724         calls.
725         * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
726         (cp_parser_postfix_expression): Pass the proper location to
727         cp_parser_postfix_dot_deref_expression.
728         * cp-tree.h (finish_pseudo_destructor_expr): Update declaration.
730 2013-09-10  Jan Hubicka  <jh@suse.cz>
731             Paolo Carlini  <paolo.carlini@oracle.com>
733         * error.c (print_instantiation_partial_context_line): If
734         loc == UNKNOWN_LOCATION return immediately.
736 2013-09-09  Jakub Jelinek  <jakub@redhat.com>
738         PR c++/58325
739         * init.c (build_vec_delete): Call mark_rvalue_use on base.
741 2013-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
743         PR c++/43452
744         * init.c (build_vec_delete_1): When the type is incomplete emit a
745         warning, enabled by default (not an error).
746         (build_delete): Adjust to use OPT_Wdelete_incomplete.
748 2013-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
750         PR c++/58362
751         * error.c (location_of): Don't handle PARM_DECLs specially.
753 2013-09-09  Paolo Carlini  <paolo.carlini@oracle.com>
755         * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
756         * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
757         Tweak, TREE_OPERAND (t, 1) may be null.
759 2013-09-08  Caroline Tice  <cmtice@google.com>
761         PR c++/58300
762         * vtable-class-hierarchy.c (vtv_generate_init_routine):  In
763         preinit case, move call to assemble_vtv_preinit_initializer to
764         after call to cgraph_process_new_functions.
766 2013-09-08  Tom de Vries  <tom@codesourcery.com>
768         PR c++/58282
769         * except.c (build_must_not_throw_expr): Handle
770         flag_exceptions.
772 2013-09-08  Joern Rennecke  <joern.rennecke@embecosm.com>
774         * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p.
776 2013-09-04  Paolo Carlini  <paolo.carlini@oracle.com>
778         PR c++/24926
779         * class.c (finish_struct_anon_r): New.
780         (finish_struct_anon): Use it.
782 2013-09-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
784         * cxx-pretty-print.h (cxx_pretty_printer::simple_type_specifier):
785         Declare as overrider.
786         * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier):
787         Rename from pp_cxx_simple_type_specifier.
788         (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
789         simple_type_specifier.
791 2013-09-03  Paolo Carlini  <paolo.carlini@oracle.com>
793         PR c++/58305
794         * typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
796 2013-09-03  Mike Stump  <mikestump@comcast.net>
798         * Make-lang.in (cp/lambda.o): Add dependencies.
800 2013-09-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
802         * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as
803         overrider.
804         * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove.
805         (pp_cxx_userdef_literal): Tidy.
806         (pp_cxx_template_argument_list): Likewise.
807         (pp_cxx_typeid_expression): Likewise.
808         (pp_cxx_offsetof_expression_1): Likewise.
809         (cxx_pretty_printer::postfix_expression): Likewise.
810         (cxx_pretty_printer::unary_expression): Likewise.
811         (cxx_pretty_printer::statement): Likewise.
812         (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id.
813         (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id.
814         * error.c (dump_decl): Tidy.
815         (dump_expr): Likewise.
817 2013-09-02  Paolo Carlini  <paolo.carlini@oracle.com>
819         PR c++/21682, implement DR 565
820         * name-lookup.c (compparms_for_decl_and_using_decl): New.
821         (push_overloaded_decl_1, do_nonmember_using_decl): Use it.
823 2013-08-30  Marek Polacek  <polacek@redhat.com>
825         * typeck.c (cp_build_binary_op): Add division by zero and shift
826         instrumentation.
827         * error.c (dump_expr): Special-case ubsan builtins.
829 2013-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
831         PR c++/51424
832         * cp-tree.h (LOOKUP_DELEGATING_CONS): Add.
833         * init.c (perform_target_ctor): Use it.
834         * call.c (build_special_member_call): Diagnose self-delegating
835         constructors.
837 2013-08-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
839         * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as
840         overrider.
841         (cxx_pretty_printer::declaration_specifiers): Likewise.
842         (cxx_pretty_printer::function_specifier): Likewise.
843         (cxx_pretty_printer::declarator): Likewise.
844         (cxx_pretty_printer::direct_declarator): Likewise.
845         (cxx_pretty_printer::abstract_declarator): Likewise.
846         (cxx_pretty_printer::direct_abstract_declarator): Likewise.
847         (pp_cxx_declaration): Remove.
848         * cxx-pretty-print.c (cxx_pretty_printer::function_specifier):
849         Rename from pp_cxx_function_specifier.  Adjust.
850         (cxx_pretty_printer::declaration_specifiers): Rename from
851         pp_cxx_decl_specifier_seq.  Adjust.
852         (cxx_pretty_printer::direct_declarator): Rename from
853         pp_cxx_direct_declarator.  Adjust.
854         (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator.
855         Adjust.
856         (cxx_pretty_printer::abstract_declarator): Rename from
857         pp_cxx_abstract_declarator.  Adjust.
858         (cxx_pretty_printer::direct_abstract_declarator): Rename from
859         pp_cxx_direct_abstract_declarator.  Adjust.
860         (cxx_pretty_printer::declaration): Rename from
861         pp_cxx_declaration.  Adjust.
862         (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
863         declaration, declaration_specifiers, function_specifier,
864         declarator, direct_declarator, abstract_declarator,
865         direct_abstract_declarator.
866         * error.c (dump_decl): Adjust.
868 2013-08-29  Jan Hubicka  <jh@suse.cz>
870         Correct previous patch to not mark terminate as LEAF.
871         * class.c (build_vtbl_initializer): Drop LEAF
872         * decl.c (cxx_init_decl_processing): Likewise.
873         (push_throw_library_fn): Likewise.
874         * except.c (init_exception_processing): Likewise.
875         (do_begin_catch): Likewise.
876         (do_end_catch): Likewise.
877         (do_allocate_exception): Likewise.
879 2013-08-29  Jan Hubicka  <jh@suse.cz>
881         * class.c (build_vtbl_initializer): Make __cxa_deleted_virtual
882         ECF_NORETURN | ECF_LEAF
883         * cp-tree.h (build_library_fn_ptr, build_cp_library_fn_ptr,
884         push_library_fn, push_void_library_fn): Update prototype.
885         * decl.c (build_library_fn_1): Remove.
886         (push_cp_library_fn, build_cp_library_fn): Update to take ECF flags.
887         (cxx_init_decl_processing): Update; global_delete_fndecl is ECF_NOTROW;
888         __cxa_pure_virtual is ECF_NORETURN | ECF_NORETURN | ECF_LEAF.
889         (build_library_fn_1): Add ecf_flags argument; rename to ...
890         (build_library_fn): ... this one.
891         (build_cp_library_fn): Take ecf_flags; do not copy NOTHROW flag.
892         (build_library_fn_ptr): Take ecf_flags.
893         (build_cp_library_fn_ptr): Likewise.
894         (push_library_fn): Likewise.
895         (push_cp_library_fn): Likewise.
896         (push_void_library_fn): Likewise.
897         (push_throw_library_fn): All throws are ECF_NORETURN.
898         (__cxa_atexit, __cxa_thread_atexit): Add ECF_LEAF | ECF_NOTHROW attributes.
899         (expand_static_init): __cxa_guard_acquire, __cxa_guard_release,
900         __cxa_guard_abort are ECF_NOTHROW | ECF_LEAF.
901         * except.c (init_exception_processing): terminate is
902         ECF_NOTHROW | ECF_NORETURN | ECF_LEAF.
903         (declare_nothrow_library_fn): Add ecf_flags parameter.
904         (__cxa_get_exception_ptr): Is ECF_NOTHROW | ECF_PURE | ECF_LEAF |
905         ECF_TM_PURE.
906         (do_begin_catch): cxa_begin_catch and _ITM_cxa_begin_catch
907         are ECF_NOTHROW | ECF_LEAF.
908         (do_end_catch): __cxa_end_catch and _ITM_cxa_end_catch is
909         ECF_LEAF.
910         (do_allocate_exception): _cxa_allocate_exception
911         and _ITM_cxa_allocate_exception are ECF_NOTHROW | ECF_MALLOC
912         | ECF_LEAF
913         (do_free_exception): __cxa_free_exception is
914         ECF_NOTHROW | ECF_LEAF.
915         * rtti.c (build_dynamic_cast_1): __dynamic_cast
916         is ECF_LEAF | ECF_PURE | ECF_NOTHROW.
918 2013-08-29  Adam Butcher  <adam@jessamine.co.uk>
920         * error.c (dump_lambda_function): New function, dependent on ...
921         (dump_substitution): ... this new function, factored out of ...
922         (subst_to_string): ... here and ...
923         (dump_function_decl): ... here.  Updated to early-out with call to
924         dump_lambda_function after determining template bindings.
926 2013-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
928         PR c++/58255
929         * init.c (build_aggr_init): When init == void_type_node do not
930         set LOOKUP_ONLYCONVERTING.
932 2013-08-27  Caroline Tice  <cmtice@google.com>
934         * vtable-class-hierarchy.c: Remove unnecessary include statements.
935         (MAX_SET_SIZE): Remove unnecessary constant.
936         (register_construction_vtables):  Make vtable_ptr_array parameter
937         into a vector; remove num_args parameter. Change array accesses to
938         vector accesses.
939         (register_other_binfo_vtables): Ditto.
940         (insert_call_to_register_set): Ditto.
941         (insert_call_to_register_pair): Ditto.
942         (output_set_info):  Ditto.  Also change warning calls to warning_at
943         calls, and fix format of warning messages.
944         (register_all_pairs): Change vtbl_ptr_array from an array into a
945         vector.  Remove num_vtable_args (replace with calls to vector length).
946         Change array stores & accesses to vector functions. Change calls to
947         register_construction_vtables, register_other_binfo_vtables,
948         insert_call_to_register_set, insert_call_to_register_pair and
949         output_set_info to match their new signatures.  Change warning to
950         warning_at and fix the format of the warning message.
952 2013-08-27  Jakub Jelinek  <jakub@redhat.com>
953             Aldy Hernandez  <aldyh@redhat.com>
955         * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
957 2013-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
959         * decl.c (grokfndecl): Remove old bison hack.
961 2013-08-26  Jan Hubicka  <jh@suse.cz>
963         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
964         middle-end flag.
966 2013-08-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
968         * cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
969         Declare as overrider.
970         (cxx_pretty_printer::multiplicative_expression): Likewise.
971         (cxx_pretty_printer::conditional_expression): Likewise.
972         (cxx_pretty_printer::assignment_expression): Likewise.
973         (cxx_pretty_printer::expression): Likewise.
974         * cxx-pretty-print.c (cxx_pretty_printer::unary_expression):
975         Rename from pp_cxx_unary_expression.  Adjust.
976         (cxx_pretty_printer::multiplicative_expression): Rename from
977         pp_cxx_multiplicative_expression.  Adjust.
978         (cxx_pretty_printer::conditional_expression): Rename from
979         pp_cxx_conditional_expression.  Adjust.
980         (cxx_pretty_printer::assignment_expression): Rename from
981         pp_cxx_assignment_expression.  Adjust.
982         (cxx_pretty_printer::expression): Rename from pp_cxx_expression.
983         Adjust.
984         (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to
985         unary_expression, multiplicative_expression,
986         conditional_expression, assignment_expression, expression.
988 2013-08-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
990         * cxx-pretty-print.h (cxx_pretty_printer::postfix_expression):
991         Declare as overrider.
992         * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
993         Rename from pp_cxx_postfix_expression.  Adjust.
994         (pp_cxx_expression): Use pp_postfix_expression.
995         (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
996         postfix_expression.
998 2013-08-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1000         * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now
1001         an overrider of c_pretty_printer::primary_expression.
1002         * cxx-pretty-print.c (cxx_pretty_printer::primary_expression):
1003         Rename from pp_cxx_primary_expression.  Adjust.
1004         (pp_cxx_postfix_expression): Use pp_primary_expression.
1005         (pp_cxx_ctor_initializer): Likewise.
1006         (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1007         primary_expression.
1009 2013-08-23  Jan Hubicka  <jh@suse.cz>
1011         * cp-tree.h (struct lang_type_class): Free is_final bit.
1012         (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
1013         (DECL_FINAL_P): Remove.
1014         * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
1015         is called on CLASS_TYPE_P.
1017 2013-08-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1019         * cxx-pretty-print.c (M_): Remove.
1020         (pp_cxx_unqualified_id): Use translate_string instead of M_.
1021         (pp_cxx_canonical_template_parameter): Likewise.
1023 2013-08-24  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1025         * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
1026         * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
1027         from pp_cxx_id_expression.  Adjust.
1028         (pp_cxx_userdef_literal): Use pp_id_expression.
1029         (pp_cxx_primary_expression): Likewise.
1030         (pp_cxx_direct_declarator): Likewise.
1031         (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1032         id_expression.
1034 2013-08-24  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1036         * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
1037         function, overriding c_pretty_printer::constant.
1038         * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
1039         pp_cxx_constant.  Adjust.
1040         (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
1042 2013-08-23  Gabriel Dos Reis  <gdr@integrable-solutiobs.net>
1044         * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
1045         destructor for the early printer.
1046         * error.c (type_to_string): Use pp_buffer.
1048 2013-08-22  Paolo Carlini  <paolo.carlini@oracle.com>
1050         PR c++/56380
1051         * class.c (check_field_decls): Check for const mutable and const
1052         reference data members.
1054 2013-08-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1056         * error.c (init_error): Remove calls to pp_construct and
1057         pp_cxx_pretty_printer_init.  Initialize cxx_pp with placement-new.
1058         * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
1059         (cxx_pretty_printer_init): Remove.
1060         * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
1061         Rename from cxx_pretty_printer_init.  Adjust.
1062         * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
1063         initialization of C++ diagnostics pretty printer.
1065 2013-08-21  Paolo Carlini  <paolo.carlini@oracle.com>
1067         * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1068         * cp-tree.h (REFERENCE_REF_P): Likewise.
1069         * semantics.c (finish_offsetof): Likewise.
1071 2013-08-21  Paolo Carlini  <paolo.carlini@oracle.com>
1073         PR c++/56130
1074         * semantics.c (finish_id_expression): Handle deprecated references.
1076 2013-08-20  Jason Merrill  <jason@redhat.com>
1078         PR c++/58119
1079         * cvt.c (build_expr_type_conversion): Don't complain about a
1080         template that can't match the desired type category.
1082 2013-08-20  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1084         * error.c (pp_ggc_formatted_text): New.
1085         (type_as_string): Use it in lieu of pp_formatted_text.
1086         (type_as_string_translate): Likewise.
1087         (expr_as_string): Likewise.
1088         (decl_as_string): Likewise.
1089         (decl_as_string_translate): Likewise.
1090         (lang_decl_name): Likewise.
1091         (decl_to_string): Likewise.
1092         (expr_to_string): Likewise.
1093         (fndecl_to_string): Likewise.
1094         (parm_to_string): Likewise.
1095         (type_to_string): Likewise.
1096         (args_to_string): Likewise.
1097         (subst_to_string): Likewise.
1099 2013-08-19  Balaji V. Iyer  <balaji.v.iyer@intel.com>
1101         PR c/57490
1102         * cp-array-notation.c (cp_expand_cond_array_notations): Added a
1103         check for truth values.
1104         (expand_array_notation_exprs): Added truth values case.  Removed an
1105         unwanted else.  Added for-loop to walk through subtrees in default
1106         case.
1107         * call.c (build_cxx_call): Inherited the type of the array notation for
1108         certain built-in array notation functions.
1110 2013-08-19  Paolo Carlini  <paolo.carlini@oracle.com>
1112         * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
1113         Use cp_parser_lookup_name_simple.
1115 2013-08-19  Paolo Carlini  <paolo.carlini@oracle.com>
1117         * name-lookup.h (pop_bindings_and_leave_scope): Declare.
1118         * name-lookup.c (pop_bindings_and_leave_scope): Define.
1119         * parser.c (cp_parser_lambda_declarator_opt,
1120         cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
1122 2013-08-17  Jason Merrill  <jason@redhat.com>
1124         PR c++/58083
1125         * name-lookup.c (push_class_level_binding_1): It's OK to push a
1126         lambda type after the enclosing type is complete.
1128 2013-08-17  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1130         * error.c (dump_scope): Add a cxx_pretty_printer parameter.
1131         Adjust callers.
1132         (dump_template_argument): Likewise.
1133         (dump_template_argument_list): Likewise.
1134         (dump_template_parameter): Likewise.
1135         (dump_template_bindings): Likewise.
1136         (dump_alias_template_specialization): Likewise.
1137         (dump_type): Likewise.
1138         (dump_typename): Likewise.
1139         (dump_aggr_type): Likewise.
1140         (dump_type_prefix): Likewise.
1141         (dump_type_suffix): Likewise.
1142         (dump_global_iord): Likewise.
1143         (dump_simple_decl): Likewise.
1144         (dump_decl): Likewise.
1145         (dump_template_decl): Likewise.
1146         (dump_function_decl): Likewise.
1147         (dump_parameters): Likewise.
1148         (dump_ref_qualifier): Likewise.
1149         (dump_exception_spec): Likewise.
1150         (dump_function_name): Likewise.
1151         (dump_template_parms): Likewise.
1152         (dump_call_expr_args): Likewise.
1153         (dump_aggr_init_expr_args): Likewise.
1154         (dump_expr_list): Likewise.
1155         (dump_expr_init_vec): Likewise.
1156         (dump_expr): Likewise.
1157         (dump_binary_op): Likewise.
1158         (dump_unary_op): Likewise.
1160 2013-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1162         PR c++/51912
1163         * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
1164         * decl.c (case_conversion): Use it.
1165         * call.c (standard_conversion): Likewise.
1166         (implicit_conversion): Adjust.
1168 2013-08-13  Adam Butcher  <adam@jessamine.co.uk>
1170         * pt.c: Grammar fix in comments ("it's" to "its").
1172 2013-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
1174         * decl.c (warn_extern_redeclared_static, duplicate_decls,
1175         check_elaborated_type_specifier): Use error + inform.
1176         * friend.c (make_friend_class): Likewise.
1177         * semantics.c (finish_id_expression): Likewise.
1179 2013-08-09  Paolo Carlini  <paolo.carlini@oracle.com>
1181         Revert:
1182         2013-08-07  Paolo Carlini  <paolo.carlini@oracle.com>
1184         PR c++/46206
1185         * name-lookup.c (lookup_name_real_1): Handle iter->type before
1186         iter->value.
1188 2013-08-07  Paolo Carlini  <paolo.carlini@oracle.com>
1190         PR c++/46206
1191         * name-lookup.c (lookup_name_real_1): Handle iter->type before
1192         iter->value.
1194 2013-08-06  Caroline Tice  <cmtice@google.com>
1196         * Make-lang.in (*CXX_AND_OBJCXX_OBJS):  Add vtable-class-hierarchy.o to
1197         list.
1198         (vtable-class-hierarchy.o): Add build rule.
1199         * cp-tree.h (vtv_start_verification_constructor_init_function): New
1200         extern function decl.
1201         (vtv_finish_verification_constructor_init_function): New extern
1202         function decl.
1203         (build_vtbl_address): New extern function decl.
1204         (get_mangled_vtable_map_var_name): New extern function decl.
1205         (vtv_compute_class_hierarchy_transitive_closure): New extern function
1206         decl.
1207         (vtv_generate_init_routine): New extern function decl.
1208         (vtv_save_class_info): New extern function decl.
1209         (vtv_recover_class_info): New extern function decl.
1210         (vtv_build_vtable_verify_fndecl): New extern function decl.
1211         * class.c (finish_struct_1): Add call to vtv_save_class_info if
1212         flag_vtable_verify is true.
1213         * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
1214         * vtable-class-hierarchy.c: New file.
1215         * mangle.c (get_mangled_vtable_map_var_name):  New function.
1216         * decl2.c (start_objects): Update function comment.
1217         (cp_write_global_declarations):  Call vtv_recover_class_info,
1218         vtv_compute_class_hierarchy_transitive_closure and
1219         vtv_build_vtable_verify_fndecl, before calling
1220         finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
1221         flag_vtable_verify is true.
1222         (vtv_start_verification_constructor_init_function): New function.
1223         (vtv_finish_verification_constructor_init_function): New function.
1224         * init.c (build_vtbl_address): Remove static qualifier from function.
1226 2013-08-06  Jason Merrill  <jason@redhat.com>
1228         PR c++/57825
1229         * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
1231 2013-08-05  Paolo Carlini  <paolo.carlini@oracle.com>
1233         PR c++/58080
1234         * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
1235         (cp_build_binary_op): Adjust.
1237 2013-08-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1239         * cxx-pretty-print.h (pp_c_base): Remove.
1240         (cxx_pretty_printer): Derive from c_pretty_printer.
1241         Adjust macros using pp_c_base.
1242         * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
1243         * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
1244         (pp_cxx_colon_colon): Likewise.
1245         (pp_cxx_separate_with): Likewise.
1246         (pp_cxx_storage_class_specifier): Do not call pp_c_base.
1247         (pp_cxx_expression_list): Likewise.
1248         (pp_cxx_space_for_pointer_operator): Likewise.
1249         (pp_cxx_init_declarator): Likewise.
1250         (pp_cxx_call_argument_list): Likewise.
1251         (pp_cxx_constant): Likewise.
1252         (pp_cxx_postfix_expression): Likewise.
1253         (pp_cxx_new_expression): Likewise.
1254         (pp_cxx_unary_expression): Likewise.
1255         (pp_cxx_cast_expression): Likewise.
1256         (pp_cxx_conditional_expression): Likewise.
1257         (pp_cxx_assignment_expression): Likewise.
1258         (pp_cxx_expression): Likewise.
1259         (pp_cxx_function_specifier): Likewise.
1260         (pp_cxx_decl_specifier_seq): Likewise.
1261         (pp_cxx_simple_type_specifier): Likewise.
1262         (pp_cxx_type_specifier_seq): Likewise.
1263         (pp_cxx_ptr_operator): Likewise.
1264         (pp_cxx_parameter_declaration_clause): Likewise.
1265         (pp_cxx_direct_declarator): Likewise.
1266         (pp_cxx_direct_abstract_declarator): Likewise.
1267         (pp_cxx_type_id): Likewise.
1268         (pp_cxx_statement): Likewise.
1269         (pp_cxx_pretty_printer_init): Tidy.
1270         * error.c (init_error): Do not use pp_base.
1271         (dump_aggr_type): Likewise.
1272         (dump_type_prefix): Likewise.
1273         (dump_type_suffix): Likewise.
1274         (dump_global_iord): Likewise.
1275         (dump_decl): Likewise.
1276         (dump_function_decl): Likewise.
1277         (dump_ref_qualifier): Likewise.
1278         (reinit_cxx_pp): Likewise.
1279         (decl_as_dwarf_string): Likewise.
1280         (lang_decl_dwarf_name): Likewise.
1281         (type_to_string): Likewise.
1282         (cv_to_string): Likewise.
1283         (cxx_print_error_function): Likewise.
1284         (cp_diagnostic_starter): Likewise.
1285         (cp_diagnostic_finalizer): Likewise.
1286         (cp_print_error_function): Likewise.
1287         (print_instantiation_context): Likewise.
1288         (cp_printer): Likewise.
1290 2013-08-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1292         * error.c (dump_type_prefix): Use specialized pretty printer
1293         functions instead of pp_string or operators and punctuators.
1294         (dump_decl): Likewise.
1295         (dump_expr): Likewise.
1297 2013-08-03  Jason Merrill  <jason@redhat.com>
1299         DR 1286
1300         * pt.c (get_underlying_template): New.
1301         (convert_template_argument, lookup_template_class_1): Use it.
1303         DR 1430
1304         PR c++/51239
1305         * pt.c (pack_expansion_args_count): Rename from
1306         any_pack_expanson_args_p.
1307         (coerce_template_parms): Reject pack expansion to
1308         non-pack template parameter of alias template.
1310 2013-08-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1312         * error.c (dump_aggr_type): Use specialized pretty printer
1313         functions instead of pp_character.
1314         (dump_type_prefix): Likewise.
1315         (dump_simple_decl): Likewise.
1316         (type_to_string): Likewise.
1318 2013-08-02  Paolo Carlini  <paolo.carlini@oracle.com>
1320         * cp-tree.h (finish_stmt): Do not declare.
1321         * decl.c (finish_stmt): Do not define.
1322         * parser.c (cp_parser_expression_statement,
1323         cp_parser_declaration_statement,
1324         cp_parser_transaction_cancel): Don't call finish_stmt.
1325         * semantics.c (finish_expr_stmt, finish_if_stmt,
1326         finish_while_stmt, finish_do_stmt, finish_return_stmt,
1327         finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
1328         finish_transaction_stmt): Likewise.
1330 2013-08-01  Fabien Chêne  <fabien@gcc.gnu.org>
1332         PR c++/54537
1333         * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
1334         * name-lookup.c (do_nonmember_using_decl): Make sure we have an
1335         OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
1336         instead of issuing an error without mentioning the conflicting
1337         declaration.
1339 2013-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
1341         * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
1342         return value for error_mark_node.
1344 2013-07-30  Paolo Carlini  <paolo.carlini@oracle.com>
1346         PR c++/57673
1347         * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
1348         token->type == CPP_ELLIPSIS.
1350 2013-07-30  Paolo Carlini  <paolo.carlini@oracle.com>
1352         PR c++/57947
1353         * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
1355 2013-07-29  Jason Merrill  <jason@redhat.com>
1357         PR c++/57901
1358         * semantics.c (build_data_member_initialization, constexpr_fn_retval):
1359         Use break_out_target_exprs instead of unshare_expr.
1361 2013-07-29  Paolo Carlini  <paolo.carlini@oracle.com>
1363         PR c++/57948
1364         * call.c (initialize_reference): Don't crash when reference_binding
1365         returns a conv with conv->kind == ck_ambig.
1367 2013-07-29  Jason Merrill  <jason@redhat.com>
1369         * mangle.c (write_name): Check for null context.
1370         (write_unscoped_name): Allow PARM_DECL context.
1372 2013-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
1374         PR c++/57981
1375         * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
1376         (grokparms): Adjust.
1377         * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1378         * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
1379         a tsubst_flags_t parameter.
1380         (tsubst_decl): Adjust.
1381         * call.c (convert_default_arg): Likewise.
1382         * cp-tree.h (check_default_argument, tsubst_default_argument):
1383         Update declarations.
1385 2013-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
1387         PR c++/57880
1388         * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
1389         CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
1390         CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
1391         Fix string_len management, tidy.
1393 2013-07-24  Paolo Carlini  <paolo.carlini@oracle.com>
1395         PR c++/57942
1396         * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
1397         target type is incomplete; return a bool, not an int.
1398         * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
1400 2013-07-22  Paolo Carlini  <paolo.carlini@oracle.com>
1402         * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
1403         tf_warning_or_error.
1405 2013-07-21   Ondřej Bílka  <neleai@seznam.cz>
1407         * class.c: Fix typos.
1408         * cp-array-notation.c: Likewise.
1409         * cp-objcp-common.c: Likewise.
1410         * decl.c: Likewise.
1411         * init.c: Likewise.
1412         * mangle.c: Likewise.
1413         * parser.c: Likewise.
1414         * pt.c: Likewise.
1415         * semantics.c: Likewise.
1417 2013-07-14  Adam Butcher  <adam@jessamine.co.uk>
1419         * semantics.c (build_lambda_expr),
1420         (build_lambda_object), (begin_lambda_type), (lambda_return_type),
1421         (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
1422         (is_normal_capture_proxy), (insert_capture_proxy),
1423         (insert_pending_capture_proxies), (lambda_proxy_type),
1424         (build_capture_proxy), (vla_capture_type),
1425         (register_capture_members), (add_default_capture),
1426         (lambda_expr_this_capture), (maybe_resolve_dummy),
1427         (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
1428         (is_lambda_ignored_entity): Moved definitions into ...
1429         * lambda.c: ... this new file.
1431 2013-07-14  Marc Glisse  <marc.glisse@inria.fr>
1433         * call.c (build_conditional_expr_1): Handle the case with 1 vector
1434         and 2 scalars. Call save_expr before building a vector.
1435         * typeck.c (cp_build_binary_op): Check complain before complaining.
1437 2013-07-13  Lubos Lunak  <l.lunak@suse.cz>
1439         PR c++/55203
1440         * init.c (build_aggr_init): Check for warn_unused attribute.
1441         * decl.c (poplevel): Likewise.
1443 2013-07-13  Jason Merrill  <jason@redhat.com>
1445         PR c++/57402
1446         * init.c (build_vec_init): Use {} for arrays of class type.
1447         (build_vec_delete): Don't take the address of the array.
1449         PR c++/57793
1450         * class.c (layout_class_type): Check for too-large class.
1452         * call.c (can_convert): Allow user-defined conversions.
1453         (can_convert_standard): New.
1454         * cp-tree.h: Declare it.
1455         * cvt.c (convert_to_reference): Use it.
1456         * pt.c (convert_nontype_argument): Likewise.
1457         * search.c (check_final_overrider): Likewise.
1458         Don't worry about user-defined conversions.
1460 2013-07-10  Paolo Carlini  <paolo.carlini@oracle.com>
1462         PR c++/57869
1463         * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
1464         warn about casting between pointer-to-function and pointer-to-object.
1466 2013-07-09  Jason Merrill  <jason@redhat.com>
1468         PR c++/57402
1469         * init.c (build_vec_init): Don't take shortcuts when initializing
1470         a VLA.
1472         PR c++/57471
1473         * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
1475         PR c++/57658
1476         * semantics.c (finish_id_expression): Return the id for an
1477         unevaluated outer variable.
1479         PR c++/57526
1480         * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
1481         if the variable type uses 'auto'.
1483         PR c++/57437
1484         * typeck.c (check_return_expr): Lambda proxies aren't eligible
1485         for nrv or return by move.
1487         PR c++/57532
1488         * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
1489         a ref-qualifier in C++98 mode.
1491         PR c++/57545
1492         * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
1493         argument to have the exact type of the parameter.
1495         PR c++/57551
1496         * semantics.c (cxx_eval_indirect_ref): Don't try to look through
1497         a POINTER_PLUS_EXPR for type punning diagnostic.
1499         PR c++/57831
1500         * pt.c (tsubst_copy): Handle USING_DECL.
1502 2013-07-09  Marc Glisse  <marc.glisse@inria.fr>
1504         PR c++/53094
1505         * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
1507 2013-07-09  Marc Glisse  <marc.glisse@inria.fr>
1509         PR c++/53000
1510         * call.c (build_conditional_expr_1): Preserve xvalues.
1512 2013-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1514         PR c++/51786
1515         * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
1516         also check declares_class_or_enum.
1518 2013-07-08  Jason Merrill  <jason@redhat.com>
1520         PR c++/57550
1521         * pt.c (fn_type_unification): Only defer during substitution.
1522         (type_unification_real): Defer during defarg substitution,
1523         add checks parm to pass back deferred checks.
1524         (unify, do_auto_deduction): Adjust.
1525         * semantics.c (reopen_deferring_access_checks): New.
1526         * cp-tree.h: Declare it.
1528 2013-07-06  Paolo Carlini  <paolo.carlini@oracle.com>
1530         PR c++/28262
1531         * parser.c (cp_parser_init_declarator): If we are parsing a typedef
1532         set parser->default_arg_ok_p to false before cp_parser_declarator.
1534 2013-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
1536         PR c++/14263
1537         * class.c (build_base_path): Improve diagnostic.
1539 2013-07-04  Paolo Carlini  <paolo.carlini@oracle.com>
1541         PR c++/38634
1542         * decl.c (start_preparsed_function): Return a bool, false if
1543         push_template_decl fails.
1544         (start_function): Adjust.
1545         * cp-tree.h: Update.
1547 2013-07-03  Jakub Jelinek  <jakub@redhat.com>
1549         PR c++/57771
1550         * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
1551         Temporarily set parser->greater_than_is_operator_p for
1552         cp_parser_expression and restore from saved value afterwards.
1554 2013-06-28  Ed Smith-Rowland  <3dw4rd@verizon.net>
1556         * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
1557         * parser.c (cp_parser_operator()): Parse user-defined string
1558         literal as literal operator.
1560 2013-06-28  Paolo Carlini  <paolo.carlini@oracle.com>
1562         PR c++/57645
1563         * class.c (deduce_noexcept_on_destructors): Save, set, and restore
1564         TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
1565         destructors.
1567 2013-06-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
1569         * parser.c (cp_parser_array_notation): Removed rejection array notation
1570         of type function pointers. Added handling of array expressions when
1571         Cilk Plus is enabled.  Took out type-checking.
1572         (cp_parser_postfix_open_square_expression): Moved normal array expr.
1573         parsing into cp_parser_array_notation when cilkplus is enabled.
1574         (cp_parser_compound_statement): Removed expansion of array notations.
1575         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1576         (cp_parser_function_definition_after_declarator): Likewise.
1577         (cp_parser_selection_statement): Removed error reporting.
1578         (cp_parser_iteration_statement): Likewise.
1579         (cp_parser_direct_declarator): Removed error checking/reporting if
1580         array notations are used in the declarator.
1581         * pt.c (instantiate_decl): Likewise.
1582         (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
1583         (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
1584         (potential_constant_expression_1): Returned false for
1585         ARRAY_NOTATION_REF case.
1586         * cp-gimplify.c (cp_genericize): Added expansion of array notation
1587         expressions here.
1588         * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry 
1589         parameters.  Replaced build_decls with get_temp_regvar with type as
1590         ptrdiff.
1591         (create_array_refs): Made the type-casting to ptrdiff_type.
1592         (replace_invariant_var): Added a check for void return type before 
1593         creating new var.  Replaced build_decl and build_min_nt_loc with
1594         get_temp_regvar.
1595         (expand_an_in_modify_expr): Ditto.  Replaced body of redundant else 
1596         with gcc_unreachable.  Removed few unwanted checks.  Made induction 
1597         variable type as ptrdiff_type.  Removed loc and complain arguments 
1598         passed into make_triplet_val_inv.  Replaced all modify expression's 
1599         code from NOP EXPR to INIT EXPR.  Replaced all forceful appending 
1600         into stmt. list with the non-forceful one.  Replaced some integer 
1601         conversion and equality-checking to using tree_int_cst_equal.
1602         (expand_sec_reduce_builtin): All changes mentioned in above function
1603         expand_an_in_modify_expr.  Made the new variable type of
1604         SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
1605         (expand_array_notation_exprs): Removed SWITCH_EXPR case.  Moved all
1606         the error reporting from parser to this function.  Removed unwanted
1607         statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
1608         (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
1609         in function pointers.
1610         (cp_expand_cond_array_notations): Added a new if statements to check
1611         if condition has a zero rank.  If so, then just return.
1612         (expand_return_expr): Added a check for return expressions with a rank.
1613         Replaced get_tmp_regvar with a create_temporary_var.
1614         (build_array_notation_ref): Simplified and removed unwanted if-stmts.
1615         Moved common code outside if-statements.  Moved type-checking from
1616         parser to here.
1617         * semantics.c (finish_return_stmt): Removed a check for return exprs.
1618         with a rank.
1619         * call.c (convert_like_real): Removed a check for array notation
1620         expression in a function.
1621         (build_over_call): Likewise.
1622         (magic_varargs_p): Added a check for builtin array notation function.
1623         Made this function non-static and removed its prototype.
1624         * cp-tree.h (magic_varargs_p): New prototype.
1625         * typeck.c (cp_build_function_call_vec): Removed automatic setting of
1626         nargs to the param->length when builtin reduction function is used.
1627         (convert_arguments): Replaced check for a constant_p function with
1628         margic_varargs_p function call.
1629         (cp_build_binary_op): Removed calling of the function
1630         find_correct_array_notation_type.
1631         (cp_build_addr_expr_1): Removed an unwanted if-statement.
1632         (convert_for_assignment): Removed automatic return of rhs when array
1633         notation builtin function is used.
1635 2013-06-28  Paolo Carlini  <paolo.carlini@oracle.com>
1637         PR c++/57682
1638         * parser.c (cp_parser_save_member_function_body): Handle correctly
1639         curly braces in function-try-block mem-initializers.
1641 2013-06-27  Marc Glisse  <marc.glisse@inria.fr>
1643         PR c++/57509
1644         * typeck.c (cp_build_vec_perm_expr): New function.
1645         * cp-tree.h: Declare it.
1646         * parser.c (cp_parser_postfix_expression): Call it.
1647         * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
1648         (tsubst_copy_and_build): Likewise.
1650 2013-06-27  Marc Glisse  <marc.glisse@inria.fr>
1652         PR c++/57172
1653         * pt.c (more_specialized_fn): If both arguments are references,
1654         give priority to an lvalue.
1656 2013-06-26  Jason Merrill  <jason@redhat.com>
1658         * typeck2.c (store_init_value): Diagnose a non-constant
1659         initializer for in-class static.
1661         PR c++/57408
1662         * semantics.c (add_capture): Set type to error_mark_node after
1663         error.
1665 2013-06-25  Ed Smith-Rowland  <3dw4rd@verizon.net>
1667         PR c++/57640
1668         * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
1669         to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
1671 2013-06-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1673         * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
1674         * class.c (add_implicitly_declared_members): Likewise.
1675         (check_field_decl): Likewise.
1676         (finalize_literal_type_property): Likewise.
1677         (check_bases_and_members): Likewise.
1678         * decl.c (poplevel): Likewise.
1679         (case_conversion): Likewise.
1680         (check_initializer): Likewise.
1681         (grokfndecl): Likewise.
1682         (check_static_variable_definition): Likewise.
1683         (compute_array_index_type): Likewise.
1684         (grokdeclarator): Likewise.
1685         (build_enumerator): Likewise.
1686         * friend.c (make_friend_class): Likewise.
1687         * lex.c (init_reswords): Likewise.
1688         * method.c (synthesized_method_walk): Likewise.
1689         (implicitly_declare_fn): Likewise.
1690         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
1691         (cp_parser_constant_expression): Likewise.
1692         (cp_parser_for_init_statement): Likewise.
1693         (cp_parser_block_declaration): Likewise.
1694         (cp_parser_type_name): Likewise.
1695         (cp_parser_enum_specifier): Likewise.
1696         (cp_parser_enumerator_list): Likewise.
1697         (cp_parser_member_declaration): Likewise.
1698         (cp_nth_tokens_can_be_std_attribute_p): Likewise.
1699         (cp_parser_template_declaration_after_export): Likewise.
1700         * pt.c (convert_nontype_argument_function): Likewise.
1701         (convert_nontype_argument): Likewise.
1702         (convert_template_argument): Likewise.
1703         (tsubst_copy_and_build): Likewise.
1704         (build_non_dependent_expr): Likewise.
1705         * semantics.c (non_const_var_error): Likewise.
1706         (potential_constant_expression_1): Likewise.
1707         * tree.c (lvalue_kind): Likewise.
1708         (build_vec_init_expr): Likewise.
1709         (cast_valid_in_integral_constant_expression_p): Likewise.
1710         * typeck.c (build_x_conditional_expr): Likewise.
1711         * typeck2.c (check_narrowing): Likewise.
1713 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
1715         * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
1716         (expand_an_in_modify_expr): Changed a function call from the above
1717         removed function to length_mismatch_in_expr_p.
1719 2013-06-21  Balaji V. Iyer  <balaji.v.iyer@intel.com>
1721         * call.c (convert_like_real): Added a check if array notation is present
1722         in expression.  If so, then no conversion of arguments is necessary.
1723         (build_over_call): Likewise.
1724         * typeck.c (cp_build_function_call_vec): Likewise.
1725         (convert_for_assignment): Likewise.
1726         (cp_build_array_ref): Reject array notations with a rank greater than 1
1727         as an array's index.
1728         (cp_build_binary_op): If array notations are preent in op, then call
1729         find_correct_array_notation_type.
1730         (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
1731         * cp-array-notation.c: New file.
1732         * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
1733         as typed.
1734         * cp-tree.h (fix_array_notation_exprs): New prototype.
1735         * semantics.c (finish_return_stmt): Reject array notations as
1736         return value.
1737         (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
1738         (potential_constant_expression_1): Likewise.
1739         * tree.c (lvalue_kind): Likewise.
1740         * error.c (dump_decl): Likewise.
1741         (dump_expr): Likewise.
1742         * pt.c (ARRAY_NOTATION_REF): Likewise.
1743         (type_unification_real): Do not unify any arguments if array notations
1744         are found in arg.
1745         (instantiate_decl): Added a check for array notaitons inside the
1746         function body.  If so, then expand them.
1747         * parser.c (cp_parser_array_notation): New function.
1748         (cp_parser_postfix_open_square_expression): Added a check for colons
1749         inside square braces.  If found, then handle the array access as an
1750         array notation access.  Also, disable auto-correction from a single
1751         colon to scope when Cilk Plus is enabled.
1752         (cp_parser_compound_statement): Added a check for array notations
1753         inside the statement.  If found, then expand them.
1754         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1755         (cp_parser_function_definition_after_declarator): Likewise.
1756         (cp_parser_selection_statement): Searched for array notations inside
1757         condition.  If so, then emit an error.
1758         (cp_parser_iteration_statement): Likewise.
1759         (cp_parser_direct_declarator): Reject array notations inside a
1760         variable or array declaration.
1761         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
1763 2013-06-20  Jason Merrill  <jason@redhat.com>
1765         PR c++/55149
1766         * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
1767         context if we're in C++14 mode.
1768         * tree.c (array_of_runtime_bound_p): Return true for a dependent
1769         bound that is not potentually constant.
1770         * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
1771         * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
1772         * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
1773         (build_capture_proxy): Set REFERENCE_VLA_OK.
1774         (vla_capture_type): Make it a proper C++ class.
1775         (add_capture): Set DECL_VLA_CAPTURE_P.  Don't pre-digest the
1776         initializer.
1778         * decl.c (compute_array_index_type): Use size_one_node.
1780         * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
1781         a partial specialization.
1782         (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
1783         specialization.
1784         (most_specialized_class): Adjust.
1786         * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
1787         (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
1788         TEMPLATE_DECL_CHECK.
1790 2013-06-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1792         PR c++/57638
1793         * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
1794         TREE_TYPE (arg), not arg itself.
1796 2013-06-18  Paolo Carlini  <paolo.carlini@oracle.com>
1798         PR c++/53211
1799         * pt.c (type_dependent_expression_p): Handle an array of unknown
1800         bound depending on a variadic parameter.
1801         * parser.c (cp_parser_range_for): Revert PR56794 changes.
1803 2013-06-17  Richard Biener  <rguenther@suse.de>
1805         * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
1807 2013-06-17  Paolo Carlini  <paolo.carlini@oracle.com>
1809         PR c++/16128
1810         * parser.c (cp_parser_expression_statement): Check whether
1811         cp_parser_expression returns error_mark_node.
1813 2013-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
1815         PR c++/51413
1816         * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
1818 2013-06-14  Paolo Carlini  <paolo.carlini@oracle.com>
1820         PR c++/57599
1821         * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
1822         accessible base simply forward to build_static_cast.
1824 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
1826         PR c++/38958
1827         * decl.c (poplevel): For the benefit of -Wunused-variable see
1828         through references.
1830 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
1832         * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
1834 2013-06-12  Paolo Carlini  <paolo.carlini@oracle.com>
1836         PR c++/42021
1837         * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
1838         again diagnostic already emitted by cp_parser_lookup_name.
1840 2013-06-11  Jan Hubicka  <jh@suse.cz>
1842         PR c++/57551
1843         * cp/pt.c (mark_decl_instantiated): Do not export explicit
1844         instantiations of anonymous namespace templates.
1846 2013-06-10  Jason Merrill  <jason@redhat.com>
1848         * name-lookup.c (add_decl_to_level): Add decls in an anonymous
1849         namespace to static_decls.
1851 2013-06-07  Sriraman Tallam  <tmsriram@google.com>
1853         PR c++/57548
1854         * call.c (build_over_call):  Check if current_function_decl is
1855         NULL.
1857 2013-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
1859         PR c++/53658
1860         * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
1861         not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
1863 2013-06-06  Jason Merrill  <jason@redhat.com>
1865         PR c++/55520
1866         * semantics.c (add_capture): Diagnose capture of variable-size
1867         type that is not a C++1y array of runtime bound.
1869         * decl.c (grokdeclarator): Keep a decl with error type.
1870         (grokfield, grokbitfield): Likewise.
1871         * pt.c (instantiate_class_template_1): Likewise.
1872         (tsubst_decl): Drop redundant error.
1873         * class.c (walk_subobject_offsets): Handle erroneous fields.
1874         * typeck2.c (process_init_constructor_record): Likewise.
1876 2013-06-05  Paolo Carlini  <paolo.carlini@oracle.com>
1878         PR c++/51908
1879         * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
1880         parser->in_type_id_in_expr_p before calling cp_parser_type_id.
1882 2013-06-03  Jan Hubicka  <jh@suse.cz>
1884         * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
1885         mark_decl_referenced.
1886         (mark_needed): Likewise.
1888 2013-06-03  Jason Merrill  <jason@redhat.com>
1890         * class.c (mark_type_abi_tags): New.
1891         (check_abi_tags): Use it.
1893 2013-06-03  Paolo Carlini  <paolo.carlini@oracle.com>
1895         PR c++/57419
1896         * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
1897         * semantics.c (finish_qualified_id_expr): Use it.
1898         * cp-tree.h: Update.
1900 2013-06-01  Jan Hubicka  <jh@suse.cz>
1902         * decl2.c (cp_write_global_declarations): Replace same_body_alias
1903         by symbol.cpp_implicit_alias.
1905 2013-05-30  Jason Merrill  <jason@redhat.com>
1907         PR c++/57404
1908         * cp-lang.c (cp_classify_record): Handle structs without
1909         TYPE_LANG_SPECIFIC.
1911         PR c++/52377
1912         * class.c (common_enclosing_class): New.
1913         * cp-tree.h: Declare it.
1914         * init.c (sort_mem_initializers): Don't splice out a union member
1915         with an NSDMI.
1917 2013-05-29  Jan Hubicka  <jh@suse.cz>
1919         * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
1920         * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
1922 2013-05-25  Paolo Carlini  <paolo.carlini@oracle.com>
1924         PR c++/25666
1925         * decl2.c (check_classfn): Check for destructors declared as member
1926         templates.
1928 2013-05-24  Jason Merrill  <jason@redhat.com>
1930         PR c++/56971
1931         * pt.c (any_template_arguments_need_structural_equality_p): A
1932         TEMPLATE_TEMPLATE_PARM can require structural type comparison.
1934 2013-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
1936         PR c++/19618
1937         * class.c (check_bitfield_decl): Warn for bool and enum bitfields
1938         with width exceeding the type.
1940 2013-05-24  Jason Merrill  <jason@redhat.com>
1942         PR c++/57391
1943         * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
1944         (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
1946 2013-05-23  Jason Merrill  <jason@redhat.com>
1948         PR c++/57388
1949         * tree.c (build_ref_qualified_type): Clear
1950         FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
1952 2013-05-22  Jason Merrill  <jason@redhat.com>
1954         PR c++/56930
1955         * call.c (convert_like_real): Use cp_convert_and_check.
1956         * cvt.c (cp_convert_and_check): Use maybe_constant_value.
1957         * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
1958         (potential_constant_expression_1): Handle OMP_ATOMIC*.
1960         PR c++/56915
1961         * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
1962         isn't defined.
1964 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
1966         PR c++/57352
1967         * parser.c (cp_parser_conversion_type_id): Set up
1968         parser->type_definition_forbidden_message before calling
1969         cp_parser_type_specifier_seq.
1971 2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>
1973         PR c++/57211
1974         * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
1975         warnings about defaulted functions.
1977 2013-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1979         * call.c (build_conditional_expr_1): Add location_t parameter.
1980         (build_conditional_expr): Likewise.
1981         * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
1982         get_member_function_from_ptrfunc, build_x_conditional_expr,
1983         cp_build_modify_expr): Update.
1984         * init.c (build_new_1): Likewise.
1985         * cp-tree.h: Update declaration.
1987 2013-05-20  Jason Merrill  <jason@redhat.com>
1989         PR c++/57016
1990         * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
1991         if there is one.
1993         PR c++/57102
1994         * decl.c (fndecl_declared_return_type): Also look in
1995         DECL_SAVED_FUNCTION_DATA.
1997 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
1999         PR c++/12288
2000         * parser.c (cp_parser_parameter_declaration): Check return value
2001         of cp_parser_parse_and_diagnose_invalid_type_name.
2003 2013-05-20  Jason Merrill  <jason@redhat.com>
2005         PR c++/57319
2006         * class.c (vbase_has_user_provided_move_assign): New.
2007         * method.c (synthesized_method_walk): Check it.
2008         * cp-tree.h: Declare it.
2010         PR c++/57325
2011         * tree.c (build_cplus_array_type): Copy layout info if element
2012         type is complete.
2014 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
2016         PR c++/23608
2017         * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
2019 2013-05-20  Jason Merrill  <jason@redhat.com>
2021         PR c++/57317
2022         * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
2023         whether a template has its own args.
2025 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
2027         PR c++/57327
2028         * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
2030 2013-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
2032         PR c++/10207
2033         * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
2034         instead of cp_parser_initializer_list for compound-literals.
2036 2013-05-20  Marc Glisse  <marc.glisse@inria.fr>
2038         PR c++/57175
2039         * typeck.c (check_return_expr): Reverse the alignment comparison.
2041 2013-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
2043         PR c++/18126
2044         * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
2045         correctly sizeof compound-literal; update comments.
2047 2013-05-16  Marc Glisse  <marc.glisse@inria.fr>
2049         * call.c (build_conditional_expr_1): Use cp_build_binary_op
2050         instead of directly calling fold_build2.
2052 2013-05-16  Jason Merrill  <jason@redhat.com>
2054         * Make-lang.in (cc1plus$(exeext)): Use link mutex.
2056         PR c++/57279
2057         * decl.c (grokdeclarator): Allow member function qualifiers in
2058         TYPENAME context in C++11 mode.
2060 2013-05-16  Dodji Seketeli  <dodji@redhat.com>
2062         PR c++/56782 - Regression with empty pack expansions
2063         * pt.c (use_pack_expansion_extra_args_p): When at least a
2064         parameter pack has an empty argument pack, and another parameter
2065         pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
2066         mechanism.
2068 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
2070         * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
2071         warning_at and permerror with warning_at/inform and permerror/
2072         inform, respectively.
2074 2013-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
2076         PR c++/31952
2077         * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
2078         redeclarations.
2080 2013-05-14  Jason Merrill  <jason@redhat.com>
2082         PR c++/57243
2083         * parser.c (cp_parser_range_for): Call complete_type.
2085         PR c++/57041
2086         * pt.c (tsubst_copy_and_build): Don't recur into a designator.
2088 2013-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
2090         PR c++/53903
2091         * method.c (defaulted_late_check): Check for compatible exception
2092         specification out of class explicitly defaulted functions too.
2094 2013-05-14  Jason Merrill  <jason@redhat.com>
2096         PR c++/56998
2097         * semantics.c (potential_constant_expression_1): Make sure the
2098         called function is potentially constant.
2099         * call.c (null_ptr_cst_p): Revert earlier change.
2101 2013-05-13  Jason Merrill  <jason@redhat.com>
2103         PR c++/56998
2104         * call.c (null_ptr_cst_p): An expression with side-effects can't
2105         be a C++03 null pointer constant.
2107         PR c++/57041
2108         * decl.c (reshape_init_class): Handle error_mark_node.
2110         PR c++/57254
2111         * typeck.c (merge_types): Propagate ref-qualifier
2112         in METHOD_TYPE case.
2114         PR c++/57253
2115         * decl.c (grokdeclarator): Apply ref-qualifier
2116         in the TYPENAME case.
2118         PR c++/57252
2119         * decl.c (decls_match): Compare ref-qualifiers.
2121 2013-05-10  Jason Merrill  <jason@redhat.com>
2123         PR c++/57196
2124         * pt.c (convert_template_argument): Use dependent_template_arg_p,
2125         not uses_template_parms.
2127         PR c++/57047
2128         * semantics.c (cxx_fold_indirect_ref): Fix thinko.
2130         PR c++/55149
2131         * semantics.c (add_capture): Error rather than abort on copy
2132         capture of VLA.
2133         * typeck.c (maybe_warn_about_returning_address_of_local): Don't
2134         warn about capture proxy.
2136 2013-05-09  Jason Merrill  <jason@redhat.com>
2138         * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
2140         PR c++/57222
2141         * pt.c (lookup_template_class_1): Handle getting a template
2142         template parameter as D1.
2144         N3639 C++1y VLA diagnostics
2145         * decl.c (grokdeclarator): Complain about reference, pointer, or
2146         typedef to VLA.
2147         (create_array_type_for_decl): Complain about array of VLA.
2148         * pt.c (tsubst): Likewise.
2149         * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
2150         * semantics.c (finish_decltype_type): Complain about decltype of VLA.
2151         * typeck.c (cp_build_addr_expr_1): Complain about VLA.
2152         (cxx_sizeof_or_alignof_type): Likewise.
2154         N3639 C++1y VLA support
2155         * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
2156         (check_array_initializer): Allow VLA init.
2157         (reshape_init_array_1): Adjust.
2158         (cp_finish_decl): Check for invalid VLA length.
2159         * typeck2.c (process_init_constructor_array): Adjust.
2160         (store_init_value): Use build_vec_init for VLAs.
2161         * semantics.c (add_capture): Capture VLA as ptr+len.
2162         (vla_capture_type): New.
2163         (build_capture_proxy): Rebuild the VLA.
2164         * typeck.c (build_simple_component_ref): Split out from...
2165         (build_ptrmemfunc_access_expr): ...here.
2166         * tree.c (array_of_runtime_bound_p): New.
2167         * init.c (throw_bad_array_length): New.
2168         (build_vec_init): Use it.
2169         * parser.c (cp_convert_range_for): When iterating over a VLA,
2170         use it directly rather than bind a reference.
2171         * cp-tree.h: Declare new functions.
2173 2013-05-08  Jason Merrill  <jason@redhat.com>
2175         * except.c (is_admissible_throw_operand_or_catch_parameter): Check
2176         variably_modified_type_p.
2177         (expand_start_catch_block): Mark the typeinfo used here.
2178         * semantics.c (finish_handler_parms): Not here.
2180         * error.c (dump_type_suffix): Try harder on VLA length.
2182         Core 624/N2932
2183         * init.c (throw_bad_array_new_length): New.
2184         (build_new_1): Use it.  Don't warn about braced-init-list.
2185         (build_vec_init): Use it.
2186         * call.c (build_operator_new_call): Use it.
2188         PR c++/57068
2189         * decl.c (grokdeclarator): Warn about ref-qualifiers here.
2190         * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
2191         * error.c (maybe_warn_cpp0x): s/0x/11/.
2193 2013-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
2195         PR c++/51226
2196         * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
2197         == error_mark_node.
2199 2013-05-06  Marc Glisse  <marc.glisse@inria.fr>
2201         * typeck.c (cp_build_binary_op): Call save_expr before
2202         build_vector_from_val.
2204 2013-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
2206         PR c++/57183
2207         * decl.c (cp_finish_decl): After do_auto_deduction copy the
2208         qualifers with cp_apply_type_quals_to_decl.
2210 2013-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
2212         * pt.c (convert_nontype_argument): Add missing whitespace in
2213         error message.
2215 2013-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
2217         PR c++/53745
2218         * decl.c (build_enumerator): Improve error message.
2220 2013-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
2222         PR c++/14283
2223         * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
2224         messages for template types and fix column numbers.
2226 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
2228         PR c++/57132
2229         * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
2230         c_inhibit_evaluation_warnings around build_x_modify_expr call.
2232 2013-05-01  Paolo Carlini  <paolo.carlini@oracle.com>
2234         PR c++/57092
2235         * semantics.c (finish_decltype_type): Handle instantiated template
2236         non-type arguments.
2238 2013-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
2240         PR c++/56450
2241         * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
2243 2013-04-26  Jakub Jelinek  <jakub@redhat.com>
2245         * error.c (cp_print_error_function): Adjust file_name_as_prefix
2246         caller.
2248 2013-04-25  Jason Merrill  <jason@redhat.com>
2250         PR c++/56859
2251         * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
2253         PR c++/50261
2254         * init.c (perform_member_init): Call reshape_init.
2256 2013-04-24  Jason Merrill  <jason@redhat.com>
2258         PR c++/53721
2259         * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
2261 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
2263         * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
2264         pedwarn to simply use OPT_Wpointer_arith.
2265         (cp_build_unary_op): Likewise.
2267 2013-04-24  Jason Merrill  <jason@redhat.com>
2269         N3648: init-captures are named.
2270         * semantics.c (add_capture): Don't prepend "__" to init-captures.
2271         (build_capture_proxy): Adjust.
2272         * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
2274         N3648: Allow braced and parenthesized initializers.
2275         * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
2276         * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
2277         * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
2278         (add_capture): Collapse a parenthesized initializer into a single
2279         expression.
2280         * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
2282 2013-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
2284         PR c++/56970
2285         * init.c (build_offset_ref): Add tsubst_flags_t parameter.
2286         * semantics.c (finish_qualified_id_expr): Likewise.
2287         (finish_id_expression): Update.
2288         * typeck.c (cp_build_addr_expr_1): Likewise.
2289         * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
2290         * cp-tree.h: Update declarations.
2292 2013-04-22  Jason Merrill  <jason@redhat.com>
2294         Core 1586
2295         * parser.c (cp_parser_unqualified_id): Handle ~auto.
2296         (cp_parser_pseudo_destructor_name): Likewise.
2297         (cp_parser_postfix_dot_deref_expression): Adjust.
2298         (cp_lexer_nth_token_is_keyword): New.
2299         * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
2300         * typeck.c (lookup_destructor): Handle ~auto.
2302         * pt.c (fn_type_unification): Push tinst level around
2303         type_unification_real if we aren't explaining.
2304         * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
2305         * error.c (dump_function_decl): Respect it.
2306         (subst_to_string): Pass it.
2308         PR c++/48665
2309         * rtti.c (get_typeid): Diagnose qualified function type.
2310         * pt.c (tsubst) [POINTER_TYPE]: Likewise.
2312         * error.c (dump_aggr_type): Fix lambda detection.
2313         (dump_simple_decl): Pretty-print capture field.
2315         N3323
2316         * cvt.c (build_expr_type_conversion): Two conversions that return
2317         the same type aren't necessarily ambiguous.
2319         N3648
2320         * parser.c (cp_parser_lambda_introducer): Make lambda capture init
2321         pedwarn unconditional except in C++1y mode.
2323         * semantics.c (potential_constant_expression_1): Don't crash on
2324         'this' in NSDMI.
2326         Core 1612
2327         * semantics.c (finish_id_expression): Reject capture of anonymous
2328         union member.
2330         Core 1609
2331         * decl2.c (check_default_args): Check for pack expansion.
2333         * mangle.c (write_type): Mangle decltype(auto).
2335 2013-04-19  Jason Merrill  <jason@redhat.com>
2337         N3638 changes to return type deduction
2338         * decl.c (undeduced_auto_decl): New.
2339         (require_deduced_type): New.
2340         (fndecl_declared_return_type): New.
2341         (decls_match): Use it.
2342         (duplicate_decls): Don't check for auto return.
2343         (grokdeclarator): Reject virtual auto.
2344         * class.c (resolve_address_of_overloaded_function): Handle
2345         auto function templates.
2346         * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
2347         * cp-tree.h: Declare new fns.
2348         * error.c (dump_function_decl): Use fndecl_declared_return_type.
2349         * search.c (check_final_overrider): Likewise.
2350         * pt.c (make_decltype_auto): New.
2351         (do_auto_deduction): Require plain decltype(auto).
2352         (is_auto): Adjust.
2354         DR 941
2355         * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
2356         template specializations.
2358 2013-04-16  Ed Smith-Rowland  <3dw4rd@verizon.net>
2360         Implement n3599 - Literal operator templates for strings.
2361         * parser.c (make_string_pack (tree value)): New function.
2362         (cp_parser_userdef_string_literal (cp_token *)): Use it
2363         to construct calls to character string literal operator templates.
2364         (cp_parser_template_declaration_after_export): Check for new string
2365         literal operator template parameter form.
2367 2013-04-15  Jason Merrill  <jason@redhat.com>
2369         * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
2371         PR c++/52748
2372         * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
2373         rather than a destructor name, it isn't an unqualified-name.
2374         (tsubst_copy_and_build): Pass down decltype_flag to operator
2375         handling code, too.
2377         PR c++/56388
2378         * semantics.c (insert_capture_proxy): Just use index 1 in the
2379         stmt_list_stack.
2381 2013-04-12  Jakub Jelinek  <jakub@redhat.com>
2383         * error.c (cp_print_error_function,
2384         print_instantiation_partial_context_line,
2385         maybe_print_constexpr_context): Colorize locus strings.
2387 2013-04-11  Jason Merrill  <jason@redhat.com>
2389         PR c++/52748
2390         * parser.c (complain_flags): New.
2391         (cp_parser_postfix_expression): Use it.
2392         (cp_parser_unary_expression): Likewise.
2393         (cp_parser_binary_expression): Likewise.
2394         (cp_parser_assignment_expression): Likewise.
2395         (cp_parser_expression): Likewise.
2396         (cp_parser_postfix_open_square_expression): Take decltype_p.
2397         (cp_parser_builtin_offsetof): Adjust.
2398         (cp_convert_range_for): Pass complain to finish_unary_op_expr.
2399         * decl2.c (grok_array_decl): Add decltype_p parm.
2400         * cp-tree.h: Adjust prototype.
2401         * semantics.c (finish_unary_op_expr): Add complain parm.
2403 2013-04-11  Jakub Jelinek  <jakub@redhat.com>
2405         PR c++/56895
2406         * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
2407         calling maybe_constant_value for C++98.
2409 2013-04-11  Jason Merrill  <jason@redhat.com>
2411         PR c++/56901
2412         * semantics.c (lambda_capture_field_type, lambda_proxy_type):
2413         Strip references before checking WILDCARD_TYPE_P.
2415 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
2417         * call.c (build_conditional_expr_1, build_over_call): Protect
2418         error calls with complain & tf_error.
2419         * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
2420         build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
2421         build_ptrmemfunc): Likewise.
2422         (lookup_destructor): Take tsubst_flags_t parameter, adjust.
2424         * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
2425         (convert_to_reference): Adjust.
2427 2013-04-11  Jason Merrill  <jason@redhat.com>
2429         * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
2430         local variables, look them up instead.
2431         (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
2432         proxies and substitution in unevaluated context.
2433         (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
2434         before the iterators.
2436         PR c++/23055
2437         * pt.c (uses_deducible_template_parms): New.
2438         (deducible_array_bound, deducible_expression): New.
2439         (deducible_template_args): New.
2440         (unify_one_argument): Call uses_deducible_template_parms.
2442 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
2444         PR c++/56913
2445         * typeck2.c (build_m_component_ref): Protect error calls with
2446         (complain & tf_error).
2448 2013-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
2450         PR c++/54216
2451         * parser.c (cp_parser_enum_specifier): Check for empty
2452         anonymous enums and anonymous scoped enums.
2454 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
2456         PR c++/56895
2457         * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
2458         first before calling maybe_constant_value for warn_for_div_by_zero
2459         or invalid shift count warning purposes.
2461 2013-04-09  Jason Merrill  <jason@redhat.com>
2463         PR c++/25466
2464         * rtti.c (build_typeid): Check the address of the argument
2465         rather than looking for an INDIRECT_REF.
2467 2013-04-04  Jason Merrill  <jason@redhat.com>
2469         PR c++/56838
2470         PR c++/17232
2471         * typeck2.c (abstract_virtuals_error_sfinae): Disable
2472         complete_type again.
2474 2013-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
2476         PR c++/56871
2477         * decl.c (validate_constexpr_redeclaration): Allow an explicit
2478         specialization to be different wrt the constexpr specifier.
2480 2013-04-06  Jason Merrill  <jason@redhat.com>
2482         * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
2483         noreturn attribute.
2485 2013-04-05  Ed Smith-Rowland  <3dw4rd@verizon.net>
2487         * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
2488         cp_parser_ref_qualifier_opt.  Error if more than one ref-qual found.
2490 2013-04-03  Jason Merrill  <jason@redhat.com>
2492         * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
2493         (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
2494         (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
2496         * mangle.c (write_type): When writing a function type with
2497         function-cv-quals, don't add the unqualified type as a
2498         substitution candidate.
2500 2013-04-03  Paolo Carlini  <paolo.carlini@oracle.com>
2502         PR c++/56815
2503         * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
2504         pedwarn.
2506 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
2508         PR debug/56819
2509         * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
2510         from args to new_args.
2511         (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
2512         r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
2514 2013-04-02  Jason Merrill  <jason@redhat.com>
2516         PR c++/56821
2517         * mangle.c (write_function_type): Mangle ref-qualifier.
2518         (write_nested_name): Likewise.
2519         (canonicalize_for_substitution): Preserve ref-qualifier.
2520         (write_type): Likewise.
2522         PR c++/34949
2523         * decl.c (begin_destructor_body): Clobber the object in a cleanup.
2525 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
2527         * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
2528         * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
2529         (for_each_template_parm_r): Use TYPE_TI_ARGS.
2531 2013-04-02  Paolo Carlini  <paolo.carlini@oracle.com>
2533         * cp-tree.h (TAGGED_TYPE_P): Remove.
2534         (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
2535         (TYPE_ANONYMOUS_P): Adjust.
2536         * call.c (build_new_op_1): Likewise.
2537         * class.c (find_abi_tags_r): Likewise.
2538         * decl.c (warn_misplaced_attr_for_class_type, start_decl,
2539         type_is_deprecated): Likewise.
2540         * decl2.c (grokfield, min_vis_r): Likewise.
2541         * pt.c (get_template_info): Likewise.
2542         * tree.c (handle_abi_tag_attribute): Likewise.
2544 2013-04-01  Jason Merrill  <jason@redhat.com>
2546         * semantics.c (maybe_constant_value): Check
2547         instantiation_dependent_expression_p.
2548         * pt.c (build_non_dependent_expr): Don't check it here.
2550         PR c++/56772
2551         * init.c (build_new): Don't try to process an array initializer
2552         at template definition time.
2554         PR c++/56793
2555         * typeck.c (finish_class_member_access_expr): Handle enum scope.
2557         PR c++/56794
2558         * parser.c (cp_parser_range_for): Don't try to do auto deduction
2559         in a template if the type of the range is incomplete.
2561         * call.c (add_function_candidate): Take the address of 'this' here.
2562         (build_over_call): And here.
2563         (build_new_method_call_1, build_op_call_1): Not here.
2564         (build_user_type_conversion_1): Or here.
2565         (add_candidates): Adjust.
2567         * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
2568         * class.c (same_signature_p): Use type_memfn_quals.
2569         * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
2570         FUNCTION_OR_METHOD_TYPE_CHECK.
2571         * error.c (dump_type_suffix): Add padding before cv-qualifiers.
2572         * pt.c (unify): Use static_fn_type.
2574 2013-04-01  Bronek Kozicki <b.kozicki@gmail.com>
2575             Jason Merrill  <jason@redhat.com>
2577         Implement N2439 (ref-qualifiers for 'this')
2578         * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
2579         (FUNCTION_RVALUE_QUALIFIED): New.
2580         (FUNCTION_OR_METHOD_TYPE_CHECK): New.
2581         (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
2582         (cp_ref_qualifier): New enum.
2583         (cp_declarator): Add ref_qualifier.
2584         * parser.c (cp_parser_ref_qualifier_seq_opt): New.
2585         (cp_parser_direct_declarator): Use it.
2586         (make_call_declarator): Adjust.
2587         (cp_parser_lambda_declarator_opt): Adjust.
2588         * call.c (add_function_candidate): Handle ref-qualifier overload
2589         resolution semantics.
2590         (standard_conversion): Adjust.
2591         * class.c (add_method, same_signature_p): Compare ref-qualifiers.
2592         * decl.c (grokdeclarator): Handle ref-qualifiers.
2593         (grokfndecl): Check for invalid ref-qualifiers.
2594         (static_fn_type, revert_static_member_fn): Adjust.
2595         * decl2.c (build_memfn_type): Handle ref-qualifiers.
2596         (check_classfn): Check them.
2597         (cp_reconstruct_complex_type): Retain them.
2598         * error.c (dump_ref_qualifier): New.
2599         (dump_type_suffix, dump_function_decl): Use it.
2600         (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
2601         * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
2602         (unify): Retain them.
2603         * tree.c (cp_check_qualified_type): New.
2604         (cp_build_qualified_type_real): Keep exception spec and ref-qual.
2605         (build_ref_qualified_type): New.
2606         (strip_typedefs, build_exception_variant): Keep ref-qualifier.
2607         (cp_build_type_attribute_variant): Keep ref-qualifier.
2608         * typeck.c (merge_types): Keep ref-qualifier.
2609         (structural_comptypes): Compare ref-qualifier.
2610         (type_memfn_rqual): New.
2611         (apply_memfn_quals): Take ref-qual argument.
2612         * typeck2.c (build_m_component_ref): Check ref-qualifier.
2614 2013-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
2616         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
2617         (DECL_FUNCTION_TEMPLATE_P): Adjust.
2619         * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
2620         pp_cxx_qualified_id): Use get_containing_scope.
2621         * parser.c (cp_parser_class_head): Likewise.
2622         * pt.c (push_template_decl_real): Likewise.
2624         * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
2625         * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
2627 2013-03-31  Paolo Carlini  <paolo.carlini@oracle.com>
2629         * decl2.c (collect_candidates_for_java_method_aliases): Use
2630         DECL_CLASS_SCOPE_P.
2631         * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
2632         (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
2633         * decl.c (duplicate_decls): Likewise.
2634         * parser.c (cp_parser_template_declaration_after_export): Likewise,
2635         also DECL_DECLARES_TYPE_P.
2636         * pt.c (instantiate_class_template_1): Likewise.
2637         * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
2638         (lookup_field_r): Likewise.
2639         (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
2640         (lookup_fnfields_slot_nolazy): Likewise.
2641         * semantics.c (finish_member_declaration): Likewise.
2642         * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
2644 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2646         * pt.c (template_parms_to_args): Fix typo in comment.
2648 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
2650         * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
2652 2013-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
2654         * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
2655         (build_op_call_1): Likewise.
2656         (build_over_call): Likewise.
2657         (compare_ics): Likewise.
2658         * class.c (build_base_path): Likewise.
2659         (resolve_address_of_overloaded_function): Likewise.
2660         * cp-tree.h: Likewise.
2661         * cvt.c (cp_convert_to_pointer): Likewise.
2662         (convert_to_reference): Likewise.
2663         (ocp_convert): Likewise.
2664         (convert_force): Likewise, tidy.
2665         * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
2666         (pp_cxx_ptr_operator): Likewise.
2667         * decl.c (duplicate_decls): Likewise.
2668         (start_decl): Likewise.
2669         (grok_op_properties): Likewise.
2670         (start_preparsed_function): Likewise.
2671         (store_parm_decls): Likewise.
2672         (finish_function): Likewise.
2673         * decl2.c (delete_sanity): Likewise.
2674         (acceptable_java_type): Likewise.
2675         (grokbitfield): Likewise.
2676         (cp_reconstruct_complex_type): Likewise.
2677         * error.c (dump_type_prefix): Likewise.
2678         (dump_expr): Likewise.
2679         * except.c (push_eh_cleanup): Likewise.
2680         (complete_ptr_ref_or_void_ptr_p): Likewise.
2681         (can_convert_eh): Likewise.
2682         * init.c (build_new_1): Likewise.
2683         (build_delete): Likewise.
2684         (build_vec_delete): Likewise.
2685         * mangle.c (write_type): Likewise.
2686         * parser.c (lookup_literal_operator): Likewise.
2687         * pt.c (convert_nontype_argument_function): Likewise.
2688         (convert_nontype_argument): Likewise.
2689         (tsubst): Likewise.
2690         (unify): Likewise.
2691         (dependent_type_p_r): Likewise.
2692         * rtti.c (build_headof): Likewise.
2693         (build_typeid): Likewise.
2694         (build_dynamic_cast_1): Likewise.
2695         (target_incomplete_p): Likewise.
2696         (typeinfo_in_lib_p): Likewise.
2697         * semantics.c (finish_omp_for): Likewise.
2698         (cxx_eval_call_expression): Likewise.
2699         (maybe_resolve_dummy): Likewise.
2700         * tree.c (build_target_expr): Likewise.
2701         (cp_build_qualified_type_real): Likewise.
2702         * typeck.c (composite_pointer_type_r): Likewise.
2703         (composite_pointer_type): Likewise.
2704         (comp_except_types): Likewise.
2705         (cxx_sizeof_nowarn): Likewise.
2706         (string_conv_p): Likewise.
2707         (cp_build_array_ref): Likewise.
2708         (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
2709         (pointer_diff): Likewise.
2710         (cp_build_addr_expr_1): Likewise.
2711         (cp_build_unary_op): Likewise.
2712         (build_static_cast_1): Likewise.
2713         (cp_build_c_cast): Likewise.
2714         (comp_ptr_ttypes_real): Likewise.
2715         (ptr_reasonably_similar): Likewise.
2716         (comp_ptr_ttypes_const): Likewise.
2717         (casts_away_constness): Likewise.
2718         (check_literal_operator_args): Likewise.
2719         * typeck2.c (build_x_arrow): Likewise.
2720         (add_exception_specifier): Likewise.
2722 2013-03-29  Jason Merrill  <jason@redhat.com>
2724         N3582
2725         * cp-tree.h (AUTO_IS_DECLTYPE): New.
2726         * parser.c (cp_parser_decltype): Handle decltype(auto).
2727         (cp_parser_type_id_1): Allow auto without a late-specified
2728         return in C++1y.
2729         (cp_parser_primary_expression): Use the return value of
2730         finish_parenthesized_expr.
2731         (cp_parser_transaction_expression): Likewise.
2732         * semantics.c (force_paren_expr): New.
2733         (finish_parenthesized_expr): Use it.
2734         * call.c (build_conditional_expr_1): Likewise.
2735         * pt.c (do_auto_deduction): Handle decltype(auto).
2736         (tsubst_copy): Handle PAREN_EXPR.
2737         (tsubst_copy_and_build): Likewise.
2738         * error.c (dump_expr): Handle PAREN_EXPR.
2739         * cxx-pretty-print.c (pp_cxx_expression): Likewise.
2740         * mangle.c (write_expression): Ignore PAREN_EXPR.
2742         * parser.c (cp_parser_decltype_expr): Split out...
2743         (cp_parser_decltype): ...from here.
2745         PR c++/56774
2746         PR c++/35722
2747         * pt.c (unify_pack_expansion): Fix indexing.
2749 2013-03-29  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2751         * call.c (build_java_interface_fn_ref): Likewise.
2752         (make_temporary_var_for_ref_to_temp): Likewise.
2753         * class.c (check_field_decls): Likewise.
2754         (layout_class_type): Likewise.
2755         (finish_struct_1): Likewise.
2756         (fixed_type_or_null): Likewise.
2757         (get_vtbl_decl_for_binfo): Likewise.
2758         * cp-gimplify.c (omp_var_to_track): Likewise.
2759         (cp_genericize_r): Likewise.
2760         * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
2761         * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
2762         (DECL_DISCRIMINATOR_P): Likewise.
2763         * decl.c (poplevel): Likewise.
2764         (decls_match): Likewise.
2765         (duplicate_decls): Likewise.
2766         (decl_jump_unsafe): Likewise.
2767         (start_decl): Likewise.
2768         (check_for_uninitialized_const_var): Likewise.
2769         (make_rtl_for_nonlocal_decl): Likewise.
2770         (cp_finish_decl): Likewise.
2771         (expand_static_init): Likewise.
2772         (local_variable_p): Likewise.
2773         (maybe_register_incomplete_var): Likewise.
2774         * decl2.c (grokfield): Likewise.
2775         (comdat_linkage): Likewise.
2776         (determine_visibility): Likewise.
2777         (import_export_decl): Likewise.
2778         (prune_vars_needing_no_initialization): Likewise.
2779         (decl_maybe_constant_var_p): Likewise.
2780         * error.c (dump_simple_decl): Likewise.
2781         (dump_template_decl): Likewise.
2782         (cp_printer): Likewise.
2783         * except.c (build_throw): Likewise.
2784         * init.c (build_vtbl_address): Likewise.
2785         (member_init_ok_or_else): Likewise.
2786         (build_aggr_init): Likewise.
2787         (expand_aggr_init_1): Likewise.
2788         (build_offset_ref): Likewise.
2789         (constant_value_1): Likewise.
2790         * mangle.c (write_mangled_name): Likewise.
2791         (write_prefix): Likewise.
2792         * name-lookup.c (supplement_binding_1): Likewise.
2793         (add_decl_to_level): Likewise.
2794         (pushdecl_maybe_friend_1): Likewise.
2795         (check_for_out_of_scope_variable): Likewise.
2796         (validate_nonmember_using_decl): Likewise.
2797         (lookup_name_innermost_nonclass_level_1): Likewise.
2798         (lookup_arg_dependent_1): Likewise.
2799         * parser.c (cp_parser_lambda_introducer): Likewise.
2800         (cp_parser_template_argument): Likewise.
2801         (cp_parser_single_declaration): Likewise.
2802         * pt.c (convert_nontype_argument): Likewise.
2803         (instantiate_class_template_1): Likewise.
2804         (tsubst_decl): Likewise.
2805         (tsubst_expr): Likewise.
2806         (do_decl_instantiation): Likewise.
2807         (do_type_instantiation): Likewise.
2808         (regenerate_decl_from_template): Likewise.
2809         (always_instantiate_p): Likewise.
2810         (instantiate_decl): Likewise.
2811         (type_dependent_expression_p): Likewise.
2812         (build_non_dependent_expr): Likewise.
2813         * repo.c (repo_emit_p): Likewise.
2814         * rtti.c (build_dynamic_cast_1): Likewise.
2815         * search.c (shared_member_p): Likewise.
2816         * semantics.c (outer_var_p): Likewise.
2817         (finish_id_expression): Likewise.
2818         (finish_omp_clauses): Likewise.
2819         (finish_decltype_type): Likewise.
2820         (ensure_literal_type_for_constexpr_object): Likewise.
2821         * tree.c (lvalue_kind): Likewise.
2822         (bot_replace): Likewise.
2823         (cp_tree_equal): Likewise.
2824         (handle_init_priority_attribute): Likewise.
2825         (decl_storage_duration): Likewise.
2826         * typeck.c (cxx_sizeof_expr): Likewise.
2827         (cxx_alignof_expr): Likewise.
2828         (decay_conversion): Likewise.
2829         (build_class_member_access_expr): Likewise.
2830         (cp_build_array_ref): Likewise.
2831         (cxx_mark_addressable): Likewise.
2832         (maybe_warn_about_returning_address_of_local): Likewise.
2833         (check_return_expr): Likewise.
2834         * typeck2.c (cxx_readonly_error): Likewise.
2835         (abstract_virtuals_error_sfinae): Likewise.
2836         (cxx_incomplete_type_diagnostic): Likewise.
2838 2013-03-28  Lawrence Crowl  <crowl@google.com>
2840         * Make-lang.in
2841         (CXX_PARSER_H): Add header dependence.
2842         * cp-tree.h
2843         (extern debug (cp_binding_level &)): New.
2844         (extern debug (cp_binding_level *)): New.
2845         * name-lookup.h
2846         (debug (cp_binding_level &)): New.
2847         (debug (cp_binding_level *)): New.
2848         * parser.c
2849         (debug (cp_parser &)): New.
2850         (debug (cp_parser *)): New.
2851         (debug (cp_token &)): New.
2852         (debug (cp_token *)): New.
2853         (debug (vec<cp_token, va_gc> &)): New.
2854         (debug (vec<cp_token, va_gc> *)): New.
2855         * parser.c: Add header dependence.
2856         (extern debug (cp_parser &)): New.
2857         (extern debug (cp_parser *)): New.
2858         (extern debug (cp_token &)): New.
2859         (extern debug (cp_token *)): New.
2860         (extern debug (vec<cp_token, va_gc> &)): New.
2861         (extern debug (vec<cp_token, va_gc> *)): New.
2863 2013-03-28  Jason Merrill  <jason@redhat.com>
2865         PR c++/17232
2866         PR c++/52748
2867         * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
2868         the type if tf_decltype is set.
2869         * pt.c (fn_type_unification): Add decltype_p parm.
2870         (get_bindings): Adjust.
2871         * cp-tree.h: Adjust.
2872         * class.c (resolve_address_of_overloaded_function): Adjust.
2873         * call.c (add_template_candidate_real, print_z_candidate): Adjust.
2875         PR c++/56679
2876         * parser.c (cp_parser_sizeof_pack): Split out from...
2877         (cp_parser_sizeof_operand): ...here.  Require (id).
2879         PR c++/56701
2880         * semantics.c (finish_this_expr): 'this' is an rvalue.
2881         * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
2883         PR c++/56710
2884         * semantics.c (finish_member_declaration): Don't push closure
2885         members.
2887         * name-lookup.c (pushdecl_maybe_friend_1): Use
2888         nonlambda_method_basetype and current_nonlambda_class_type.
2890         PR c++/56728
2891         * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
2892         conversion from integer to pointer.
2893         (cxx_eval_constant_expression): Likewise.
2894         (cxx_eval_indirect_ref): Use the folded operand if we still think
2895         this might be constant.
2897 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
2898             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2900         PR c++/56725
2901         * call.c (convert_like_real): Change series of two permerrors
2902         to permerror + inform (and likewise for two errors).
2903         (build_new_method_call_1): Likewise.
2904         * typeck.c (convert_for_initialization): Change additional
2905         warning or error to inform.
2907 2013-03-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2909         * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
2910         (first_aggr_init_expr): Likewise.
2911         (more_aggr_init_expr_args_p): Likewise.
2912         (type_of_this_parm): Likewise.
2913         (class_of_this_parm): Likewise.
2914         * name-lookup.h (get_global_value_if_present): Likewise.
2915         (is_typename_at_global_scope): Likewise.
2917 2013-03-28  Paolo Carlini  <paolo.carlini@oracle.com>
2919         * call.c (joust): Don't call inform for a permerror returning false.
2920         * parser.c (cp_parser_check_class_key): Likewise.
2921         * pt.c (tsubst_copy_and_build): Likewise.
2923 2013-03-27  Jason Merrill  <jason@redhat.com>
2925         PR c++/56749
2926         * semantics.c (finish_qualified_id_expr): Return early
2927         for enum scope.
2929 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2931         * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
2932         * cvt.c (convert_to_void): Likewise.
2933         * error.c (dump_expr): Likewise.
2934         * mangle.c (write_expression): Likewise.
2935         * parser.c (cp_parser_template_argument): Likewise.
2936         * pt.c (convert_nontype_argument): Likewise.
2937         (tsubst_copy_and_build): Likewise.
2938         * rtti.c (build_typeid): Likewise.
2939         * semantics.c (finish_call_expr): Likewise.
2940         (finish_decltype_type): Likewise.
2941         (build_data_member_initialization): Likewise.
2942         * tree.c (is_dummy_object): Likewise.
2943         * typeck.c (decay_conversion): Likewise.
2944         (build_class_member_access_expr): Likewise.
2945         (cp_build_addr_expr_1): Likewise.
2946         (unary_complex_lvalue): Likewise.
2947         (check_return_expr): Likewise.
2948         * typeck2.c (cxx_readonly_error): Likewise.
2950 2013-03-26  Jason Merrill  <jason@redhat.com>
2952         PR c++/52597
2953         * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn.  Take tree.
2954         * semantics.c (finish_decltype_type): Check it before type_unknown_p.
2955         * cp-tree.h: Adjust prototype.
2957         PR c++/45282
2958         * typeck2.c (build_m_component_ref): Handle prvalue object.
2960 2013-03-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2962         * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
2963         * decl.c (duplicate_decls): Likewise.
2964         (cp_finish_decl): Likewise.
2965         (check_class_member_definition_namespace): Likewise.
2966         * decl2.c (grokfield): Likewise.
2967         (decl_needed_p): Likewise.
2968         (import_export_decl): Likewise.
2969         (mark_used): Likewise.
2970         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2971         * pt.c (push_access_scope): Likewise.
2972         (instantiate_decl): Likewise.
2973         * ptree.c (cxx_print_decl): Likewise.
2974         * repo.c (repo_emit_p): Likewise.
2975         * semantics.c (note_decl_for_pch): Likewise.
2976         * tree.c (decl_linkage): Likewise.
2978 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
2980         PR c++/55951
2981         * decl.c (check_array_designated_initializer): Handle CONST_DECL
2982         as ce->index.
2984 2013-03-26  Paolo Carlini  <paolo.carlini@oracle.com>
2986         * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
2987         error messages.
2989         * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
2991 2013-03-25  Jason Merrill  <jason@redhat.com>
2993         PR c++/56699
2994         * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
2995         class is derived from the type of the object.
2997         PR c++/52014
2998         * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
2999         unevaluated context.
3001 2013-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
3003         PR c++/56722
3004         * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
3005         DECL_TEMPLATE_INSTANTIATION.
3007 2013-03-22  Jason Merrill  <jason@redhat.com>
3009         PR c++/56684
3010         * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
3011         and CONST_DECL.
3013 2013-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3015         * cp-tree.h (identifier_p): New.
3016         * call.c: Throughout, call identifier_p insstead of direct
3017         comparaison of TREE_CODE against IDENTIFIER_NODE.
3018         * decl.c: Likewisse.
3019         * decl2.c: Likewise.
3020         * init.c: Likewise.
3021         * mangle.c: Likewise.
3022         * name-lookup.c: Likewise.
3023         * parser.c: Likewise.
3024         * pt.c: Likewise.
3025         * search.c: Likewise.
3026         * semantics.c: Likewise.
3027         * tree.c: Likewise.
3028         * typeck.c: Likewise.
3029         * typeck2.c: Likewise.
3031 2013-03-21  Jakub Jelinek  <jakub@redhat.com>
3033         PR middle-end/48087
3034         * pt.c (convert_nontype_argument): Count werrorcount as warnings.
3035         * call.c (build_temp): Likewise.
3036         * method.c (synthesize_method): Likewise.
3037         * typeck.c (convert_for_initialization): Likewise.
3039 2013-03-21  Marc Glisse  <marc.glisse@inria.fr>
3041         * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
3043 2013-03-21  Richard Biener  <rguenther@suse.de>
3045         * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
3046         DECL_DEBUG_EXPR_IS_FROM.  Guard properly.
3048 2013-03-20  Jason Merrill  <jason@redhat.com>
3050         PR c++/56646
3051         * parser.c (cp_parser_late_return_type_opt): Save and restore
3052         current_class_ptr/ref.
3054         PR c++/54532
3055         * expr.c (cplus_expand_constant): Do nothing if the class is
3056         incomplete.
3057         * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
3058         * typeck2.c (store_init_value): Use reduced_constant_expression_p.
3059         * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
3060         (complete_vars): Likewise.
3062         * name-lookup.c (get_anonymous_namespace_name): Never use
3063         get_file_function_name.
3065         * pt.c (retrieve_specialization): Handle null tmpl argument.
3067         PR c++/17232
3068         PR c++/56642
3069         * pt.c (tsubst_decl): Check return value of register_specialization.
3070         * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
3071         change.
3073 2013-03-17  Jason Merrill  <jason@redhat.com>
3075         PR c++/54359
3076         PR c++/56639
3077         * parser.c (cp_parser_direct_declarator): Bail if we see a
3078         qualified-id not at namespace scope.
3080         PR c++/17232
3081         PR c++/56642
3082         * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
3083         change for now.
3085 2013-03-16  Jason Merrill  <jason@redhat.com>
3087         * decl.c (grokdeclarator): Assert that we won't see a pointer to
3088         METHOD_TYPE.
3090         PR c++/54277
3091         * cp-tree.h (WILDCARD_TYPE_P): Split out from...
3092         (MAYBE_CLASS_TYPE_P): ...here.
3093         * semantics.c (lambda_capture_field_type): Only build a
3094         magic decltype for wildcard types.
3095         (lambda_proxy_type): Likewise.
3096         (finish_non_static_data_member): Get the quals from
3097         the object.
3099         PR c++/55931
3100         * parser.c (cp_parser_template_argument): Don't
3101         fold_non_dependent_expr.
3103         * parser.c (cp_parser_lambda_declarator_opt): Use
3104         cp_parser_trailing_type_id.
3106         PR c++/45917
3107         * parser.c (cp_parser_template_id): Don't forget access checks.
3109         PR c++/52374
3110         * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
3112         PR c++/54764
3113         PR c++/55972
3114         * name-lookup.h (tag_scope): Add ts_lambda.
3115         * semantics.c (begin_lambda_type): Use it.
3116         * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
3117         * pt.c (check_default_tmpl_args): Ignore lambdas.
3118         (push_template_decl_real): Handle lambdas.
3119         * tree.c (no_linkage_check): Adjust lambda check.
3121         PR c++/56039
3122         * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
3124         PR c++/54359
3125         * parser.c (cp_parser_direct_declarator): Fix late return
3126         for out-of-class defn of member function.
3128         PR c++/55357
3129         * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
3130         parms to avoid duplicate -Wshadow warnings.
3132         * search.c (lookup_base): Handle NULL_TREE.
3134         PR c++/56481
3135         * semantics.c (potential_constant_expression_1): Use of 'this' in
3136         a non-constexpr function makes the expression not potentially
3137         constant.
3139         N3276
3140         PR c++/52748
3141         * cp-tree.h (tsubst_flags): Add tf_decltype.
3142         * call.c (build_cxx_call): Don't build a temporary if it's set.
3143         (build_over_call): Make sure it's only passed to build_cxx_call.
3144         * parser.c (cp_parser_primary_expression): Add decltype_p parm.
3145         (cp_parser_unary_expression): Likewise.
3146         (cp_parser_cast_expression): Likewise.
3147         (cp_parser_binary_expression): Likewise.
3148         (cp_parser_assignment_expression): Likewise.
3149         (cp_parser_postfix_expression): Likewise.  Pass tf_decltype.
3150         (cp_parser_expression): Add decltype_p.  Force a
3151         temporary for a call on the LHS of a comma.
3152         (cp_parser_decltype): Pass true to decltype_p parms.
3153         * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
3154         (tsubst_copy_and_build): Pass tf_decltype down only for
3155         CALL_EXPR and the RHS of COMPOUND_EXPR.
3156         * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
3158         * cp-tree.h (abstract_class_use): New enum.
3159         * typeck2.c (pending_abstract_type): Add use field.
3160         (abstract_virtuals_error_sfinae): Add overloads taking
3161         abstract_class_use instead of tree.
3162         * typeck.c (build_static_cast_1): Call it.
3163         * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
3164         * pt.c: Adjust calls.
3165         * decl.c (cp_finish_decl): Don't handle functions specially.
3166         (grokdeclarator): Always check return type.
3167         * init.c (build_new_1): Adjust call.
3169         DR 337
3170         PR c++/17232
3171         * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
3172         * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
3174         DR 657
3175         * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
3176         (tsubst_arg_types): Likewise.
3178         DR 1518
3179         PR c++/54835
3180         * call.c (convert_like_real): Check for explicit constructors
3181         even for value-initialization.
3183         PR c++/54946
3184         * pt.c (convert_nontype_argument): Handle invalid pointer.
3186         * parser.c (cp_parser_lambda_expression): Use nreverse.
3188         PR c++/56447
3189         PR c++/55532
3190         * pt.c (instantiate_class_template_1): Instantiate lambda capture
3191         list here.
3192         (tsubst_copy_and_build): Not here.
3194         PR c++/55017
3195         * method.c (walk_field_subobs): Disallow copy of rvalue ref.
3197         PR c++/55240
3198         * parser.c (parsing_nsdmi): New.
3199         * semantics.c (outer_automatic_var_p): Check it.
3200         (finish_id_expression): Likewise.
3201         * cp-tree.h: Declare it.
3203         PR c++/55241
3204         * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
3206         * parser.c (lookup_literal_operator): Correct parm/arg naming
3207         mixup.
3209         PR c++/56238
3210         * pt.c (fold_non_dependent_expr_sfinae): Check
3211         instantiation_dependent_expression_p.
3213         PR c++/56095
3214         * class.c (resolve_address_of_overloaded_function): Accept a
3215         reference to function for target_type.
3216         (instantiate_type): Likewise.
3217         * pt.c (convert_nontype_argument): Pass it to
3218         convert_nontype_argument_function.
3220 2013-03-16  Jakub Jelinek  <jakub@redhat.com>
3222         * tree.c (cp_tree_equal): Fix a pasto.
3224         PR c++/56607
3225         * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
3226         pass op1 through maybe_constant_value first.
3228 2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>
3230         PR c++/56582
3231         * semantics.c (cxx_eval_array_reference): Check for negative index.
3233 2013-03-14  Jason Merrill  <jason@redhat.com>
3235         PR c++/56614
3236         * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
3238         PR c++/56346
3239         * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
3240         dso_handle parm on targets without __cxa_atexit.
3242 2013-03-11  Jason Merrill  <jason@redhat.com>
3244         PR c++/56567
3245         * typeck.c (check_return_expr): Disallow returning init list here.
3246         * semantics.c (apply_deduced_return_type): Not here.
3248 2013-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
3250         PR c++/51412
3251         * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
3252         * error.c (dump_expr): Likewise.
3254 2013-03-08  Jason Merrill  <jason@redhat.com>
3256         PR c++/51884
3257         * class.c (modify_all_vtables): Mangle the vtable name before
3258         entering dfs_walk.
3260         * semantics.c (lambda_expr_this_capture): In unevaluated context,
3261         just return the nearest 'this'.
3263         PR c++/51494
3264         PR c++/52183
3265         PR c++/56222
3266         * tree.c (maybe_dummy_object): Don't capture 'this'.
3267         * semantics.c (maybe_resolve_dummy): New.
3268         (finish_non_static_data_member): Use it.
3269         (finish_qualified_id_expr): Don't test is_dummy_object.
3270         * cp-tree.h: Declare maybe_resolve_dummy.
3271         * call.c (build_new_method_call_1): Use it.
3273         PR c++/56567
3274         * semantics.c (apply_deduced_return_type): Don't allow returning
3275         std::initializer_list.
3277 2013-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
3279         PR c++/56534
3280         * parser.c (cp_parser_elaborated_type_specifier): Don't call
3281         check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
3282         * decl.c (check_elaborated_type_specifier): Tidy.
3284 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
3286         PR c++/56543
3287         * tree.c (strip_typedefs): Don't copy args if they are NULL.
3289 2013-03-05  Jakub Jelinek  <jakub@redhat.com>
3291         * parser.c (cp_parser_braced_list): For {} initialize
3292         *non_constant_p to false.
3294 2013-03-04  Jason Merrill  <jason@redhat.com>
3296         PR c++/56464
3297         PR c++/54383
3298         * semantics.c (lambda_expr_this_capture): Handle NSDMI
3299         and non-class scopes.
3301 2013-03-01  Paolo Carlini  <paolo.carlini@oracle.com>
3303         * decl.c (grokdeclarator): Remove dead code.
3305 2013-02-28  Jason Merrill  <jason@redhat.com>
3307         PR c++/56481
3308         * semantics.c (potential_constant_expression_1): Use
3309         cxx_eval_outermost_constant_expr rather than maybe_constant_value.
3311         PR c++/56243
3312         * call.c (build_over_call): Avoid virtual lookup in a template.
3314 2013-02-27  Jason Merrill  <jason@redhat.com>
3316         PR c++/56358
3317         PR c++/56323
3318         * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
3319         of the base name for inheriting ctors.
3320         (push_class_level_binding_1): Remove inheriting ctor handling.
3321         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3322         * class.c (add_implicitly_declared_members): Adjust.
3324 2013-02-26  David Binderman  <dcb314@hotmail.com>
3326         PR c++/55632
3327         * decl.c (grokdeclarator): Tidy publicp assignment.
3329 2013-02-25  Aldy Hernandez  <aldyh@redhat.com>
3331         PR c++/56419
3332         * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
3333         (build_transaction_expr): Same.
3335 2013-02-25  Jason Merrill  <jason@redhat.com>
3337         PR c++/56377
3338         * pt.c (fn_type_unification): Wait to call push_tinst_level until
3339         we know what args we're looking at.
3341         PR c++/56438
3342         * semantics.c (potential_constant_expression_1): In C++98, a cast
3343         to non-integral type can't be a constant expression.
3345 2013-02-24  Jakub Jelinek  <jakub@redhat.com>
3347         PR c++/56403
3348         * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
3349         of CLASS_TYPE_P.
3351 2013-02-22  Jason Merrill  <jason@redhat.com>
3353         PR c++/40405
3354         * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
3355         if we got the wrong number of template parms.
3357         PR c++/56377
3358         * pt.c (fn_type_unification): Use explicit args in template
3359         instantiation context.
3361         PR c++/56359
3362         * call.c (can_convert_arg): Discard access checks.
3364         PR c++/56395
3365         * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
3366         args.
3368 2013-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
3370         PR c++/56373
3371         * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
3372         * cvt.c (ocp_convert): Use the latter.
3373         (cp_convert_to_pointer): Likewise.
3374         * decl.c (check_default_argument): Likewise.
3375         * typeck.c (cp_build_binary_op): Likewise.
3376         * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
3378 2013-02-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
3379             Paolo Carlini  <paolo.carlini@oracle.com>
3381         PR c++/51242
3382         * decl2.c (grokbitfield): Allow scoped enumeration types.
3384 2013-02-15  Jason Merrill  <jason@redhat.com>
3386         PR c++/54276
3387         * semantics.c (finish_id_expression): Also return the identifier
3388         for an outer local static.
3390         PR c++/56343
3391         * class.c (check_bases_and_members): Deduce noexcept after
3392         checking bases.
3394         PR c++/52026
3395         * semantics.c (finish_id_expression): In a template, return
3396         the identifier for a constant variable.
3398 2013-02-14  Jason Merrill  <jason@redhat.com>
3400         PR c++/54922
3401         * semantics.c (build_anon_member_initialization): New.
3402         (build_data_member_initialization): Use it.
3404         PR c++/55003
3405         * decl.c (cp_finish_decl): Force instantiation of an
3406         auto static data member.
3408         PR c++/55220
3409         * pt.c (unify): A pack expansion that is not the last template
3410         argument makes the entire template argument list non-deduced.
3412         PR c++/56323
3413         * name-lookup.c (do_class_using_decl): Handle typedefs with
3414         inheriting constructors.
3415         (push_class_level_binding_1): Allow inheriting from template
3416         template parameter, too.
3417         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3419         PR c++/55223
3420         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
3421         default argument scope.
3422         * mangle.c (write_name): Likewise.
3424         PR c++/55232
3425         * error.c (find_typenames_r): Don't walk into a pack expansion.
3427 2013-02-13  Jason Merrill  <jason@redhat.com>
3429         PR c++/55670
3430         * parser.c (cp_parser_member_declaration): Check the declarator
3431         form when detecting a function declaration via typedef.
3433         PR c++/55680
3434         * pt.c (maybe_process_partial_specialization): A lambda
3435         isn't what's being specialized.
3437         PR c++/55710
3438         * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
3439         TREE_USED.
3441         PR c++/55879
3442         * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
3444         PR c++/55993
3445         * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
3446         non-zero offsets, too.
3448         PR c++/56155
3449         * decl.c (build_enumerator): Always convert the value to a
3450         fixed underlying type.
3452         PR c++/56135
3453         * pt.c (tsubst_copy_and_build): Don't forget any new
3454         captures that arose from use of dependent names.
3456 2013-02-13  Jakub Jelinek  <jakub@redhat.com>
3458         PR c++/56302
3459         * semantics.c (finish_asm_stmt): If input constraints allow
3460         neither register nor memory, try maybe_constant_value to get
3461         a constant if possible.
3463 2013-02-12  Jason Merrill  <jason@redhat.com>
3465         PR c++/56285
3466         * method.c (add_one_base_init): Handle base constructor
3467         taking rvalue reference parm.
3469         PR c++/56291
3470         * semantics.c (sort_constexpr_mem_initializers): Handle
3471         vptr out of order.
3473 2013-02-09  Jason Merrill  <jason@redhat.com>
3475         PR c++/56268
3476         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
3477         maybe_instantiate_noexcept.
3479         PR c++/56247
3480         * pt.c (eq_specializations): Set comparing_specializations.
3481         * tree.c (cp_tree_equal): Check it.
3482         * cp-tree.h: Declare it.
3484         * decl.c (decls_match): Check versions later.
3486         PR c++/56238
3487         * pt.c (build_non_dependent_expr): Don't try to fold
3488         instantiation-dependent expressions.
3489         (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
3490         [BIND_EXPR]: Treat as dependent.
3492 2013-02-07  Jakub Jelinek  <jakub@redhat.com>
3494         PR c++/56241
3495         * init.c (build_vec_init): Don't append NULL values into new_vec.
3496         (build_zero_init_1): Don't push anything into v if recursive call
3497         returned NULL_TREE.
3498         (build_value_init_noctor): Don't push anything into v if
3499         build_value_init call returned NULL_TREE.
3501         PR c++/56239
3502         * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
3503         (cp_parser_tokens_start_cast_expression): ... this.  Change parameter
3504         to cp_parser *, call cp_lexer_peek_token first.  For CPP_OPEN_PAREN,
3505         return true only if 2nd token isn't CPP_CLOSE_PAREN.
3506         (cp_parser_cast_expression): Adjust caller.
3508         PR c++/56237
3509         * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
3510         only if DECL_DISCRIMINATOR_SET_P (t) rather than just
3511         DECL_LANG_SPECIFIC (t).
3513 2013-02-07  Jason Merrill  <jason@redhat.com>
3515         PR c++/56235
3516         * method.c (do_build_copy_constructor): Don't bother turning
3517         scalars from lvalues to xvalues.
3518         (do_build_copy_assign): Likewise.
3520 2013-02-06  Jason Merrill  <jason@redhat.com>
3522         * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
3524 2013-02-05  Jason Merrill  <jason@redhat.com>
3526         PR c++/54122
3527         * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
3528         METHOD_TYPE.
3530         PR c++/56177
3531         * decl.c (start_preparsed_function): Update restype if we change
3532         decl1.
3534         PR c++/56208
3535         * pt.c (fn_type_unification): Discard any access checks from
3536         substituting explicit args.
3538 2013-01-31  Jason Merrill  <jason@redhat.com>
3540         PR c++/56162
3541         PR c++/56104
3542         * typeck.c (get_member_function_from_ptrfunc): Fix
3543         ptrmemfunc_vbit_in_delta case.
3545 2013-01-29  Jason Merrill  <jason@redhat.com>
3547         PR libstdc++/54314
3548         * class.c (build_ctor_vtbl_group): Give construction vtables
3549         hidden visibility.
3551 2013-01-25  Jason Merrill  <jason@redhat.com>
3553         PR c++/56095
3554         * pt.c (convert_nontype_argument_function): Handle invalid input.
3555         (convert_nontype_argument): Likewise.
3557         PR c++/56104
3558         * typeck.c (get_member_function_from_ptrfunc): Optimize if the
3559         dynamic type has no virtual functions.
3561 2013-01-22  Paolo Carlini  <paolo.carlini@oracle.com>
3563         PR c++/55944
3564         * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
3565         on TARGET_EXPR nodes.
3567 2013-01-22  Jason Merrill  <jason@redhat.com>
3569         PR c++/56071
3570         * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
3572 2013-01-22  Dodji Seketeli  <dodji@redhat.com>
3574         PR c++/53609
3575         * pt.c (argument_pack_element_is_expansion_p)
3576         (make_argument_pack_select, use_pack_expansion_extra_args_p)
3577         (gen_elem_of_pack_expansion_instantiation): New static functions.
3578         (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
3579         look through the possibly resulting pack expansion as well.
3580         (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
3581         generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
3582         Use gen_elem_of_pack_expansion_instantiation to build the
3583         instantiation piece-wise.  Don't use arg_from_parm_pack_p anymore,
3584         as gen_elem_of_pack_expansion_instantiation and the change in
3585         tsubst above generalize this particular case.
3586         (arg_from_parm_pack_p): Remove this for it's not used by
3587         tsubst_pack_expansion anymore.
3589 2013-01-21  Jason Merrill  <jason@redhat.com>
3591         PR c++/56059
3592         * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
3593         template args count.
3595 2013-01-18  Jason Merrill  <jason@redhat.com>
3597         PR target/54908
3598         * decl2.c (get_local_tls_init_fn): New.
3599         (get_tls_init_fn): Handle flag_extern_tls_init.  Don't bother
3600         with aliases for internal variables.  Don't use weakrefs if
3601         the variable needs destruction.
3602         (generate_tls_wrapper): Mark the wrapper as const if no
3603         initialization is needed.
3604         (handle_tls_init): Don't require aliases.
3606 2013-01-15  Dodji Seketeli  <dodji@redhat.com>
3608         PR c++/55663
3609         * pt.c (coerce_innermost_template_parms): New static function.
3610         (instantiate_alias_template):  Use it here.
3612 2013-01-09  Jason Merrill  <jason@redhat.com>
3614         PR c++/55878
3615         * rtti.c (build_typeid, get_typeid): Add complain parm.
3616         (get_tinfo_decl_dynamic): Likewise.
3617         * cp-tree.h, parser.c, pt.c: Adjust.
3619         PR c++/55893
3620         * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
3621         needs destruction.
3623 2013-01-09  Jakub Jelinek  <jakub@redhat.com>
3625         PR c/48418
3626         * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
3627         call maybe_constant_value for the negative or too big shift
3628         count warnings.
3630 2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
3632         PR c++/55801
3633         * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
3634         of the argument is true.
3636 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
3638         * parser.c (cp_parser_initializer_list): Move declaration
3639         of variable non_const to start of lexical block.
3641 2013-01-07  Jason Merrill  <jason@redhat.com>
3643         PR c++/55753
3644         * tree.c (build_aggr_init_expr): Do nothing in a template.
3645         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
3646         a FUNCTION_DECL before tsubsting.
3648 2013-01-04  Dodji Seketeli  <dodji@redhat.com>
3650         PR c++/52343
3651         * pt.c (check_instantiated_arg): Allow type template arguments.
3653 2013-01-04  Jason Merrill  <jason@redhat.com>
3655         PR c++/55877
3656         * decl.c (reset_type_linkage, bt_reset_linkage): New.
3657         (grokdeclarator): Use reset_type_linkage.
3658         * name-lookup.c (binding_table_foreach): Handle null table.
3659         * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
3661 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
3663         PR c++/54526 (again)
3664         * parser.c (cp_parser_template_id): Revert core of previous change
3665         (keep adjusted inform message).
3667 2013-01-03  Jason Merrill  <jason@redhat.com>
3669         PR c++/55419
3670         PR c++/55753
3671         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
3672         TREE_CONSTANT.
3674         PR c++/55842
3675         * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
3677         PR c++/55856
3678         * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
3680         PR c++/53650
3681         * call.c (type_has_extended_temps): New.
3682         * cp-tree.h: Declare it.
3683         * decl.c (check_initializer): Use build_aggr_init for arrays
3684         if it is false.
3685         * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
3687 2013-01-02  Jason Merrill  <jason@redhat.com>
3689         PR c++/54325
3690         * call.c (build_new_method_call_1): Don't use build_value_init for
3691         user-provided default constructors.
3693         * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
3695         PR c++/55032
3696         PR c++/55245
3697         * tree.c (build_cplus_array_type): Copy layout information
3698         to main variant if necessary.
3700 Copyright (C) 2013 Free Software Foundation, Inc.
3702 Copying and distribution of this file, with or without modification,
3703 are permitted in any medium without royalty provided the copyright
3704 notice and this notice are preserved.