* cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
[official-gcc.git] / gcc / cp / ChangeLog
blob4a72b655318f4335ef99eb5e78c7f7815a6b9c99
1 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
4         * name-lookup.c (create_local_binding): New.
5         (update_binding): New.
6         (pushdecl_maybe_friend_1): Rename to ...
7         (do_pushdecl): ... this.  Reimplement.
8         (pushdecl): Adjust.
9         (push_overloaded_decl_1, push_overloaded_decl): Delete.
11 2017-05-23  Jason Merrill  <jason@redhat.com>
13         PR c++/80396 - built-in for make_integer_sequence.
14         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
15         (expand_integer_pack, expand_builtin_pack_call): New.
16         (find_parameter_packs_r): Check builtin_pack_call_p.
17         (check_for_bare_parameter_packs): Handle it.
18         (tsubst_pack_expansion): Call expand_builtin_pack_call.
19         (declare_integer_pack): New.
20         (init_template_processing): Call it.
21         * decl2.c (mark_used): Check builtin_pack_fn_p.
23 2017-05-23  Nathan Sidwell  <nathan@acm.org>
25         * name-lookup.c (find_namespace_binding): New.
26         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
27         (set_identifier_type_value_with_scope): Use find_namespace_binding.
28         (find_binding, cp_binding_level_find_binding_for_name,
29         binding_for_name, namespace_binding_1): Delete.
30         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
31         (get_namespace_binding, set_namespace_binding,
32         finish_namespace_using_decl, unqualified_namespace_lookup_1,
33         qualified_lookup_using_namespace, lookup_type_scope_1,
34         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
36         PR c++/80866
37         * parser.c (cp_parser_template_id): Keep the lookup when stashing
38         the template_id.
40         * cp-tree.h (DECL_HIDDEN_P): New.
41         * name-lookup.c (set_decl_context,
42         set_local_extern_decl_linkage): New, broken out of ...
43         (pushdecl_maybe_friend_1): ... here.  Call them.
45 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
47         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
48         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
49         "VECTOR_LENGTH".
51 2017-05-23  Nathan Sidwell  <nathan@acm.org>
53         * cp-tree.h (OVL_P): New.
54         * name-lookup.h (push_local_binding): Delete.
55         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
56         (finish_namespace_using_decl, finish_local_using_decl): ... here
57         * name-lookup.c (add_decl_to_level): Swap args.
58         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
59         (diagnose_name_conflict): Check contexts are same for redecl.
60         (update_local_overload): New.
61         (compparms_for_decl_and_using): Rename to ...
62         (matching_fn_p): ... here.
63         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
64         push_local_bindings call.
65         (push_local_binding): Make static, replace FLAGS arg with
66         IS_USING.
67         (validate_nonmember_using_decl): Use OVL_FIRST.
68         (do_nonmember_using_decl): Use in/out parameters.  Use
69         lkp_iterator and simplify.
70         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
71         (finish_namespace_using_decl, finish_local_using_decl): ... here.
72         Adjust.
73         (lookup_type_current_level): Delete.
74         * parser.c (cp_parser_using_declaration): Adjust.
75         * pt.c (tsubst_expr): Adjust.
77 2017-05-22  Nathan Sidwell  <nathan@acm.org>
79         * name-lookup.h (parse_using_directive): Replace with ...
80         (finish_namespace_using_directive): ... this and ...
81         (finish_local_using_directive): ... this.
82         * name-lookup.c (add_using_namespace_1): Move later.
83         (add_using_namespace): Move later, add namespace_p arg, remove
84         indirect arg.
85         (push_using_directive_1): Directly recurse.
86         (do_using_directive, parse_using_directive): Delete, split into ...
87         (finish_namespace_using_directive): ... this and ...
88         (finish_local_using_directive): ... this.
89         (push_namespace): Use add_using_namespace.
90         * parser.c (cp_parser_using_directive): Call
91         finish_namespace_using_directive or finish_local_using_directive.
92         * pt.c (tsubst_expr): Call finish_local_using_directive.
94         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
95         * cp-tree.h (raw_dump_id): Declare.
96         * decl2.c (raw_dump_id): Define.
97         (dump_tu): Use raw_dump_id.
99         * config-lang.in (gtfiles): Sort list, break lines.
101         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
102         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
103         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
104         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
105         CPTI_RETHROW_FN): New.
106         (noexcept_deferred_spec): New.
107         (terminate_node, call_unexpected_node): Rename to ...
108         (terminate_fn, call_unexpected_fn): ... here.
109         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
110         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
111         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
112         (init_exception_processing): Adjust.
113         (declare_library_fn): Create and push the fns here.
114         (do_get_exception_ptr, do_begin_catch, do_end_catch,
115         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
116         declare_library_fn use.
117         (unevaluated_noexcept_spec): Adjust.
118         * cp-gimplify.c (genericize_eh_spec_block,
119         gimplify_most_not_throw_expr): Adjust.
121         * name-lookup.c (pushdecl_top_level,
122         pushdecl_top_level_and_finish): Move after namespace pushing and
123         popping functions.
124         (push_to_top_level): Rename to ...
125         (do_push_to_top_level): ... here.  Remove timing code.
126         (pop_from_top_level_1): Rename to ...
127         (do_pop_from_top_level): ... here.
128         (do_push_nested_namespace, do_pop_nested_namespace)
129         (push_to_top_level): New wrapper for do_push_to_top_level.
130         (pop_from_top_level): Adjust.
131         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
133 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
135         * config-lang.in (gtfiles): Add c-family/c-format.c,
136         except.c, init.c, lambda.c and friend.c.
137         * class.c (dvirt_fn): Move out of function scope,
138         add GTY attribute.
139         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
140         * init.c (fn): Likewise.
141         * lambda.c (ptr_id, max_id): Likewise.
142         * friend.c (global_friend): Add GTY attribute.
144 2017-05-19  Nathan Sidwell  <nathan@acm.org>
146         * call.c (add_list_candidates): Use OVL_FIRST.
147         (build_new_method_call_1): Likewise.
148         * cp-tree.h (OVL_SINGLE_P): New.
149         (TYPE_HIDDEN_P): New.
150         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
151         * dump.c (cp_tump_tree): Adjust overload dumping.
152         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
153         printing.
154         * method.c (lazily_declare_fn): Assert we added it.
155         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
156         OVL_FIRST.
157         (cp_parser_template_name): Use lkp_iterator.
158         * pt.c (begin_template_parm_list): Fixup comment.
159         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
160         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
161         (ovl_scope): Use lkp_iterator.
163 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
165         * parser.c (cp_parser_omp_clause_default): Handle
166         "OMP_CLAUSE_DEFAULT_PRESENT".
168         * parser.c (cp_parser_omp_clause_default): Avoid printing more
169         than one syntax error message.
171 2017-05-19  Nathan Sidwell  <nathan@acm.org>
173         * class.c (class_dump_id): Define.
174         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
175         * cp-objcp-common.c (cp_register_dumps): New.
176         * cp-objcp-common.h (cp_register_dumps): Declare.
177         (LANG_HOOKS_REGISTER_DUMPS): Override.
178         * cp-tree.h (class_dump_id): Declare.
180 2017-05-18  Nathan Sidwell  <nathan@acm.org>
182         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
183         (OVL_USED_P): New.
184         (lookup_keep): Declare.
185         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
186         * pt.c (tsubst_copy): Assert lookup is persistent.
187         * semantics.c (finish_call_expr): Use lkp_iterator, call
188         lookup_keep.
189         * tree.c (ovl_copy): New.
190         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
191         (lookup_keep): New.
193         * cp-tree.h (OVL_USED): Replace with ...
194         (OVL_USING_P): ... this.
195         (ovl_iterator::using_p): Adjust.
196         * name-lookup.c (push_overloaded_decl_1,
197         do_nonmember_using_decl): Adjust.
198         * search.c (lookup_field_r): Adjust.
199         * tree.c (ovl_insert, ovl_scope): Adjust.
201         * cp-tree.h (lookup_add): Swap args.
202         (ovl_cons, build_overload): Delete.
203         * name-lookup.c (add_function, push_overloaded_decl_1,
204         do_nonmember_using_decl, merge_functions, remove_hidden_names):
205         Use lookup_add, ovl_insert.
206         * pt.c (check_explicit_specialization): Use lookup_add.
207         (do_class_deduction): Likewise. Refactor if.
208         * tree.c (lookup_add): Swap args.
209         (ovl_cons, build_overload): Delete.
211         * name-lookup.c (find_local_binding): New, broken out of ...
212         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
213         (set_namespace_binding): Swap scope & name args.
214         (namespace_binding_1): Likewise.
215         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
216         (push_overloaded_decl_1): Likewise.
217         (set_global_binding): Likewise.
218         (get_namespace_binding): Adjust namespace_binding_1 call.
220 2017-05-17  Nathan Sidwell  <nathan@acm.org>
222         * cp-tree.h (default_hash_traits <lang_identifier *>): New
223         specialization.
224         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
225         (extern_c_fns): New hash table.
226         (check_extern_c_conflict): New, broken out of ...
227         (pushdecl_maybe_friend_1): ... here.  Call it.
228         (c_linkage_bindings): Just look in hash table.
230 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
232         PR c++/80654
233         PR c++/80682
234         Implement new C++ intrinsics __is_assignable and __is_constructible.
235         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
236         (is_xible): New.
237         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
238         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
239         * method.c (constructible_expr): Set cp_unevaluated.
240         (is_xible_helper): New.
241         (is_trivially_xible): Adjust.
242         (is_xible): New.
243         * parser.c (cp_parser_primary_expression): Handle
244         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
245         (cp_parser_trait_expr): Likewise.
246         * semantics.c (trait_expr_value): Handle
247         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
249 2017-05-17  Nathan Sidwell  <nathan@acm.org>
251         * cp-tree.h (ovl_iterator::using_p): New predicate.
252         (ovl_iterator::remove_node): New worker.
253         (ovl_insert): Declare.
254         * tree.c (ovl_insert): New.
255         (ovl_iterator::remove_node): New.
256         * class.c (add_method): Use ovl_iterator, ovl_insert.
257         (clone_function_decl): Fix description.
258         (clone_constructors_and_destructors): Use ovl_iterator.
260         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
261         (maybe_warn_about_overly_private_class): Use ovl_iterator.
262         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
263         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
264         (get_base_fndecls): Use ovl_iterator.
265         (warn_hidden): Use OVL_NAME, ovl_iterator.
266         (add_implicitly_declared_members): Use ovl_iterator.
267         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
268         flatten nested if.
269         (finish_shorthand_constraint): Simplify, use ovl_make.
270         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
271         * search.c (shared_member_p): Use ovl_iterator.
272         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
273         (lookup_conversion_operator): Use OVL_FIRST.
274         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
275         (look_for_overrides_here): Use ovl_iterator.
276         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
277         * typeck.c (build_x_unary_op): Use ovl_make.
279 2017-05-17  Martin Liska  <mliska@suse.cz>
281         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
282         use it instead of int type.
283         (dump_vtable): Likewise.
284         (dump_vtt): Likewise.
285         * decl2.c (dump_tu): Likewise.
287 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
289         * call.c (enforce_access): Add access_failure_info * param and use
290         it to record access failures.
291         * cp-tree.h (class access_failure_info): New class.
292         (enforce_access): Add access_failure_info * param, defaulting to
293         NULL.
294         (lookup_member): Likewise.
295         (locate_field_accessor): New function decl.
296         (perform_or_defer_access_check): Add access_failure_info * param,
297         defaulting to NULL.
298         * search.c (lookup_member): Add access_failure_info * param and
299         pass it on to call to perform_or_defer_access_check.
300         (matches_code_and_type_p): New function.
301         (field_access_p): New function.
302         (direct_accessor_p): New function.
303         (reference_accessor_p): New function.
304         (field_accessor_p): New function.
305         (struct locate_field_data): New struct.
306         (dfs_locate_field_accessor_pre): New function.
307         (locate_field_accessor): New function.
308         * semantics.c (perform_or_defer_access_check): Add
309         access_failure_info * param, and pass it on to call to
310         enforce_access.
311         * typeck.c (access_failure_info::record_access_failure): New method.
312         (access_failure_info::maybe_suggest_accessor): New method.
313         (finish_class_member_access_expr): Pass an access_failure_info
314         instance to the lookup_member call, and call its
315         maybe_suggest_accessor method afterwards.
317 2017-05-16  Marek Polacek  <polacek@redhat.com>
319         PR sanitizer/80536
320         PR sanitizer/80386
321         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
323 2017-05-16  Nathan Sidwell  <nathan@acm.org>
325         * name-lookup.c (check_local_shadow): New, broke out of ...
326         (pushdecl_maybe_friend_1): ... here.  Call it.
328         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
329         (ovl_first): Move inline definition to end of file.
330         (ovl_make, lookup_add): Declare.
331         (get_fns, get_first_fn): Make pure.
332         * tree.c (ovl_cache): New.
333         (ovl_make, lookup_add): New.
334         * pt.c (do_class_deduction): Don't add candidates that will be
335         elided.
337         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
338         (print_error_for_call_failure): Use OVL_NAME.
339         (build_op_call_1): Use ovl_iterator.
340         (add_candidates): Use OVL_FIRST & lkp_iterator.
341         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
342         lkp_iterator.
343         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
344         (type_has_user_nondefault_constructor,
345         in_class_defaulted_default_constructor,
346         type_has_user_provided_constructor,
347         type_has_user_provided_or_explicit_constructor,
348         type_has_non_user_provided_default_constructor,
349         vbase_has_user_provided_move_assign,
350         type_has_move_constructor, type_has_move_assign,
351         type_has_user_declared_move_constructor,
352         type_has_user_declared_move_assign,
353         type_build_ctor_call, type_build_dtor_call,
354         type_requires_array_cookie, explain_non_literal_class): Likewise.
355         (finish_struct): Use lkp_iterator.
356         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
357         (note_name_declared_in_class): Use OVL_NAME.
358         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
359         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
360         cxx_pretty_printer::expression): Likewise.
361         * decl2.c (check_classfn): Use ovl_iterator.
362         * pt.c (retrieve_specialization): Use ovl_iterator.
363         * tree.c (cp_tree_equal): Use lkp_iterator.
364         (type_has_nontrivial_copy_init): Use ovl_iterator.
366         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
367         check is_overloaded_fn.
369 2017-05-16  Martin Liska  <mliska@suse.cz>
371         * parser.c (cp_lexer_print_token): Add default value for flags
372         argument of print_gimple_stmt, print_gimple_expr,
373         print_generic_stmt and print_generic_expr.
375 2017-05-16  Nathan Sidwell  <nathan@acm.org>
377         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
378         iterators.
379         (MAYBE_BASELINK_FUNCTIONS): New.
380         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
381         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
382         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
383         * method.c (inherited_ctor_binfo): Use ovl_iterator.
384         (binfo_inherited_from): Likewise.
385         * parser.c (lookup_literal_operator): Use lkp_iterator.
386         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
387         (print_candidates_1): Likewise.
388         (determine_specialization): Likewise.
389         (resolve_overloaded_unification): Likewise.
390         (resolve_nondeduced_context): Likewise.
391         (type_dependent_expression_p): Likewise.
392         (dependent_template_p): Likewise.
393         * ptree.c (cxx_print_xnode): Likewise.
394         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
395         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
396         * typeck.c (check_template_keyword): Use lkp_iterator.
398         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
399         (ovl_first): New.
400         * constexpr.c (function_concept_check): Use OVL_FIRST.
401         * cvt.c (build_expr_type_conversion): Likewise.
402         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
403         * decl2.c (mark_used): Use OVL_FIRST.
404         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
405         (dump_expr, location_of): Use OVL_FIRST.
406         * friend.c (do_friend): Use OVL_NAME.
407         * init.c (build_offset_ref): Use OVL_FIRST.
408         * mangle.c (write_member_name): Likewise.
409         (write_expression): Use OVL_NAME.
410         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
411         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
412         * pt.c (check_explicit_specialization): Use OVL_FIRST.
413         (check_template_shadow): Likewise.
414         (tsubst_template_args): Use OVL_NAME.
415         (tsubst_baselink): Use OVL_FIRST.
416         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
417         * tree.c (get_first_fn): Use OVL_FIRST.
418         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
419         (cp_build_addr_expr_1): Use OVL_FIRST.
421         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
422         peeking.
423         * semantics.c (finish_id_expression): Directly init local var.
424         (finish_omp_reduction_clause): Use really_overloaded_fn.
425         * tree.c (get_fns): Document.  Assert we got an overload.
426         (get_first_fn) Document.
427         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
428         really_overloaded_fn.
429         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
431         * cp-tree.h (SCOPE_DEPTH): New.
432         * name-lookup.h (is_nested_namespace): Declare.
433         * name-lookup.c (is_nested_namespace): New.
434         (is_ancestor): Use it.
435         (set_decl_namespace): Likewise.
436         (push_namespace): Set SCOPE_DEPTH.
437         * pt.c (check_specialization_namespace): Use is_nested_namespace.
438         (check_unqualigied_spec_or_inst): Likewise.
440 2017-05-15  Nathan Sidwell  <nathan@acm.org>
442         PR c++/79369
443         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
444         * name-lookup.h (push_namespace): Return int, add make_inline arg.
445         * name-lookup.c (push_namespace): Deal with inline directly.
446         Return pushed count.
447         * parser.c (cp_parser_namespace_definition): Adjust for
448         push_namespace change.
450 2017-05-11  Nathan Sidwell  <nathan@acm.org>
452         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
453         LANG_HOOKS_PUSHDECL): Move to ...
454         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
455         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
456         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
458         * name-lookup.h (pushdecl): Add default friend parm.
459         (pushdecl_maybe_friend): Delete.
460         (pushdecl_top_level): Add default friend parm.
461         (pushdecl_top_level_maybe_friend): Delete.
462         * name-lookup.c (pushdecl_maybe_friend): Delete.
463         (pushdecl): Add is_friend parm.
464         (pushdecl_top_level): Add is friend_parm.
465         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
466         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
467         * friend.c (do_friend): Adjust.
468         * pt.c (tsubst_friend_class): Adjust.
470         Revert pushdecl_top_level_and_finish name change.
471         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
472         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
473         * decl.c (cp_make_fname_decl): Adjust.
474         * decl2.c (get_guard, handle_tls_init):  Adjust.
475         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
477         * name-lookup.c (pushdecl_outermost_localscope): Always
478         conditionally stop timer.
480         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
481         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
483         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
484         pushtag_top_level_maybe_friend,
485         pushdecl_top_level_and_finish): Move declarations to ...
486         * name-lookup.h: ... here.  Group pushdecl variants.
487         (pushdecl_top_level_and_finish): Rename to ...
488         (pushdecl_top_level_with_init): ... here.
489         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
490         * decl2.c (get_guard, handle_tls_init): Likewise.
491         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
492         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
493         * method.c (implicitly_declare_fn): Likewise.
494         * searchc (node_debug_info_needed): Likewise.
495         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
496         (pushdecl_top_level_with_init): ... here.
497         (pop_everything): Use namespace_bindings_p.
499         * name-lookup.h (pop_binding): Rename to pop_local_binding.
500         (getdecls): Rename to get_local_decls.
501         * name-lookup.c (pop_binding): Rename to ...
502         (pop_local_binding): ... here.
503         (pop_bindings_and_leave_scope): Adjust.
504         (getdecls): Rename to ...
505         (get_local_decls): ... here.  Assert local scope.
506         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
507         logic.
508         (store_parm_decls): Adjust get_local_decls call.
509         (parser.c (synthesize_implicit_template_parm): Likewise.
511 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
513         PR c++/80682
514         * method.c (is_trivially_xible): Reject void types.
516 2017-05-10  Nathan Sidwell  <nathan@acm.org>
518         * class.c (handle_using_decl): Always use OVL_CURRENT.
519         (resolve_address_of_overloaded_function): Move iterator decl into
520         for scope.  Don't strip anticipated decls here.
522         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
523         printing.
524         (print_candidates): Adjust.
526         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
527         line breaking.
528         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
529         koenig_p handling here.
530         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
531         (tsubst_omp_clauses): Likewise.
532         (do_class_deduction): Adjust buld_new_function_call calls.
533         * semantics.c (finish_call_expr): Likewise.
535 2017-05-10  Jason Merrill  <jason@redhat.com>
537         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
538         (unify_type_mismatch, unify_parameter_pack_mismatch)
539         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
540         (unify_parameter_pack_inconsistent, unify_inconsistency)
541         (unify_vla_arg, unify_method_type_error, unify_arity)
542         (unify_arg_conversion, unify_no_common_base)
543         (unify_inconsistent_template_template_parameters)
544         (unify_template_deduction_failure)
545         (unify_template_argument_mismatch)
546         (unify_overload_resolution_failure): Call unify_invalid.
548         CWG 1847 - Clarifying compatibility during partial ordering
549         * pt.c (more_specialized_fn): No order between two non-deducible
550         parameters.
552         * pt.c (dependent_type_p): Make sure we aren't called with
553         global_type_node.
555         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
556         * pt.c (convert_template_argument): Just return an argument pack.
557         (coerce_template_parameter_pack, template_parm_to_arg)
558         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
559         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
560         Don't set the type of a NONTYPE_ARGUMENT_PACK.
561         * parser.c (make_char_string_pack, make_string_pack): Likewise.
563 2017-05-10  Nathan Sidwell  <nathan@acm.org>
565         * cp-tree.h (add_method, clone_function_decl): Change last arg to
566         bool.
567         * class.c (add_method): Change third arg to bool.  Adjust.
568         (one_inheriting_sig, one_inherited_ctor): Adjust.
569         (clone_function_decl): Change 2nd arg to bool.  Adjust.
570         (clone_constructors_and_destructors): Adjust.
571         * lambda.c (maybe_add_lambda_conv_op): Adjust.
572         * method.c (lazily_declare_fn): Adjust.
573         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
574         * semantics.c (finish_member_declaration): Adjust.
576 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
578         PR c++/80145
579         * decl.c (finish_function): To improve error recovery, change the
580         logic for calling apply_deduced_return_type.
582 2017-05-09  Jason Merrill  <jason@redhat.com>
584         * class.c (check_bases): Ignore empty bases.
586         PR c++/70979 - literal class and closure types
587         * class.c (finalize_literal_type_property): Handle closures
588         specifically.
589         (explain_non_literal_class): Likewise.
591         PR c++/66297, DR 1684 - literal class and constexpr member fns
592         * constexpr.c (is_valid_constexpr_fn): Only complain about
593         non-literal enclosing class in C++11.
594         * class.c (finalize_literal_type_property): Likewise.
596 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
598         PR c++/80186
599         * pt.c (tsubst_decl): Early return error_mark_node if
600         grok_ctor_properties returns false.
602 2017-05-09  Jason Merrill  <jason@redhat.com>
604         PR c++/70167 - array prvalue treated as lvalue
605         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
606         (enum fcl_t): New.
607         * semantics.c (finish_compound_literal): Add fcl_context parameter.
608         Only make a static variable for C99 syntax.
609         * parser.c (cp_parser_postfix_expression): Pass it.
610         * pt.c (tsubst_copy_and_build): Likewise.
611         * call.c (extend_ref_init_temps): Set
612         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
614 2017-05-09  Nathan Sidwell  <nathan@acm.org>
616         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
617         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
618         * name-lookup.h (pushdecl_top_level): Declare.
620 2017-05-08  Jason Merrill  <jason@redhat.com>
622         PR c++/80178 - parameter passing for uncopyable classes
623         * tree.c (type_has_nontrivial_copy_init): True for classes with only
624         deleted copy/move ctors.
625         (remember_deleted_copy, maybe_warn_parm_abi): New.
626         * decl.c (require_complete_types_for_parms, check_function_type):
627         Call maybe_warn_parm_abi.
628         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
630 2017-05-08  Nathan Sidwell  <nathan@acm.org>
632         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
633         (start_preparsed_function): Do decl pushing before setting
634         current_funciton_decl and announcing it.
636         * name-lookup.h (pushdecl_with_scope): Replace with ...
637         (pushdecl_outermost_localscope): ... this.
638         * name-lookup.c (pushdecl_with_scope): Replace with ...
639         (pushdecl_outermost_localscope): ... this.
640         (pushdecl_namespace_level): Adjust.
641         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
642         * lambda.c (insert_capture_proxy): Likewise.
644         * class.c (build_vtbl_initializer): Don't shadow outer variable
645         with static var.
647         Revert _binding -> _value change.
648         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
649         (get_namespace_binding, set_global_binding): ... these.
650         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
651         (get_namespace_binding, set_global_binding): ... these.
652         (arg_assoc_namespace, pushdecl_maybe_friend_1,
653         check_for_out_of_scope_variable, push_overloaded_decl_1,
654         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
655         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
656         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
657         * decl.c (poplevel): Adjust.
658         * pt.c (make_constrained_auto): Likewise.
660 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
662         PR translation/80280
663         * call.c (print_z_candidate): Fix quoting.
665 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
667         * error.c (pedwarn_cxx98): Replace report_diagnostic
668         with diagnostic_report_diagnostic.
670 2017-05-05  Nathan Sidwell  <nathan@acm.org>
672         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
673         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
674         (IDENTIFIER_NAMESPACE_VALUE): Delete.
675         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
676         with ...
677         (get_namespace_value, set_global_value): ... these.
678         (get_global_value_if_present, is_typename_at_global_scope): Delete.
679         * decl.c (poplevel): Use get_namespace_value.
680         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
681         * class.c (build_vtbl_initializer): Stash library decl in
682         static var. Use IDENTIFIER_GLOBAL_VALUE.
683         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
684         do_allocate_exception, do_free_exception, build_throw): Likewise.
685         * init.c (throw_bad_array_new_length): Likewise.
686         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
687         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
688         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
689         get_namespace_value.
690         (set_namespace_binding_1): Rename to
691         (set_namespace_binding): ... here.
692         (set_global_value): New.
693         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
694         get_namespace_value.
695         * pt.c (listify): Use get_namespace_value.
697         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
698         current scope.
699         * lex.c (unqualified_name_lookup_error): Likewise.
701         * class.c (alter_class): Use retrofit_lang_decl directly.
702         * decl.c (push_local_name, dupliate_decls): Likewise.
703         * semantics.c (omp_privatize_field): Likewise.
705         Kill walk_namespaces.
706         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
707         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
709         Kill per-namespace static_decls.
710         * cp-tree.h (static_decls): Declare.
711         (wrapup_globals_for_namespace,
712         diagnose_inline_vars_for_namespace): Replace with ...
713         (wrapup_namespace_globals): ... this.
714         * decl.c (static_decls): Define.
715         (wrapup_globals_for_namespace,
716         diagnose_inline_vars_for_namespace): Replace with ...
717         (wrapup_namespace_globals): ... this.
718         (cxx_init_decl_processing): Initialize static_decls.
719         * decl2.c (c_parse_final_cleanups): Adjust.
720         * name-lookup.h (cp_binding_level): Remove static_decls member.
721         * name-lookup.c (add_decl_to_level): Adjust.
722         (begin_scope): Adjust.
724 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
726         PR c++/71577
727         * decl.c (reshape_init): Unconditionally return error_mark_node
728         upon error about too many initializers.
730 2017-05-04  Nathan Sidwell  <nathan@acm.org>
732         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
734 2017-05-04  Martin Sebor  <msebor@redhat.com>
736         PR translation/80280
737         * call.c (print_z_candidate): Add missing quoting to %D and other
738         like directives.
739         (build_op_call_1): Same.
740         * constraint.cc (diagnose_check_constraint): Same.
741         * mangle.c (mangle_decl): Same.
742         * name-lookup.c (cp_binding_level_debug): Same.
743         (set_decl_namespace): Same.
744         * parser.c (cp_parser_tx_qualifier_opt): Same.
745         * pt.c (print_candidates_1): Same.
746         (check_template_variable): Same.
747         (tsubst_default_argument): Same.
748         (most_specialized_partial_spec): Same.
749         * semantics.c (omp_reduction_lookup): Same.
750         * tree.c (check_abi_tag_redeclaration): Same.
751         * typeck.c (comptypes): Same.
752         * typeck2.c (abstract_virtuals_error_sfinae): Same.
754 2017-05-04  Nathan Sidwell  <nathan@acm.org>
756         More global trees.
757         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
758         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
759         CPTI_INIT_LIST_IDENTIFIER.
760         (global_namespace, global_type_node, global_identifier,
761         anon_identifier, init_list_identifier): New.
762         * decl.c (global_type_node, global_scope_name): Delete.
763         (initialize_predefined_identifiers): Add new identifiers.
764         (cxx_init_decl_processing): Adjust.
765         * name-lookup.h (global_namespace, global_type_node): Delete.
766         * name-lookup.c (global_namespace, anonymous_namespace_name,
767         get_anonymous_namespace_name): Delete.
768         (namespace_scope_ht_size, begin_scope, pushtag_1,
769         push_namespace): Adjust,
770         * call.c (type_has_extended_temps): Use init_list_identifier.
771         * pt.c (listify): Likewise.
773         * name-lookup.c: Reorder functions to make merging from modules
774         branch simpler.
776 2017-05-03  Jason Merrill  <jason@redhat.com>
778         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
780 2017-05-03  Nathan Sidwell  <nathan@acm.org>
782         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
783         along with #defines, to before name-lookup include.
785 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
787         * pt.c (is_auto_or_concept): Remove.
788         (type_uses_auto_or_concept): Remove, unused.
789         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
790         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
791         * cp-tree.h (is_auto_or_concept): Remove.
793 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
795         PR c++/80038
796         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
797         add pedigree operation and detach call here.
798         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
799         cilk_cp_gimplify_call_params_in_spawned_fn.
800         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
801         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
803 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
805         * parser.c (cp_parser_member_declaration): Add fix-it hints for
806         stray comma and missing semicolon at end of member declaration.
808 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
810         * parser.c (cp_parser_cast_expression): Add target type of cast to
811         diagnostic.
812         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
814 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
816         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
817         return type to bool.
818         * cp-tree.h (grok_ctor_properties): Update.
820 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
822         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
823         information to diagnostic of invalid colon in nested-name-specifier.
825 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
827         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
828         diagnostic of invalid class/struct keyword after enum.
830 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
832         * parser.c (cp_parser_member_declaration): Add fix-it hint
833         for removing stray semicolons.
835 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
837         * name-lookup.c (get_std_name_hint): New function.
838         (maybe_suggest_missing_header): New function.
839         (suggest_alternative_in_explicit_scope): Call
840         maybe_suggest_missing_header.
842 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
844         PR c++/80177
845         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
846         candidate type of bm from tree to const char *.
847         (consider_binding_level): Likewise.
848         (lookup_name_fuzzy): Likewise, using this to merge the best
849         result from the preprocessor into bm, rather than immediately
850         returning, so that better matches from reserved words can "win".
851         Guard the rejection of keywords that don't start decl-specifiers
852         so it only happens for FUZZY_LOOKUP_TYPENAME.
854 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
856         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
857         (start_enum): Likewise.
858         (build_enumerator): Likewise. Use %qE instead of plain %E.
859         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
860         %<%D%> in diagnostics.
861         (cp_parser_elaborated_type_specifier): Likewise.
862         * pt.c (make_pack_expansion): Use %qT and %qE instead of
863         %<%T%> and %<%E%> in diagnostics.
864         (tsubst_pack_expansion): Likewise.
866 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
868         PR c++/80016
869         * parser.c (cp_parser_unary_expression):  Generate a location
870         range for alignof and sizeof expressions.
872 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
874         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
875         error message.
876         (cp_parser_virt_specifier_seq_opt): Likewise.
877         (set_and_check_decl_spec_loc): Likewise twice.
879 2017-04-21  Jason Merrill  <jason@redhat.com>
881         PR c++/80179 - ICE with initialized flexible array member.
882         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
884 2017-04-21  Richard Biener  <rguenther@suse.de>
886         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
887         (copy_type): Likewise.
888         * lex.c (copy_decl): Pass down mem-stat info.
889         (copy_type): Likewise.
891 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
893         PR c++/80473
894         * init.c (build_new_1): Suppress notes about over-aligned new when
895         the warning is suppressed.
897 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
899         * parser.c (cp_parser_member_declaration): Add warning with fixit
900         information for extra semicolon after in-class function definition.
902 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
904         PR middle-end/80423
905         * tree.c (build_cplus_array_type): Call build_array_type
906         with the intended TYPE_TYPELESS_STORAGE flag value, instead
907         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
908         on the shared type.
910 2017-04-18  Marek Polacek  <polacek@redhat.com>
912         PR c++/80244 - ICE with attribute in template alias.
913         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
915         PR c++/80241 - ICE with alignas pack expansion.
916         * error.c (dump_expr): Handle TREE_LIST.
917         * parser.c (cp_parser_std_attribute_list): Return error_mark if
918         make_pack_expansion returns an error.
920 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
922         PR c++/80287
923         * class.c (fixup_may_alias): Fix all type variants.
925 2017-04-17  Jason Merrill  <jason@redhat.com>
927         PR c++/80415 - wrong error with default arg and array reference.
928         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
930         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
932 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
934         * decl.c (name_unnamed_type): Split out of...
935         (grokdeclarator): ... this.
936         * decl.h (name_unnamed_type): Declare.
938 2017-04-12  Richard Biener  <rguenther@suse.de>
939         Bernd Edlinger  <bernd.edlinger@hotmail.de>
941         PR middle-end/79671
942         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
943         for arrays of character or std::byte type.
945 2017-04-11  Jason Merrill  <jason@redhat.com>
947         PR c++/80294 - ICE with constexpr and inheritance.
948         * constexpr.c (reduced_constant_expression_p):
949         A null constructor element is non-constant.
950         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
951         returning an empty base.
953 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
955         PR c++/80370
956         * decl.c (cp_finish_decomp): If processing_template_decl on
957         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
958         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
959         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
960         processing.
961         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
962         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
963         dependent.
965 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
967         PR c++/80363
968         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
970 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
972         PR c++/80176
973         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
974         operand, if it is a static member function, recurse on the
975         BASELINK.
977 2017-04-10  Marek Polacek  <polacek@redhat.com>
979         PR sanitizer/80348
980         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
981         ORIG_TYPE earlier and not only when shortening.
983 2017-04-07  Jason Merrill  <jason@redhat.com>
985         PR c++/80356 - ICE with reference to function template argument.
986         PR c++/79294
987         * pt.c (convert_nontype_argument_function): Adjust type even with a
988         value-dependent argument.
990         PR c++/80267 - ICE with nested capture of reference
991         PR c++/60992
992         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
994 2017-04-07  Marek Polacek  <polacek@redhat.com>
996         PR sanitizer/80348
997         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
999         PR c++/80095
1000         * call.c (build_over_call): Don't check cxx_dialect.
1001         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1002         whether SUB is a CONSTRUCTOR.
1003         * init.c (build_new_1): Don't check cxx_dialect.
1004         * tree.c (replace_placeholders): Add a function comment.  Return if
1005         not in C++14, or if the object isn't a (member of a) class.
1006         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1007         TYPE is CLASS_TYPE_P.
1009 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
1011         PR c++/80309
1012         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1013         of a loop doing vec_safe_push of NULL.  Formatting fixes.
1014         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1015         to newidx before calling canonical_type_parameter on newtype.
1017 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
1019         PR c++/80296
1020         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1021         UNARY_PLUS_EXPR case.
1023 2017-04-03  Jason Merrill  <jason@redhat.com>
1025         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1027 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
1029         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1030         * decl2.c (one_static_initialization_or_destruction): Likewise.
1031         * name-lookup.c (store_bindings): Likewise.
1032         * parser.c (make_call_declarator): Likewise.
1033         * pt.c (check_explicit_specialization): Likewise.
1035 2017-04-03  Jason Merrill  <jason@redhat.com>
1037         PR sanitizer/79993 - ICE with VLA initialization from string
1038         PR c++/69487 - wrong VLA initialization from string
1039         * init.c (finish_length_check): Split out from build_vec_init.
1040         (build_vec_init): Handle STRING_CST.
1041         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1042         (digest_init_r): Don't give a STRING_CST VLA type.
1044 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
1046         PR c++/79572
1047         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1048         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
1049         for NOP_EXPR to REFERENCE_TYPE.
1051         PR libstdc++/80251
1052         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1053         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1054         CPTK_IS_AGGREGATE.
1055         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1056         Remove extraneous parens.
1057         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1058         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1059         (cp_parser_trait_expr): Likewise.
1061 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
1063         PR middle-end/80162
1064         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1065         * typeck.c (cxx_mark_addressable): Likewise.  Look through
1066         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1067         to ARRAY_TYPE.
1068         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1070 2017-03-24  Jason Merrill  <jason@redhat.com>
1072         PR c++/77339 - ICE with invalid use of alias template.
1073         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1074         alias template.
1076 2017-03-24  Marek Polacek  <polacek@redhat.com>
1078         PR c++/80119
1079         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1080         doesn't have side effects.
1082 2017-03-23  Jason Merrill  <jason@redhat.com>
1084         PR c++/80150 - ICE with overloaded variadic deduction.
1085         * pt.c (try_one_overload): Remove asserts.
1087         PR c++/77563 - missing ambiguous conversion error.
1088         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1090 2017-03-23  Marek Polacek  <polacek@redhat.com>
1092         * cp-tree.h: Remove a C_RID_YYCODE reference.
1094 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
1096         PR c++/80141
1097         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1098         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1099         processing_template_decl.
1101 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
1103         PR c++/77752
1104         * name-lookup.c (pushtag_1): Add check for bogus, non template,
1105         std::initializer_list.
1107 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
1109         PR c++/35878
1110         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1112 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
1114         PR c++/35878
1115         * init.c (std_placement_new_fn_p): New.
1116         (build_new_1): Call it.
1118 2017-03-20  Jason Merrill  <jason@redhat.com>
1120         PR c++/80096 - ICE with C++17 non-type auto.
1121         * pt.c (tsubst): Delay tsubst of type of template non-type
1122         parameter.
1124         PR c++/79519 - ICE with deleted template friend.
1125         * decl.c (grokdeclarator): Complain about misplaced function
1126         definition using =, as well.
1128         PR c++/79640 - infinite recursion with generic lambda.
1129         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1130         before substituting its initializer.
1132 2017-03-20  Marek Polacek  <polacek@redhat.com>
1133             Paolo Carlini  <paolo.carlini@oracle.com>
1135         PR c++/80059 - ICE with noexcept and __transaction_atomic
1136         * except.c (build_must_not_throw_expr): Call
1137         instantiate_non_dependent_expr.
1139 2017-03-19  Jason Merrill  <jason@redhat.com>
1141         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1142         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1143         reference decomposition.
1145         PR c++/80077 - error with constexpr and -fno-elide-constructors.
1146         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1147         expanding trivial constructor.
1149 2017-03-17  Jason Merrill  <jason@redhat.com>
1151         PR c++/78345 - ICE initializing array from lambda.
1152         * init.c (build_aggr_init): Check array initializer.
1153         (build_vec_init): Check the type of a CONSTRUCTOR.
1155         PR c++/80073 - C++17 ICE with virtual base.
1156         * decl.c (xref_basetypes): Also check for indirect vbases.
1158 2017-03-16  Jason Merrill  <jason@redhat.com>
1160         * decl.c (start_enum): std::byte aliases anything.
1162         PR c++/79797
1163         * constexpr.c (lookup_placeholder): Tweak.
1165 2017-03-15  Jason Merrill  <jason@redhat.com>
1167         PR c++/80043 - ICE with -fpermissive
1168         * typeck.c (convert_for_assignment): Handle instantiate_type
1169         not giving an error.
1171 2017-03-14  Nathan Sidwell  <nathan@acm.org>
1173         PR c++/79393 DR 1658 workaround
1174         * method.c (synthesized_method_base_walk): Inihibit abstract class
1175         virtual base access check here.
1176         (synthesized_method_walk): Not here.
1178 2017-03-13  Nathan Sidwell  <nathan@acm.org>
1180         PR c++/79393 DR 1658 workaround
1181         * method.c (synthesized_method_walk): Check vbases of abstract
1182         classes for dtor walk.
1184 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
1186         PR translation/79848
1187         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1189 2017-03-10  Jason Merrill  <jason@redhat.com>
1191         PR c++/79960 - alias templates and partial ordering
1192         * pt.c (comp_template_args): Add partial_order parm.
1193         (template_args_equal): Likewise.
1194         (comp_template_args_porder): New.
1195         (get_partial_spec_bindings): Use it.
1197 2017-03-10  Marek Polacek  <polacek@redhat.com>
1199         PR c++/79967
1200         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1202 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
1204         PR c++/79899
1205         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1206         Use XALLOCAVEC macro.
1208         PR c++/79896
1209         * decl.c (finish_enum_value_list): If value is error_mark_node,
1210         don't copy it and change its type.
1211         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1212         of CONST_DECL is error_mark_node.
1214 2017-03-09  Marek Polacek  <polacek@redhat.com>
1216         PR c++/79900 - ICE in strip_typedefs
1217         * tree.c (strip_typedefs): Skip the attribute handling if T is
1218         a variant type which hasn't been updated yet.
1220         PR c++/79687 - wrong code with pointer-to-member
1221         * init.c (constant_value_1): Break if the variable has a dynamic
1222         initializer.
1224 2017-03-08  Jason Merrill  <jason@redhat.com>
1226         PR c++/79797 - ICE with self-reference in array DMI.
1227         * constexpr.c (lookup_placeholder): Split out...
1228         (cxx_eval_constant_expression): ...from here.
1230 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
1232         PR c/79834
1233         * parser.c (cp_parser_omp_cancellation_point,
1234         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1235         cp_parser_omp_target_update): Change "may only be used in compound
1236         statements" diagnostics, such that the same translatable string is
1237         used for all pragmas.
1238         (cp_parser_pragma): Likewise.  Use error_at instead of
1239         cp_parser_error for that diagnostics.
1241 2017-03-06  Marek Polacek  <polacek@redhat.com>
1243         PR c++/79796 - ICE with NSDMI and this pointer
1244         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1245         replace_placeholders.
1247 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
1249         PR c++/79822
1250         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1251         ({ (void) 0; }).
1253 2017-03-06  Jason Merrill  <jason@redhat.com>
1255         Revert "Allow deduction guides to look into primary template."
1256         * cp-tree.h, parser.c, pt.c, search.c: Revert.
1258 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
1260         PR c++/70266
1261         * except.c (build_must_not_throw_expr): Perform the implicit
1262         conversions on the condition.
1264 2017-03-03  Jason Merrill  <jason@redhat.com>
1266         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1267         -Wc++1z-compat.
1269         Core issues 2273 and 2277
1270         * call.c (joust): Adjust using-declaration tiebreaker to handle
1271         the intermediate base case.
1272         * method.c (strip_inheriting_ctors): Just return the argument if
1273         !flag_new_inheriting_ctors.
1275 2017-03-03  Richard Biener  <rguenther@suse.de>
1277         PR c++/79825
1278         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1280 2017-03-03  Marek Polacek  <polacek@redhat.com>
1282         PR c++/79791
1283         * typeck.c (string_conv_p): In C++11, always call pedwarn with
1284         OPT_Wwrite_strings.
1286 2017-03-02  Jason Merrill  <jason@redhat.com>
1288         Update overload resolution with deduction guides.
1289         * pt.c (do_class_deduction): Always build the copy guide.
1290         (copy_guide_p, template_guide_p): New.
1291         (build_deduction_guide): Remember the original constructor.
1292         * call.c (joust): Prefer the copy guide and non-template guides.
1294         Allow deduction guides to look into primary template.
1295         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1296         (struct cp_decl_specifier_seq): Add constructor_p.
1297         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1298         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
1299         Clear deduction_guide_type.  Don't handle deduction guide names.
1300         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1301         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
1302         (cp_parser_member_declaration, cp_parser_cache_defarg)
1303         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1304         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1305         (build_deduction_guide): Set deduction_guide_type.
1306         (dependent_scope_p): Check deduction_guide_type.
1307         * search.c (lookup_member): Likewise.
1309 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
1311         PR c++/79782
1312         * init.c (mark_exp_read_r): New function.
1313         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1314         whole arguments instead of plain mark_exp_read on TREE_LIST values.
1316 2017-03-01  Jason Merrill  <jason@redhat.com>
1318         Class template argument deduction in new-expression
1319         * init.c (build_new): Handle deduction from no initializer.
1320         * parser.c (cp_parser_new_expression): Don't require a single
1321         expression for class template deduction.
1322         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1323         class template placeholder.
1324         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1325         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1326         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1328 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
1330         PR c++/79746
1331         * init.c (emit_mem_initializers): When not constructing vbases of
1332         abstract classes, mark arguments as read for
1333         -Wunused-but-set-parameter.
1335 2017-02-28  Jason Merrill  <jason@redhat.com>
1337         Class template argument deduction refinements
1338         * call.c (joust): Move deduction guide tiebreaker down.
1339         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1340         deduction with no initializer.
1341         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1342         (do_class_deduction): Use that rather than special case.
1343         (do_auto_deduction): Handle null initializer.
1345 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
1347         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1348         instead of just cond ? "..." : "...".
1349         (grokdeclarator): Likewise.
1350         (build_enumerator): Likewise.
1351         * init.c (build_new_1): Likewise.
1352         * call.c (build_new_method_call_1): Likewise.
1353         * parser.c: Include intl.h.
1354         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1355         "enter"/"exit" keyword.
1356         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1357         message.
1359 2017-02-27  Jason Merrill  <jason@redhat.com>
1361         PR c++/71568 - SFINAE forming pointer to member function
1362         * init.c (build_offset_ref): Check the return value of
1363         perform_or_defer_access_check.
1365 2017-02-27  Marek Polacek  <polacek@redhat.com>
1367         * decl.c (expand_static_init): Add missing } in a comment.
1369 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
1371         * init.c: Include intl.h.
1372         (build_new_1): Move message strings into pedwarn to make them
1373         -Wformat-security friendly. Mark string for translation.
1374         * pt.c (tsubst_copy_and_build): Mark string for translation.
1375         Make the pointer const.
1376         * semantics.c (finish_id_expression): Mark strings for translation.
1378 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
1380         * call.c (build_op_delete_call): Make msg1 and msg2 const.
1382 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
1384         PR c++/79588
1385         * call.c (build_over_call): Call check_function_arguments even for
1386         -Wrestrict, adjust check_function_arguments caller.
1387         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1388         here.
1389         * typeck.c (cp_build_function_call_vec): Adjust
1390         check_function_arguments caller.
1392 2017-02-24  Marek Polacek  <polacek@redhat.com>
1394         PR translation/79705
1395         * decl.c (check_redeclaration_exception_specification): Mark a string
1396         for translation.  Make the pointer const.
1398 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
1400         PR c++/79361
1401         * pt.c (register_specialization): Check duplicate_decls return value
1402         for error_mark_node and pass it back.
1404 2017-02-22  Jason Merrill  <jason@redhat.com>
1406         PR c++/79679 - missing destructor for argument
1407         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1408         conversions.
1410         * pt.c (do_class_deduction): Handle 0 argument case.
1412 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
1414         PR c++/79664
1415         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1416         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1417         * constexpr.c (potential_constant_expression_1): Handle
1418         OMP_*, OACC_* and CILK_* trees.  Use error_at with
1419         EXPR_LOC_OR_LOC (t, input_location) computed early
1420         instead of error, or error_at with location_of (t).
1422 2017-02-22  Marek Polacek  <polacek@redhat.com>
1424         PR c++/79653
1425         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1426         if the alignas expression is erroneous.
1427         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1428         error_mark_node.
1430         PR c++/79657
1431         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1433 2017-02-21  Jason Merrill  <jason@redhat.com>
1435         PR c++/50308 - wrong deprecated warning with ADL
1436         PR c++/17729 - duplicate deprecated warning
1437         * semantics.c (finish_id_expression): Only call mark_used on a
1438         function if we aren't building a call.
1440         PR c++/41727 - ICE with partial spec of partial instantiation
1441         * pt.c (process_partial_specialization): For now, don't check more
1442         specialized if there is more than one level of args.
1444 2017-02-21  Marek Polacek  <polacek@redhat.com>
1446         PR c++/79535
1447         * cp-tree.h (maybe_reject_flexarray_init): Declare.
1448         * init.c (maybe_reject_flexarray_init): No longer static.
1449         Add check for current_function_decl.
1450         * parser.c (cp_parser_late_parse_one_default_arg): Reject
1451         a default mem-initializer for a flexible array.
1453 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1454             Paolo Carlini  <paolo.carlini@oracle.com>
1456         PR c++/79654
1457         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1458         on error.
1459         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1460         decl after the decomposition artificial decl has error_mark_node.
1461         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1462         instead of just == error_mark_node comparison.
1464 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1466         PR sanitizer/79589
1467         * decl.c: Include gimplify.h.
1468         (cp_finish_decomp): Make sure there is no sharing of trees
1469         in between DECL_VALUE_EXPR of decomposition decls.
1471         PR c++/79655
1472         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1474         PR c++/79639
1475         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1476         call cplus_expand_constant on it first.
1478 2017-02-19  Jason Merrill  <jason@redhat.com>
1480         PR c++/78139 - destructor needed by new-expression
1481         * call.c (build_special_member_call): Use tf_no_cleanup.
1483         PR c++/78282 - auto template and pack expansion
1484         * pt.c (find_parameter_packs_r): Don't walk into the type of
1485         templates other than template template-parameters.
1487         PR c++/79606 - ICE with this->base_member in NSDMI
1488         * class.c (build_base_path): Check processing_template_decl.
1490         PR c++/79607 - ICE with T{} initializer
1491         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1493         PR c++/79566 - elaborated-type-specifier in range for
1494         * parser.c (cp_parser_simple_declaration): Fix check for type
1495         definition.
1497         PR c++/79400 - confusing suggestion of 'noexcept'
1498         * parser.c (cp_parser_exception_specification_opt): Remove
1499         suggestion for deprecated dynamic exception-specification.
1501         PR c++/79470 - partial ordering with reference parameters
1502         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1504         PR c++/79500 - ICE with non-template deduction guide
1505         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1506         DECL_TEMPLATE_RESULT.
1508         PR c++/79580 - ICE with compound literal
1509         * parser.c (cp_parser_class_head): If we're in the middle of an
1510         expression, use ts_within_enclosing_non_class.
1512         PR c++/79503 - inherited ctor taking base class
1513         * call.c (add_function_candidate): Also check that
1514         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1516 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
1518         PR c++/79380
1519         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1520         argument.
1522 2017-02-19  Eric Fiselier  <eric@efcs.ca>
1523             Jonathan Wakely  <jwakely@redhat.com>
1525         PR c++/69523
1526         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1527         control warning about literal suffix identifiers without a leading
1528         underscore.
1530 2017-02-17  Jason Merrill  <jason@redhat.com>
1532         PR c++/79508 - lookup error with member template
1533         * parser.c (cp_parser_template_name): Clear
1534         parser->context->object_type if we aren't doing lookup.
1536         PR c++/78690 - ICE with using and global type with same name
1537         * pt.c (type_dependent_object_expression_p): True for
1538         IDENTIFIER_NODE.
1540         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1541         * pt.c (convert_template_argument): Just return an auto arg pack.
1542         (tsubst_template_args): Don't tsubst an auto pack type.
1544         PR c++/79556 - C++17 ICE with non-type auto
1545         * pt.c (do_auto_deduction): Don't try to deduce from null type.
1547         PR c++/79533 - C++17 ICE with temporary cast to reference
1548         * call.c (build_over_call): Conversion to a reference prevents copy
1549         elision.
1551 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1552             Jason Merrill  <jason@redhat.com>
1554         PR c++/79502 - lost nodiscard attribute
1555         * pt.c (apply_late_template_attributes): Do apply non-dependent
1556         attributes to types.
1558 2017-02-16  Jason Merrill  <jason@redhat.com>
1560         PR c++/78572 - ICE with self-modifying array initializer
1561         * constexpr.c (cxx_eval_store_expression): The object we're
1562         initializing is outside the constant-expression.
1563         (cxx_eval_call_expression): Set ctx->call.
1565         PR c++/79050 - ICE with undeduced auto and LTO
1566         * decl.c (poplevel): Remove undeduced auto decls.
1568 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1570         PR c++/79512
1571         * parser.c (cp_parser_omp_target): For -fopenmp-simd
1572         ignore #pragma omp target even when not followed by identifier.
1574 2017-02-15  Jason Merrill  <jason@redhat.com>
1575             Jakub Jelinek  <jakub@redhat.com>
1577         PR c++/79464 - ICE in IPA with omitted constructor parms
1578         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1579         (adjust_clone_args): Adjust.
1580         (add_method): Remember omitted parms.
1581         * call.c (add_function_candidate): Likewise.
1582         * mangle.c (write_method_parms): Likewise.
1583         * method.c (ctor_omit_inherited_parms): Return false if there are no
1584         parms to omit.
1586 2017-02-15  Martin Sebor  <msebor@redhat.com>
1588         PR c++/79363
1589         * init.c (maybe_reject_flexarray_init): New function.
1590         (perform_member_init): Call it.
1592 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
1594         PR c++/79301
1595         * parser.c (cp_parser_std_attribute): Don't pedwarn about
1596         [[deprecated]] with -std=c++11 and [[fallthrough]] with
1597         -std=c++11 and -std=c++14.
1599         PR c++/79288
1600         * decl.c (grokdeclarator): For static data members, handle thread_p
1601         only after handling inline.
1603 2017-02-14  Marek Polacek  <polacek@redhat.com>
1605         PR c++/79420
1606         PR c++/79463
1607         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1608         clobbering if the postfix expression isn't an EXPR_P.
1610 2017-02-13  Jason Merrill  <jason@redhat.com>
1612         PR c++/79461 - ICE with lambda in constexpr constructor
1613         * constexpr.c (build_data_member_initialization): Ignore
1614         initialization of a local variable.
1616 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
1618         * init.c (warn_placement_new_too_small): Add missing space in
1619         diagnostics.
1620         * parser.c (cp_parser_oacc_declare): Likewise.
1621         * mangle.c (maybe_check_abi_tags): Likewise.
1623         PR c++/79232
1624         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
1625         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
1626         in the rightmost operand.
1628 2017-02-13  Nathan Sidwell  <nathan@acm.org>
1630         PR c++/79296 - ICE mangling localized template instantiation
1631         * decl2.c (determine_visibility): Use template fn context for
1632         local class instantiations.
1634 2017-02-11  Jason Merrill  <jason@redhat.com>
1636         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
1637         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
1638         (build_new_1): Use replace_placeholders.
1639         * tree.c (replace_placeholders_t): Also track whether we've seen a
1640         placeholder.
1641         (replace_placeholders, replace_placeholders_r): Adjust.
1642         * cp-tree.h: Adjust.
1644         PR c++/77790 - ICE with auto function in C++11 mode
1645         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
1646         (require_deduced_type): Add complain parm, return bool.
1647         * cp-tree.h: Adjust.
1648         * decl2.c (mark_used): Use require_deduced_type.
1650 2017-02-10  Jason Merrill  <jason@redhat.com>
1652         PR c++/78908 - template ops and bitfields
1653         * tree.c (build_min_non_dep): Use unlowered_expr_type.
1655         PR c++/78897 - constexpr union
1656         * constexpr.c (cxx_eval_store_expression): A store to a union member
1657         erases a previous store to another member.
1659         PR c++/71285 - member of fold-expression
1660         * semantics.c (finish_unary_fold_expr)
1661         (finish_binary_fold_expr): Use null type for fold-expressions.
1663         PR c++/79401 - protected inherited constructor
1664         * call.c (enforce_access): For inheriting constructor, find a base
1665         binfo in the path we already have.
1667 2017-02-10  Marek Polacek  <polacek@redhat.com>
1669         PR c++/79435
1670         * pt.c (type_dependent_expression_p): Check if the expression type
1671         is null.
1673         PR c++/79184
1674         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
1675         if warnings shouldn't be given.
1677 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
1679         PR c++/71737
1680         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
1681         an error_mark_node as type.
1683 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
1684             Jason Merrill  <jason@redhat.com>
1686         PR c++/79143
1687         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
1688         from pattern to type.
1690 2017-02-09  Jason Merrill  <jason@redhat.com>
1692         PR c++/79316 - default argument in deduction guide
1693         PR c++/79350 - explicit deduction guide
1694         * parser.c (cp_parser_constructor_declarator_p)
1695         (cp_parser_direct_declarator): Parse deduction guides more like
1696         constructors.
1697         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
1698         * tree.c (special_function_p): Return it.
1699         * decl.c (check_special_function_return_type): Handle it.
1700         (grokdeclarator, grokfndecl): Adjust.
1701         (cp_finish_decl): Pass flags to do_auto_deduction.
1702         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
1703         * pt.c (dguide_name_p): Take a const_tree.
1704         (do_class_deduction): Handle explicit.
1705         (do_auto_deduction): Pass flags through.
1706         (build_deduction_guide): Copy explicit flag.
1708 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
1710         PR c++/79429
1711         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
1712         non-pragma_compound context here.
1713         (cp_parser_omp_target): Likewise.
1714         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
1715         parsing for ordered and target omp pragmas in non-pragma_stmt
1716         non-pragma_compound contexts.
1718         PR c/79431
1719         * parser.c (cp_parser_oacc_declare): Formatting fix.
1720         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
1721         automatic variables.
1723 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
1724             Chung-Lin Tang  <cltang@codesourcery.com>
1726         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
1727         parsing.  Parse constant expression. Remove semantic checking.
1728         (cp_parser_omp_clause_collapse): Disallow tile.
1729         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
1730         error about missing for after already emitting one.  Use more
1731         conventional for idiom for unbounded loop.
1732         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1733         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1734         (finish_omp_for): Deal with tile clause.
1736 2017-02-07  Nathan Sidwell  <nathan@acm.org>
1738         * method.c (synthesized_method_base_walk): New.  Broken out of ...
1739         (synthesized_method_walk): ... here.  Call it.  Cleanup
1740         initializations.
1742 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
1744         PR c++/79360
1745         * typeck2.c (process_init_constructor_union): Consider only
1746         FIELD_DECLs when looking for an NSDMI.
1748 2017-02-06  Jason Merrill  <jason@redhat.com>
1750         PR c++/71193 - incomplete types in templates
1751         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1752         handle incomplete type by pedwarning and then treating as dependent.
1754 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
1756         PR c++/79379
1757         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1758         (potential_constant_expression_1): Likewise.
1760         PR c++/79377
1761         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
1762         allow one fewer than expected arguments if flag_permissive.
1764         PR c++/79372
1765         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
1766         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
1767         with error_mark_node type.
1769 2017-02-03  Jason Merrill  <jason@redhat.com>
1771         PR c++/78689 - ICE on constructor with label
1772         * optimize.c (maybe_clone_body): Replace omitted parameters with
1773         null lvalues.
1774         * class.c (build_clone): Fix logic for omitting inherited parms.
1776         PR c++/12245 - excessive memory use
1777         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
1778         back in.  Don't cache constants.
1779         (maybe_constant_init): Don't cache constants.
1781         PR c++/79294 - ICE with invalid template argument
1782         * pt.c (convert_nontype_argument_function): Check value-dependence.
1783         (convert_nontype_argument): Don't check it here for function ptrs.
1785 2017-02-02  Richard Biener  <rguenther@suse.de>
1787         PR cp/14179
1788         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
1789         it lazily on the first changed element only and copy it
1790         fully upfront, only storing changed elements.
1792 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
1794         PR c++/69637
1795         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
1796         to the width.
1798 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
1800         PR c++/79304
1801         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
1802         after ARROW_EXPR.
1804 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
1806         PR c++/79298
1807         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
1808         any namespace aliases.
1810 2017-01-31  Nathan Sidwell  <nathan@acm.org>
1812         PR c++/79290
1813         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
1815         PR c++/67273
1816         PR c++/79253
1817         * pt.c: (instantiate_decl): Push to top level when current
1818         function scope doesn't match.  Only push lmabda scope stack when
1819         pushing to top.
1821         * cp-tree.h (instantiate_decl): Make defer_ok bool.
1822         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
1823         (instantiate_decl): Simplify and reorder state saving and restoration.
1825         PR c++/79264
1826         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
1827         * semantics.c (finish_member_declaration): Assert class is being
1828         defined.
1830 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
1832         Introduce C++ support in libcc1.
1833         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
1834         (ansi_opname): Rename to...
1835         (cp_operator_id): ... this.  Adjust all callers.
1836         (ansi_assopname): Rename to...
1837         (cp_assignment_operator_id): ... this.  Adjust all callers.
1838         (cp_literal_operator_id): Declare.
1839         (set_global_friend): Declare.
1840         (is_global_friend): Declare.
1841         (enum cp_oracle_request): New type.
1842         (cp_binding_oracle_function): New type.
1843         (cp_binding_oracle): Declare.
1844         (cp_finish_injected_record_type): Declare.
1845         * friend.c (global_friend): New var.
1846         (set_global_friend): New fn.
1847         (is_global_friend): New fn.
1848         (is_friend): Call is_global_friend.
1849         * name-lookup.c (cp_binding_oracle): New var.
1850         (query_oracle): New fn.
1851         (qualified_lookup_using_namespace): Call query_oracle.
1852         (lookup_name_real_1): Likewise.
1853         * parser.c (cp_literal_operator_id): Drop static.
1854         * search.c (friend_accessible_p): Call is_global_friend.
1855         * semantics.c (is_this_parameter): Accept a variable if the
1856         binding oracle is enabled.
1858 2017-01-27  Jason Merrill  <jason@redhat.com>
1860         PR c++/78771 - ICE with inherited constructor.
1861         * call.c (build_over_call): Call deduce_inheriting_ctor here.
1862         * pt.c (tsubst_decl): Not here.
1863         * class.c (add_method): Or here.
1864         * method.c (deduce_inheriting_ctor): Handle clones.
1865         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
1867 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
1869         PR c++/64382
1870         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
1871         New function.
1872         * cp/cp-tree.h: Declare it.
1873         * cp/semantics.c (finish_id_expression): Resolve names within a default
1874         capturing generic lambda defined within a template prior to
1875         instantiation to allow for captures to be added to the closure type.
1877 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
1879         PR c++/68727
1880         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
1881         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
1882         * parser.c (cp_parser_builtin_offsetof): Pass result of
1883         build_static_cast of null_pointer_node to finish_offsetof.
1884         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
1885         it for -Winvalid-offsetof pedwarn instead of trying to guess
1886         original offsetof type from EXPR.  Save OBJECT_PTR as a new
1887         second operand to OFFSETOF_EXPR.
1888         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
1889         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
1890         as OBJECT_PTR.
1892 2017-01-26  Jason Merrill  <jason@redhat.com>
1894         * name-lookup.c (parse_using_directive): Deprecate strong using.
1896         PR c++/79176 - lambda ICE with -flto -Os
1897         * decl2.c (vague_linkage_p): Handle decloned 'tors.
1898         * tree.c (decl_linkage): Likewise.
1900 2017-01-25  Martin Sebor  <msebor@redhat.com>
1902         * decl.c (grokdeclarator): Fix a typo in a comment.
1904 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
1906         PR c++/78896
1907         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
1908         lambda expressions.
1910         PR c++/77914
1911         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
1912         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
1914 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
1916         PR lto/79061
1917         * decl.c (cxx_init_decl_processing): Pass main_input_filename
1918         to build_translation_unit_decl.
1920 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
1922         PR c++/79205
1923         * cp-gimplify.c (cp_genericize_r): Add result of
1924         convert_from_reference on invisiref parm to p_set.
1926 2017-01-24  Nathan Sidwell  <nathan@acm.org>
1928         PR c++/78469 - defaulted ctor and inaccessible dtor
1929         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
1930         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
1931         * tree.c (build_target_expr): Check tf_no_cleanup.
1933         PR c++/79118 - anon-members and constexpr
1934         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
1935         ctor decl.  Recursively check anonymous members.
1936         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
1937         call.
1938         (explain_invalid_constexpr_fn): Likewise.
1940 2017-01-23  Nathan Sidwell  <nathan@acm.org>
1942         PR c++/71710 - template using directive of field
1943         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
1944         check earlier.
1946         PR c++/71406 - ICE with scope-ref'd template id exprs
1947         PR c++/77508
1948         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
1949         before breaking up TEMPLATE_ID_EXPR.
1951 2017-01-20  Nathan Sidwell  <nathan@acm.org>
1953         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
1954         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
1956 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
1958         PR c++/77829
1959         PR c++/78656
1960         * cp-tree.h (suggest_alternatives_for): Add bool param.
1961         (suggest_alternative_in_explicit_scope): New decl.
1962         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
1963         that isn't the global one, call new function
1964         suggest_alternative_in_explicit_scope, only calling
1965         suggest_alternatives_for if it fails, and disabling near match
1966         searches fort that case.  When SCOPE is the global namespace,
1967         pass true for new param to suggest_alternatives_for to allow for
1968         fuzzy name lookups.
1969         * lex.c (unqualified_name_lookup_error): Pass true for new param
1970         to suggest_alternatives_for.
1971         * name-lookup.c (consider_binding_level): Add forward decl.
1972         (suggest_alternatives_for): Add "suggest_misspellings" param,
1973         using it to conditionalize the fuzzy name-lookup code.
1974         (suggest_alternative_in_explicit_scope): New function.
1975         * parser.c (cp_parser_primary_expression): When calling
1976         finish_id_expression, pass location of id_expression rather
1977         than that of id_expr_token.
1978         (cp_parser_id_expression): Convert local "unqualified_id" from
1979         tree to cp_expr to avoid implicitly dropping location information.
1981 2017-01-20  Marek Polacek  <polacek@redhat.com>
1983         PR c/64279
1984         * call.c (build_conditional_expr_1): Warn about duplicated branches.
1985         * semantics.c (finish_expr_stmt): Build statement using the proper
1986         location.
1988 2017-01-19  Jason Merrill  <jason@redhat.com>
1990         US 20 - forwarding references and class template argument deduction
1991         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
1992         * pt.c (push_template_decl_real): Set it.
1993         (maybe_adjust_types_for_deduction): Check it.
1994         (rewrite_template_parm): Copy it.
1996         US 19 - deduction guides and constructors
1997         * call.c (joust): Prefer deduction guides to constructors.
1998         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
1999         (deduction_guide_p): Check DECL_P.
2001         * decl.c (check_initializer): Always use build_aggr_init for array
2002         decomposition.
2004         PR c++/79130 - decomposition and direct-initialization
2005         * init.c (build_aggr_init): Communicate direct-initialization to
2006         build_vec_init.
2007         (build_vec_init): Check for array copy sooner.
2008         * parser.c (cp_parser_decomposition_declaration): Remove call to
2009         build_x_compound_expr_from_list.
2011 2017-01-18  Jason Merrill  <jason@redhat.com>
2013         PR c++/68666 - member variable template-id
2014         * typeck.c (finish_class_member_access_expr): Handle variable
2015         template-id.
2016         * pt.c (lookup_and_finish_template_variable): No longer static.
2017         * cp-tree.h: Declare it.
2019 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2021         PR c++/78488
2022         * call.c (build_over_call): When checking ellipsis conversions for
2023         an inherited ctor, make sure there is at least one conversion.
2025 2017-01-18  Jason Merrill  <jason@redhat.com>
2027         PR c++/78894 - ICE with class deduction and default arg
2028         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2030 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2032         PR c++/77489
2033         * mangle.c (write_discriminator): Reorganize abi warning check.
2035 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2037         * cp-tree.h: Clarify exception spec node comment.
2038         * except.c (nothrow_spec_p): Simplify by checking node-equality.
2040         PR c++/79091
2041         * mangle.c (write_exception_spec): Check nothrow explicitly.
2042         (write_encoding): Don't increment processing_template_decl around
2043         encoding.
2045 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2047         PR c++/70182
2048         * mangle.c (write_template_args): Add "on" for operator names.
2050 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2052         PR c++/77489
2053         * mangle.c (write_discriminator): Handle discriminator >= 10.
2055 2017-01-17  Nathan Sidwell  <nathan@acm.org>
2057         PR c++/61636
2058         * cp-tree.h (maybe_generic_this_capture): Declare.
2059         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2060         (maybe_resolve_dummy): ... here.  Call it.
2061         (maybe_generic_this_capture): New.
2062         * parser.c (cp_parser_postfix_expression): Speculatively capture
2063         this in generic lambda in unresolved member function call.
2064         * pt.c (tsubst_copy_and_build): Force hard error from failed
2065         member function lookup in generic lambda.
2067 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
2069         PR c++/70565
2070         * cp-array-notation.c (expand_array_notation_exprs): Handle
2071         OMP_PARALLEL.
2073 2017-01-11  Jason Merrill  <jason@redhat.com>
2075         PR c++/78337 - ICE on invalid with generic lambda
2076         * semantics.c (process_outer_var_ref): Check if containing_function
2077         is null.  Move inform call under complain test.
2079 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2081         PR c++/77812
2082         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2083         is a new overload.
2085 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2087         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2089 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
2091         PR c++/78341
2092         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2093         assertion.  Formatting fix.
2095         PR c++/72813
2096         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2097         writing PCH file.
2099 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
2101         PR c++/77949
2102         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2103         a missing semicolon if we have a valid insertion location for
2104         the fix-it hint.
2106 2017-01-10  Jason Merrill  <jason@redhat.com>
2108         FI 20, decomposition declaration with parenthesized initializer.
2109         * parser.c (cp_parser_decomposition_declaration): Use
2110         cp_parser_initializer.
2112 2017-01-09  Jason Merrill  <jason@redhat.com>
2114         Implement P0195R2, C++17 variadic using.
2115         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2116         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2117         * error.c (dump_decl): Likewise.
2119 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
2121         PR translation/79019
2122         PR translation/79020
2123         * semantics.c (finish_omp_clauses): Add missing whitespace to
2124         translatable strings.
2125         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2127 2017-01-07  Jason Merrill  <jason@redhat.com>
2129         PR c++/78948 - instantiation from discarded statement
2130         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2131         * cp-tree.h (in_discarded_stmt): Declare it.
2132         (struct saved_scope): Add discarded_stmt bitfield.
2133         (in_discarded_stmt): New macro.
2134         * decl2.c (mark_used): Check it.
2135         * parser.c (cp_parser_selection_statement): Adjust.
2136         (cp_parser_jump_statement): Adjust.
2138 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
2140         PR c++/78931
2141         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2142         REFERENCE_REF_P, set tt to its operand.
2144         PR c++/78890
2145         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2146         unions even for C++11 and later.
2148 2017-01-05  Nathan Sidwell  <nathan@acm.org>
2150         PR c++/78765
2151         * pt.c (convert_nontype_argument): Don't try and see if integral
2152         or enum expressions are constants prematurely.
2154 2017-01-04  Marek Polacek  <polacek@redhat.com>
2156         PR c++/64767
2157         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2158         a zero character literal.
2160 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
2162         PR c++/78949
2163         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2164         vector type.
2166         PR c++/78693
2167         * parser.c (cp_parser_simple_declaration): Only complain about
2168         inconsistent auto deduction if auto_result doesn't use auto.
2170         * parser.c (cp_parser_simple_declaration): Diagnose function
2171         declaration among more than one init-declarators with auto
2172         specifier.
2174         PR c++/71182
2175         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2176         assertion, as lexer->buffer may be NULL.
2178 2017-01-04  Marek Polacek  <polacek@redhat.com>
2180         PR c++/77545
2181         PR c++/77284
2182         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2184 2017-01-04  Nathan Sidwell  <nathan@acm.org>
2186         PR c++/66735
2187         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2188         (lambda_capture_field_type): Update prototype.
2189         * lambda.c (lambda_capture_field_type): Add is_reference parm.
2190         Add referenceness here.
2191         (add_capture): Adjust lambda_capture_field_type call, refactor
2192         error checking.
2193         * pt.c (tsubst): Adjust lambda_capture_field_type call.
2195 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
2197         Update copyright years.
2199 Copyright (C) 2017 Free Software Foundation, Inc.
2201 Copying and distribution of this file, with or without modification,
2202 are permitted in any medium without royalty provided the copyright
2203 notice and this notice are preserved.