C++ template type diff printing
[official-gcc.git] / gcc / cp / ChangeLog
blob2dac6109392d6c849ed9f8bf29af9081cf97ec90
1 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
3         * call.c (perform_implicit_conversion_flags): Convert
4         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
5         (print_conversion_rejection): Replace pairs of %qT with
6         %qH and %qI in various places.
7         (build_user_type_conversion_1): Likewise.
8         (build_integral_nontype_arg_conv): Likewise.
9         (build_conditional_expr_1): Likewise.
10         (convert_like_real): Likewise.
11         (convert_arg_to_ellipsis): Likewise.
12         (joust): Likewise.
13         (initialize_reference): Likewise.
14         * cvt.c (cp_convert_to_pointer): Likewise.
15         (cp_convert_to_pointer): Likewise.
16         (convert_to_reference): Likewise.
17         (ocp_convert): Likewise.
18         * error.c (cp_printer): Gain bool and const char ** parameters.
19         (struct deferred_printed_type): New struct.
20         (class cxx_format_postprocessor): New class.
21         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
22         to pp->m_format_postprocessor.
23         (comparable_template_types_p): New function.
24         (newline_and_indent): New function.
25         (arg_to_string): New function.
26         (print_nonequal_arg): New function.
27         (print_template_differences): New function.
28         (type_to_string_with_compare): New function.
29         (print_template_tree_comparison): New function.
30         (append_formatted_chunk): New function.
31         (add_quotes): New function.
32         (cxx_format_postprocessor::handle): New function.
33         (defer_phase_2_of_type_diff): New function.
34         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
35         %H and %I.
36         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
37         %qH and %qI in various places.
38         (convert_member_func_to_ptr): Likewise.
39         (build_reinterpret_cast_1): Likewise.
40         (convert_for_assignment): Likewise.
41         * typeck2.c (check_narrowing): Likewise.
43 2017-05-30  Nathan Sidwell  <nathan@acm.org>
45         Kill IDENTIFIER_NAMESPACE_BINDINGS
46         * cp-tree.h (lang_identifier): Delete namespace_bindings.
47         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
48         (lang_decl_ns): Add bindings.
49         (DECL_NAMESPACE_BINDINGS): New.
50         * lex.c (retrofit_lang_decl): Create namespace hash table.
51         * name-lookup.c (find_namespace_slot): Change to use hash-map.
52         * ptree.c (cxx_print_binding): Delete.
53         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
55         * cp-tree.def (OVERLOAD): Fix comment.
56         * cp-tree.h: Fix comments and whitespace.
57         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
58         * name-lookup.c (add_decl_to_level): Assert not class.
59         (check_local_shadow): Use OVL_P.
60         (pushdecl_with_scope_1): Rename to ...
61         (do_pushdecl_with_Scope): ... here.
62         (do_nonmember_using_decl): Use qualified_namespace_lookup return
63         value.
64         (push_class_level_binding_1): Use OVL_P.
65         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
66         (pushtag_1): Rename to ...
67         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
68         (pushtag): Adjust.
69         (store_class_bindings): Do not time here.
70         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
71         * pt.c (listify): Declare argvec at point of initialization.
73         PR c++/80913
74         * name-lookup.c (add_decl_to_level): Assert not making a circular
75         chain.
76         (update_binding): Don't prematurely slide artificial decl.
78 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
80         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
82 2017-05-29  Nathan Sidwell  <nathan@acm.org>
84         PR c++/80891 (#1,#5)
85         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
86         * name-lookup.c (name_lookup): Add deduping field.
87         (name_lookup::preserve_state, name_lookup::restore_state): Deal
88         with deduping.
89         (name_lookup::add_overload): New.
90         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
91         (name_lookup::search_adl): Set deduping.  Don't unmark here.
92         * pt.c (most_specialized_instantiation): Revert previous change,
93         Assert not given duplicates.
94         * tree.c (lookup_mark): Just mark the underlying decls.
95         (lookup_maybe_add): Dedup using marked decls.
97         PR c++/80891 (#4)
98         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
99         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
101         Stat hack representation
102         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
103         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
104         (stat_hack): New.
105         (find_namespace_binding): Replace with ...
106         (find_namespace_slot): ... this.
107         (find_namespace_value): New.
108         (name_lookup::search_namespace_only,
109         name_lookup::adl_namespace_only): Adjust.
110         (update_binding): Add SLOT parameter, adjust.
111         (check_local_shadow): Use find_namespace_value.
112         (set_local_extern_decl_linkage): Likewise.
113         (do_pushdecl): Adjust for namespace slot.
114         (push_local_binding): Assert not a namespace binding.
115         (check_for_out_of_scope_variable): Use find_namespace_value.
116         (set_identifier_type_value_with_scope): Likewise.
117         (get_namespace_binding): Likewise.
118         (set_namespace_binding): Delete.
119         (set_global_binding): Directly update the binding.
120         (finish_namespace_using_decl): Likewise.
121         (lookup_type_scope_1): Use find_namespace_slot and update.
122         (do_push_nested_namespace): Use find_namespace_value.
124         PR c++/80891 (#1)
125         * pt.c (most_specialized_instantiation): Cope with duplicate
126         instantiations.
128         PR c++/80891 (#3)
129         * cp-tree.h (build_min_nt_call_vec): Declare.
130         * decl.c (build_offset_ref_call_from_tree): Call it.
131         * parser.c (cp_parser_postfix_expression): Likewise.
132         * pt.c (tsubst_copy_and_build): Likewise.
133         * semantics.c (finish_call_expr): Likewise.
134         * tree.c (build_min_nt_loc): Keep unresolved lookups.
135         (build_min): Likewise.
136         (build_min_non_dep): Likewise.
137         (build_min_non_dep_call_vec): Likewise.
138         (build_min_nt_call_vec): New.
140         PR c++/80891 (#2)
141         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
142         (ovl_used): New.
143         (lookup_keep): Call it.
145 2017-05-26  Nathan Sidwell  <nathan@acm.org>
147         Implement DR2061
148         * name-lookup.c (push_inline_namespaces): New.
149         (push_namespace): Look inside inline namespaces.
151         Inline and using namespace representation change.
152         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
153         inlinees as vector.
154         (DECL_NAMESPACE_USING): Adjust.
155         (DECL_NAMESPACE_INLINEES): New.
156         * name-lookup.h (struct cp_binding_level): Change usings
157         representation.
158         * name-lookup.c (name_lookup::do_queue_usings,
159         name_lookup::queue_usings): Adjust.
160         (name_lookup::search_namespace, name_lookup::search_usings,
161         name_lookup::queue_namespace): Adjust.
162         (name_lookup::adl_namespace_only): Adjust.
163         (add_using_namespace, push_namespace): Push onto vector.
164         (pop_namespace): Add timing logic.
166         * call.c (build_operator_new_call): Do namelookup and ADL here.
167         (build_new_op_1): Likewise.
168         * name-lookup.h (lookup_function_nonclass): Delete declaration.
169         (do_using_directive): Likewise.
170         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
171         declare early.
172         (struct scope_binding): Delete.
173         (EMPTY_SCOPE_BINDING): Delete.
174         (set_decl_namespace): Use OVL_P.
175         (finish_local_using_decl): Lose unnecesary checks.
176         (lookup_function_nonclass): Delete.
177         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
179         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
180         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
181         unduplicatable.
182         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
183         (lkp_iterator): Add outer field.  Adjust ctor.
184         (lkp_iterator::operator++): New.
185         (lookup_mark, lookup_maybe_add): Declare.
186         * name-lookup.c (name_lookup): Delete fn_set member.
187         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
188         and mark lookup.
189         (name_lookup::add_value): Use lookup_add directly.
190         (name_lookup::add_fns: Use lookup_maybe_add.
191         (name_lookup::search_adl): Mark and unmark fns.
192         (pushdecl): Adjust.
193         * pt.c (check_explicit_specialization): Use lookup_add directly.
194         * ptree.c (cxx_print_xnode): Show complete overload structure.
195         * tree.c (lookup_mark, lookup_maybe_add): New.
197         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
199 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
201         * cp-tree.h (struct lang_decl_decomp): New type.
202         (struct lang_decl): Add u.decomp.
203         (LANG_DECL_DECOMP_CHECK): Define.
204         (DECL_DECOMPOSITION_P): Note it is set also on the vars
205         for user identifiers.
206         (DECL_DECOMP_BASE): Define.
207         (retrofit_lang_decl): Add extra int = 0 argument.
208         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
209         use it to influence the selector choices and for selector
210         0 to non-zero transition copy old content.
211         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
212         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
213         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
214         wording if decl is a structured binding.
215         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
216         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
217         of individual variables for tuple structured bindings.
218         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
219         Clear DECL_DECOMP_BASE.
220         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
221         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
222         is expected.
223         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
224         DECL_VALUE_EXPR.
226 2017-05-25  Jason Merrill  <jason@redhat.com>
228         PR c++/80605 - __is_standard_layout and zero-length array
229         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
231 2017-05-25  Nathan Sidwell  <nathan@acm.org>
233         Kill OVL_CURRENT, OVL_NEXT.
234         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
235         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
236         (consider_binding_level): Use OVL_FIRST.
237         (cp_emit_debug_info_for_using): Use lkp_iterator.
238         * pt.c (check_explicit_specialization): Use ovl_iterator.       
240         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
241         * cp-tree.h (lang_decl_ns): Remove ns_users field.
242         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
243         (TREE_INDIRECT_USING): Delete.
244         * name-lookup.h (is_associated_namespace): Delete.
245         * name-lookup.c (name_lookup::search_usings,
246         name_lookup::do_queue_usings): Usings are always direct.
247         (is_associated_namespace): Delete.
248         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
249         (namespace_ancestor_1, namespace_ancestor): Delete.
250         (push_using_directive_1, push_using_directive): Delete.
251         (add_using_namespace_1): Delete.
252         (add_using_namespace): Reimplement.
253         (emit_debug_info_using_namespace): New.
254         (finish_namespace_using_directive, finish_local_using_directive,
255         push_namespace): Adjust.
256         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
258 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
260         * semantics.c (finish_handler_parms): Warn about non-reference type
261         catch handlers.
263 2017-05-25  Nathan Sidwell  <nathan@acm.org>
265         Reimplement unqualified namespace lookup.
266         * name-lookup.c (name_lookup::using_pair,
267         name_lookup::using_queue): New typedefs.
268         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
269         name_lookup::queue_usings): New.
270         (name_lookup::search_unqualified): New.
271         (merge_functions, same_entity_p, ambiguous_decl,
272         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
273         lookup_using_namespace): Delete.
274         (lookup_name_real_1): Adjust.
276         Reimplement qualified namespace lookup.
277         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
278         (name_lookup::ambiguous, name_lookup::add_value,
279         name_lookup::add_type, name_lookup::process_binding): New.
280         (name_lookup::search_namespace_only,
281         name_lookup::search_namespace, name_lookup::search_usings): New.
282         (name_lookup::search_qualified): New.
283         (do_nonmember_using_decl, suggest_alternatives_for,
284         lookup_qualified_name): Adjust.
285         (tree_vec_contains): Delete.
286         (qualified_lookup_using_namespace): Rename to ...
287         (qualified_namespace_lookup): ... here.  Reimplement.
289         Reimplement ADL.
290         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
291         * name-lookup.h (lookup_arg_dependent): Return plain tree.
292         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
293         arg_assoc_args_vec, arg_assoc_type, add_function,
294         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
295         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
296         lookup_arg_dependent_1): Delete.
297         (name_lookup): New lookup object.
298         (name_lookup::preserve_state, name_lookup::restore_state,
299         name_lookup::mark_seen, name_lookup::find_and_mark,
300         name_lookup::add_fns, name_lookup::adl_namespace_only,
301         name_lookup::adl_namespace, name_lookup::adl_class_only,
302         name_lookup::adl_bases, name_lookup::adl_class,
303         name_lookup::adl_expr, name_lookup::adl_type,
304         name_lookup::adl_template_arg, name_lookup::search_adl): New.
305         (lookup_arg_dependent): Return a plain tree.  Adjust.
306         (is_associated_namespace): Move later.
307         
308 2017-05-24  Nathan Sidwell  <nathan@acm.org>
310         * friend.c (do_friend): Remove check for existing decl.
311         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
312         * name-lookup.c (push_local_binding): Directly look for binding.
313         (lookup_name_innermost_nonclass_level_1): Delete.
314         (lookup_name_innermost_nonclass_level): Delete.
316         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
318         * cp-tree.h (cp_free_lang_data): Add extern.
319         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
320         ATTRIBUTE_PURE.
321         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
322         * typeck.c (type_unknown_p): Delete.
323         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
324         overload management.
325         (dependent_name): Likewise.
326         (decl_anon_ns_mem_p): Simplify.
328 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
330         PR c++/80544
331         * tree.c (reshape_init): Use unqualified type for direct enum init.
332         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
333         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
334         non-class destination types.
335         (build_const_cast_1): Strip cv-quals from destination types.
336         (build_static_cast, build_reinterpret_cast, build_const_cast)
337         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
339 2017-05-24  Martin Sebor  <msebor@redhat.com>
341         PR c/80731
342         * call.c (fully_fold_internal): Adjust.
344 2017-05-24  Nathan Sidwell  <nathan@acm.org>
346         * cp-tree.h (ovl_skip_hidden): Declare.
347         * tree.c (ovl_skip_hidden): New.
348         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
349         (lookup_arg_dependent_1): Likewise.
350         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
351         (hidden_name_p, remove_hidden_names): Delete.
352         (lookup_name_real_1): Do not strip hidden names.
353         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
355         * cp-tree.h (OVL_HIDDEN_P): New.
356         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
357         (ovl_iterator::reveal_node): Declare.
358         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
359         (ovl_insert): Order on hiddenness.
360         (ovl_iterator::reveal_node): New.
361         * name-lookup.c (anticipated_builtin_p): New.
362         (supplement_binding_1): Use it.
363         (set_local_extern_decl_linkage): Use hidden_p.
364         (do_pushdecl): Deal with unhiding a hidden decl, use
365         anticipated_builtin_p.
366         (do_nonmember_using_decl): Use anticipated_decl_p.
367         (lookup_name_real_1): Use DECL_HIDDEN_P.
369 2017-05-23  Jason Merrill  <jason@redhat.com>
371         -Wunused and C++17 structured bindings
372         * decl.c (poplevel): Don't warn about unused structured bindings,
373         only real variables.
374         * error.c (dump_simple_decl): Handle structured bindings.
375         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
377 2017-05-23  Nathan Sidwell  <nathan@acm.org>
379         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
380         * name-lookup.c (create_local_binding): New.
381         (update_binding): New.
382         (pushdecl_maybe_friend_1): Rename to ...
383         (do_pushdecl): ... this.  Reimplement.
384         (pushdecl): Adjust.
385         (push_overloaded_decl_1, push_overloaded_decl): Delete.
387 2017-05-23  Jason Merrill  <jason@redhat.com>
389         PR c++/80396 - built-in for make_integer_sequence.
390         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
391         (expand_integer_pack, expand_builtin_pack_call): New.
392         (find_parameter_packs_r): Check builtin_pack_call_p.
393         (check_for_bare_parameter_packs): Handle it.
394         (tsubst_pack_expansion): Call expand_builtin_pack_call.
395         (declare_integer_pack): New.
396         (init_template_processing): Call it.
397         * decl2.c (mark_used): Check builtin_pack_fn_p.
399 2017-05-23  Nathan Sidwell  <nathan@acm.org>
401         * name-lookup.c (find_namespace_binding): New.
402         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
403         (set_identifier_type_value_with_scope): Use find_namespace_binding.
404         (find_binding, cp_binding_level_find_binding_for_name,
405         binding_for_name, namespace_binding_1): Delete.
406         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
407         (get_namespace_binding, set_namespace_binding,
408         finish_namespace_using_decl, unqualified_namespace_lookup_1,
409         qualified_lookup_using_namespace, lookup_type_scope_1,
410         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
412         PR c++/80866
413         * parser.c (cp_parser_template_id): Keep the lookup when stashing
414         the template_id.
416         * cp-tree.h (DECL_HIDDEN_P): New.
417         * name-lookup.c (set_decl_context,
418         set_local_extern_decl_linkage): New, broken out of ...
419         (pushdecl_maybe_friend_1): ... here.  Call them.
421 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
423         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
424         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
425         "VECTOR_LENGTH".
427 2017-05-23  Nathan Sidwell  <nathan@acm.org>
429         * cp-tree.h (OVL_P): New.
430         * name-lookup.h (push_local_binding): Delete.
431         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
432         (finish_namespace_using_decl, finish_local_using_decl): ... here
433         * name-lookup.c (add_decl_to_level): Swap args.
434         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
435         (diagnose_name_conflict): Check contexts are same for redecl.
436         (update_local_overload): New.
437         (compparms_for_decl_and_using): Rename to ...
438         (matching_fn_p): ... here.
439         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
440         push_local_bindings call.
441         (push_local_binding): Make static, replace FLAGS arg with
442         IS_USING.
443         (validate_nonmember_using_decl): Use OVL_FIRST.
444         (do_nonmember_using_decl): Use in/out parameters.  Use
445         lkp_iterator and simplify.
446         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
447         (finish_namespace_using_decl, finish_local_using_decl): ... here.
448         Adjust.
449         (lookup_type_current_level): Delete.
450         * parser.c (cp_parser_using_declaration): Adjust.
451         * pt.c (tsubst_expr): Adjust.
453 2017-05-22  Nathan Sidwell  <nathan@acm.org>
455         * name-lookup.h (parse_using_directive): Replace with ...
456         (finish_namespace_using_directive): ... this and ...
457         (finish_local_using_directive): ... this.
458         * name-lookup.c (add_using_namespace_1): Move later.
459         (add_using_namespace): Move later, add namespace_p arg, remove
460         indirect arg.
461         (push_using_directive_1): Directly recurse.
462         (do_using_directive, parse_using_directive): Delete, split into ...
463         (finish_namespace_using_directive): ... this and ...
464         (finish_local_using_directive): ... this.
465         (push_namespace): Use add_using_namespace.
466         * parser.c (cp_parser_using_directive): Call
467         finish_namespace_using_directive or finish_local_using_directive.
468         * pt.c (tsubst_expr): Call finish_local_using_directive.
470         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
471         * cp-tree.h (raw_dump_id): Declare.
472         * decl2.c (raw_dump_id): Define.
473         (dump_tu): Use raw_dump_id.
475         * config-lang.in (gtfiles): Sort list, break lines.
477         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
478         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
479         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
480         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
481         CPTI_RETHROW_FN): New.
482         (noexcept_deferred_spec): New.
483         (terminate_node, call_unexpected_node): Rename to ...
484         (terminate_fn, call_unexpected_fn): ... here.
485         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
486         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
487         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
488         (init_exception_processing): Adjust.
489         (declare_library_fn): Create and push the fns here.
490         (do_get_exception_ptr, do_begin_catch, do_end_catch,
491         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
492         declare_library_fn use.
493         (unevaluated_noexcept_spec): Adjust.
494         * cp-gimplify.c (genericize_eh_spec_block,
495         gimplify_most_not_throw_expr): Adjust.
497         * name-lookup.c (pushdecl_top_level,
498         pushdecl_top_level_and_finish): Move after namespace pushing and
499         popping functions.
500         (push_to_top_level): Rename to ...
501         (do_push_to_top_level): ... here.  Remove timing code.
502         (pop_from_top_level_1): Rename to ...
503         (do_pop_from_top_level): ... here.
504         (do_push_nested_namespace, do_pop_nested_namespace)
505         (push_to_top_level): New wrapper for do_push_to_top_level.
506         (pop_from_top_level): Adjust.
507         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
509 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
511         * config-lang.in (gtfiles): Add c-family/c-format.c,
512         except.c, init.c, lambda.c and friend.c.
513         * class.c (dvirt_fn): Move out of function scope,
514         add GTY attribute.
515         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
516         * init.c (fn): Likewise.
517         * lambda.c (ptr_id, max_id): Likewise.
518         * friend.c (global_friend): Add GTY attribute.
520 2017-05-19  Nathan Sidwell  <nathan@acm.org>
522         * call.c (add_list_candidates): Use OVL_FIRST.
523         (build_new_method_call_1): Likewise.
524         * cp-tree.h (OVL_SINGLE_P): New.
525         (TYPE_HIDDEN_P): New.
526         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
527         * dump.c (cp_tump_tree): Adjust overload dumping.
528         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
529         printing.
530         * method.c (lazily_declare_fn): Assert we added it.
531         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
532         OVL_FIRST.
533         (cp_parser_template_name): Use lkp_iterator.
534         * pt.c (begin_template_parm_list): Fixup comment.
535         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
536         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
537         (ovl_scope): Use lkp_iterator.
539 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
541         * parser.c (cp_parser_omp_clause_default): Handle
542         "OMP_CLAUSE_DEFAULT_PRESENT".
544         * parser.c (cp_parser_omp_clause_default): Avoid printing more
545         than one syntax error message.
547 2017-05-19  Nathan Sidwell  <nathan@acm.org>
549         * class.c (class_dump_id): Define.
550         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
551         * cp-objcp-common.c (cp_register_dumps): New.
552         * cp-objcp-common.h (cp_register_dumps): Declare.
553         (LANG_HOOKS_REGISTER_DUMPS): Override.
554         * cp-tree.h (class_dump_id): Declare.
556 2017-05-18  Nathan Sidwell  <nathan@acm.org>
558         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
559         (OVL_USED_P): New.
560         (lookup_keep): Declare.
561         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
562         * pt.c (tsubst_copy): Assert lookup is persistent.
563         * semantics.c (finish_call_expr): Use lkp_iterator, call
564         lookup_keep.
565         * tree.c (ovl_copy): New.
566         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
567         (lookup_keep): New.
569         * cp-tree.h (OVL_USED): Replace with ...
570         (OVL_USING_P): ... this.
571         (ovl_iterator::using_p): Adjust.
572         * name-lookup.c (push_overloaded_decl_1,
573         do_nonmember_using_decl): Adjust.
574         * search.c (lookup_field_r): Adjust.
575         * tree.c (ovl_insert, ovl_scope): Adjust.
577         * cp-tree.h (lookup_add): Swap args.
578         (ovl_cons, build_overload): Delete.
579         * name-lookup.c (add_function, push_overloaded_decl_1,
580         do_nonmember_using_decl, merge_functions, remove_hidden_names):
581         Use lookup_add, ovl_insert.
582         * pt.c (check_explicit_specialization): Use lookup_add.
583         (do_class_deduction): Likewise. Refactor if.
584         * tree.c (lookup_add): Swap args.
585         (ovl_cons, build_overload): Delete.
587         * name-lookup.c (find_local_binding): New, broken out of ...
588         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
589         (set_namespace_binding): Swap scope & name args.
590         (namespace_binding_1): Likewise.
591         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
592         (push_overloaded_decl_1): Likewise.
593         (set_global_binding): Likewise.
594         (get_namespace_binding): Adjust namespace_binding_1 call.
596 2017-05-17  Nathan Sidwell  <nathan@acm.org>
598         * cp-tree.h (default_hash_traits <lang_identifier *>): New
599         specialization.
600         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
601         (extern_c_fns): New hash table.
602         (check_extern_c_conflict): New, broken out of ...
603         (pushdecl_maybe_friend_1): ... here.  Call it.
604         (c_linkage_bindings): Just look in hash table.
606 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
608         PR c++/80654
609         PR c++/80682
610         Implement new C++ intrinsics __is_assignable and __is_constructible.
611         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
612         (is_xible): New.
613         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
614         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
615         * method.c (constructible_expr): Set cp_unevaluated.
616         (is_xible_helper): New.
617         (is_trivially_xible): Adjust.
618         (is_xible): New.
619         * parser.c (cp_parser_primary_expression): Handle
620         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
621         (cp_parser_trait_expr): Likewise.
622         * semantics.c (trait_expr_value): Handle
623         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
625 2017-05-17  Nathan Sidwell  <nathan@acm.org>
627         * cp-tree.h (ovl_iterator::using_p): New predicate.
628         (ovl_iterator::remove_node): New worker.
629         (ovl_insert): Declare.
630         * tree.c (ovl_insert): New.
631         (ovl_iterator::remove_node): New.
632         * class.c (add_method): Use ovl_iterator, ovl_insert.
633         (clone_function_decl): Fix description.
634         (clone_constructors_and_destructors): Use ovl_iterator.
636         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
637         (maybe_warn_about_overly_private_class): Use ovl_iterator.
638         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
639         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
640         (get_base_fndecls): Use ovl_iterator.
641         (warn_hidden): Use OVL_NAME, ovl_iterator.
642         (add_implicitly_declared_members): Use ovl_iterator.
643         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
644         flatten nested if.
645         (finish_shorthand_constraint): Simplify, use ovl_make.
646         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
647         * search.c (shared_member_p): Use ovl_iterator.
648         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
649         (lookup_conversion_operator): Use OVL_FIRST.
650         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
651         (look_for_overrides_here): Use ovl_iterator.
652         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
653         * typeck.c (build_x_unary_op): Use ovl_make.
655 2017-05-17  Martin Liska  <mliska@suse.cz>
657         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
658         use it instead of int type.
659         (dump_vtable): Likewise.
660         (dump_vtt): Likewise.
661         * decl2.c (dump_tu): Likewise.
663 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
665         * call.c (enforce_access): Add access_failure_info * param and use
666         it to record access failures.
667         * cp-tree.h (class access_failure_info): New class.
668         (enforce_access): Add access_failure_info * param, defaulting to
669         NULL.
670         (lookup_member): Likewise.
671         (locate_field_accessor): New function decl.
672         (perform_or_defer_access_check): Add access_failure_info * param,
673         defaulting to NULL.
674         * search.c (lookup_member): Add access_failure_info * param and
675         pass it on to call to perform_or_defer_access_check.
676         (matches_code_and_type_p): New function.
677         (field_access_p): New function.
678         (direct_accessor_p): New function.
679         (reference_accessor_p): New function.
680         (field_accessor_p): New function.
681         (struct locate_field_data): New struct.
682         (dfs_locate_field_accessor_pre): New function.
683         (locate_field_accessor): New function.
684         * semantics.c (perform_or_defer_access_check): Add
685         access_failure_info * param, and pass it on to call to
686         enforce_access.
687         * typeck.c (access_failure_info::record_access_failure): New method.
688         (access_failure_info::maybe_suggest_accessor): New method.
689         (finish_class_member_access_expr): Pass an access_failure_info
690         instance to the lookup_member call, and call its
691         maybe_suggest_accessor method afterwards.
693 2017-05-16  Marek Polacek  <polacek@redhat.com>
695         PR sanitizer/80536
696         PR sanitizer/80386
697         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
699 2017-05-16  Nathan Sidwell  <nathan@acm.org>
701         * name-lookup.c (check_local_shadow): New, broke out of ...
702         (pushdecl_maybe_friend_1): ... here.  Call it.
704         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
705         (ovl_first): Move inline definition to end of file.
706         (ovl_make, lookup_add): Declare.
707         (get_fns, get_first_fn): Make pure.
708         * tree.c (ovl_cache): New.
709         (ovl_make, lookup_add): New.
710         * pt.c (do_class_deduction): Don't add candidates that will be
711         elided.
713         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
714         (print_error_for_call_failure): Use OVL_NAME.
715         (build_op_call_1): Use ovl_iterator.
716         (add_candidates): Use OVL_FIRST & lkp_iterator.
717         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
718         lkp_iterator.
719         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
720         (type_has_user_nondefault_constructor,
721         in_class_defaulted_default_constructor,
722         type_has_user_provided_constructor,
723         type_has_user_provided_or_explicit_constructor,
724         type_has_non_user_provided_default_constructor,
725         vbase_has_user_provided_move_assign,
726         type_has_move_constructor, type_has_move_assign,
727         type_has_user_declared_move_constructor,
728         type_has_user_declared_move_assign,
729         type_build_ctor_call, type_build_dtor_call,
730         type_requires_array_cookie, explain_non_literal_class): Likewise.
731         (finish_struct): Use lkp_iterator.
732         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
733         (note_name_declared_in_class): Use OVL_NAME.
734         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
735         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
736         cxx_pretty_printer::expression): Likewise.
737         * decl2.c (check_classfn): Use ovl_iterator.
738         * pt.c (retrieve_specialization): Use ovl_iterator.
739         * tree.c (cp_tree_equal): Use lkp_iterator.
740         (type_has_nontrivial_copy_init): Use ovl_iterator.
742         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
743         check is_overloaded_fn.
745 2017-05-16  Martin Liska  <mliska@suse.cz>
747         * parser.c (cp_lexer_print_token): Add default value for flags
748         argument of print_gimple_stmt, print_gimple_expr,
749         print_generic_stmt and print_generic_expr.
751 2017-05-16  Nathan Sidwell  <nathan@acm.org>
753         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
754         iterators.
755         (MAYBE_BASELINK_FUNCTIONS): New.
756         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
757         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
758         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
759         * method.c (inherited_ctor_binfo): Use ovl_iterator.
760         (binfo_inherited_from): Likewise.
761         * parser.c (lookup_literal_operator): Use lkp_iterator.
762         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
763         (print_candidates_1): Likewise.
764         (determine_specialization): Likewise.
765         (resolve_overloaded_unification): Likewise.
766         (resolve_nondeduced_context): Likewise.
767         (type_dependent_expression_p): Likewise.
768         (dependent_template_p): Likewise.
769         * ptree.c (cxx_print_xnode): Likewise.
770         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
771         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
772         * typeck.c (check_template_keyword): Use lkp_iterator.
774         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
775         (ovl_first): New.
776         * constexpr.c (function_concept_check): Use OVL_FIRST.
777         * cvt.c (build_expr_type_conversion): Likewise.
778         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
779         * decl2.c (mark_used): Use OVL_FIRST.
780         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
781         (dump_expr, location_of): Use OVL_FIRST.
782         * friend.c (do_friend): Use OVL_NAME.
783         * init.c (build_offset_ref): Use OVL_FIRST.
784         * mangle.c (write_member_name): Likewise.
785         (write_expression): Use OVL_NAME.
786         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
787         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
788         * pt.c (check_explicit_specialization): Use OVL_FIRST.
789         (check_template_shadow): Likewise.
790         (tsubst_template_args): Use OVL_NAME.
791         (tsubst_baselink): Use OVL_FIRST.
792         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
793         * tree.c (get_first_fn): Use OVL_FIRST.
794         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
795         (cp_build_addr_expr_1): Use OVL_FIRST.
797         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
798         peeking.
799         * semantics.c (finish_id_expression): Directly init local var.
800         (finish_omp_reduction_clause): Use really_overloaded_fn.
801         * tree.c (get_fns): Document.  Assert we got an overload.
802         (get_first_fn) Document.
803         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
804         really_overloaded_fn.
805         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
807         * cp-tree.h (SCOPE_DEPTH): New.
808         * name-lookup.h (is_nested_namespace): Declare.
809         * name-lookup.c (is_nested_namespace): New.
810         (is_ancestor): Use it.
811         (set_decl_namespace): Likewise.
812         (push_namespace): Set SCOPE_DEPTH.
813         * pt.c (check_specialization_namespace): Use is_nested_namespace.
814         (check_unqualigied_spec_or_inst): Likewise.
816 2017-05-15  Nathan Sidwell  <nathan@acm.org>
818         PR c++/79369
819         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
820         * name-lookup.h (push_namespace): Return int, add make_inline arg.
821         * name-lookup.c (push_namespace): Deal with inline directly.
822         Return pushed count.
823         * parser.c (cp_parser_namespace_definition): Adjust for
824         push_namespace change.
826 2017-05-11  Nathan Sidwell  <nathan@acm.org>
828         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
829         LANG_HOOKS_PUSHDECL): Move to ...
830         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
831         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
832         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
834         * name-lookup.h (pushdecl): Add default friend parm.
835         (pushdecl_maybe_friend): Delete.
836         (pushdecl_top_level): Add default friend parm.
837         (pushdecl_top_level_maybe_friend): Delete.
838         * name-lookup.c (pushdecl_maybe_friend): Delete.
839         (pushdecl): Add is_friend parm.
840         (pushdecl_top_level): Add is friend_parm.
841         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
842         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
843         * friend.c (do_friend): Adjust.
844         * pt.c (tsubst_friend_class): Adjust.
846         Revert pushdecl_top_level_and_finish name change.
847         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
848         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
849         * decl.c (cp_make_fname_decl): Adjust.
850         * decl2.c (get_guard, handle_tls_init):  Adjust.
851         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
853         * name-lookup.c (pushdecl_outermost_localscope): Always
854         conditionally stop timer.
856         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
857         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
859         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
860         pushtag_top_level_maybe_friend,
861         pushdecl_top_level_and_finish): Move declarations to ...
862         * name-lookup.h: ... here.  Group pushdecl variants.
863         (pushdecl_top_level_and_finish): Rename to ...
864         (pushdecl_top_level_with_init): ... here.
865         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
866         * decl2.c (get_guard, handle_tls_init): Likewise.
867         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
868         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
869         * method.c (implicitly_declare_fn): Likewise.
870         * searchc (node_debug_info_needed): Likewise.
871         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
872         (pushdecl_top_level_with_init): ... here.
873         (pop_everything): Use namespace_bindings_p.
875         * name-lookup.h (pop_binding): Rename to pop_local_binding.
876         (getdecls): Rename to get_local_decls.
877         * name-lookup.c (pop_binding): Rename to ...
878         (pop_local_binding): ... here.
879         (pop_bindings_and_leave_scope): Adjust.
880         (getdecls): Rename to ...
881         (get_local_decls): ... here.  Assert local scope.
882         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
883         logic.
884         (store_parm_decls): Adjust get_local_decls call.
885         (parser.c (synthesize_implicit_template_parm): Likewise.
887 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
889         PR c++/80682
890         * method.c (is_trivially_xible): Reject void types.
892 2017-05-10  Nathan Sidwell  <nathan@acm.org>
894         * class.c (handle_using_decl): Always use OVL_CURRENT.
895         (resolve_address_of_overloaded_function): Move iterator decl into
896         for scope.  Don't strip anticipated decls here.
898         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
899         printing.
900         (print_candidates): Adjust.
902         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
903         line breaking.
904         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
905         koenig_p handling here.
906         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
907         (tsubst_omp_clauses): Likewise.
908         (do_class_deduction): Adjust buld_new_function_call calls.
909         * semantics.c (finish_call_expr): Likewise.
911 2017-05-10  Jason Merrill  <jason@redhat.com>
913         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
914         (unify_type_mismatch, unify_parameter_pack_mismatch)
915         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
916         (unify_parameter_pack_inconsistent, unify_inconsistency)
917         (unify_vla_arg, unify_method_type_error, unify_arity)
918         (unify_arg_conversion, unify_no_common_base)
919         (unify_inconsistent_template_template_parameters)
920         (unify_template_deduction_failure)
921         (unify_template_argument_mismatch)
922         (unify_overload_resolution_failure): Call unify_invalid.
924         CWG 1847 - Clarifying compatibility during partial ordering
925         * pt.c (more_specialized_fn): No order between two non-deducible
926         parameters.
928         * pt.c (dependent_type_p): Make sure we aren't called with
929         global_type_node.
931         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
932         * pt.c (convert_template_argument): Just return an argument pack.
933         (coerce_template_parameter_pack, template_parm_to_arg)
934         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
935         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
936         Don't set the type of a NONTYPE_ARGUMENT_PACK.
937         * parser.c (make_char_string_pack, make_string_pack): Likewise.
939 2017-05-10  Nathan Sidwell  <nathan@acm.org>
941         * cp-tree.h (add_method, clone_function_decl): Change last arg to
942         bool.
943         * class.c (add_method): Change third arg to bool.  Adjust.
944         (one_inheriting_sig, one_inherited_ctor): Adjust.
945         (clone_function_decl): Change 2nd arg to bool.  Adjust.
946         (clone_constructors_and_destructors): Adjust.
947         * lambda.c (maybe_add_lambda_conv_op): Adjust.
948         * method.c (lazily_declare_fn): Adjust.
949         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
950         * semantics.c (finish_member_declaration): Adjust.
952 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
954         PR c++/80145
955         * decl.c (finish_function): To improve error recovery, change the
956         logic for calling apply_deduced_return_type.
958 2017-05-09  Jason Merrill  <jason@redhat.com>
960         PR c++/80605 - __is_standard_layout and empty base
961         * class.c (check_bases): Ignore empty bases.
963         PR c++/70979 - literal class and closure types
964         * class.c (finalize_literal_type_property): Handle closures
965         specifically.
966         (explain_non_literal_class): Likewise.
968         PR c++/66297, DR 1684 - literal class and constexpr member fns
969         * constexpr.c (is_valid_constexpr_fn): Only complain about
970         non-literal enclosing class in C++11.
971         * class.c (finalize_literal_type_property): Likewise.
973 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
975         PR c++/80186
976         * pt.c (tsubst_decl): Early return error_mark_node if
977         grok_ctor_properties returns false.
979 2017-05-09  Jason Merrill  <jason@redhat.com>
981         PR c++/70167 - array prvalue treated as lvalue
982         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
983         (enum fcl_t): New.
984         * semantics.c (finish_compound_literal): Add fcl_context parameter.
985         Only make a static variable for C99 syntax.
986         * parser.c (cp_parser_postfix_expression): Pass it.
987         * pt.c (tsubst_copy_and_build): Likewise.
988         * call.c (extend_ref_init_temps): Set
989         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
991 2017-05-09  Nathan Sidwell  <nathan@acm.org>
993         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
994         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
995         * name-lookup.h (pushdecl_top_level): Declare.
997 2017-05-08  Jason Merrill  <jason@redhat.com>
999         PR c++/80178 - parameter passing for uncopyable classes
1000         * tree.c (type_has_nontrivial_copy_init): True for classes with only
1001         deleted copy/move ctors.
1002         (remember_deleted_copy, maybe_warn_parm_abi): New.
1003         * decl.c (require_complete_types_for_parms, check_function_type):
1004         Call maybe_warn_parm_abi.
1005         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1007 2017-05-08  Nathan Sidwell  <nathan@acm.org>
1009         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1010         (start_preparsed_function): Do decl pushing before setting
1011         current_funciton_decl and announcing it.
1013         * name-lookup.h (pushdecl_with_scope): Replace with ...
1014         (pushdecl_outermost_localscope): ... this.
1015         * name-lookup.c (pushdecl_with_scope): Replace with ...
1016         (pushdecl_outermost_localscope): ... this.
1017         (pushdecl_namespace_level): Adjust.
1018         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1019         * lambda.c (insert_capture_proxy): Likewise.
1021         * class.c (build_vtbl_initializer): Don't shadow outer variable
1022         with static var.
1024         Revert _binding -> _value change.
1025         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1026         (get_namespace_binding, set_global_binding): ... these.
1027         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1028         (get_namespace_binding, set_global_binding): ... these.
1029         (arg_assoc_namespace, pushdecl_maybe_friend_1,
1030         check_for_out_of_scope_variable, push_overloaded_decl_1,
1031         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1032         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1033         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1034         * decl.c (poplevel): Adjust.
1035         * pt.c (make_constrained_auto): Likewise.
1037 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
1039         PR translation/80280
1040         * call.c (print_z_candidate): Fix quoting.
1042 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
1044         * error.c (pedwarn_cxx98): Replace report_diagnostic
1045         with diagnostic_report_diagnostic.
1047 2017-05-05  Nathan Sidwell  <nathan@acm.org>
1049         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1050         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1051         (IDENTIFIER_NAMESPACE_VALUE): Delete.
1052         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1053         with ...
1054         (get_namespace_value, set_global_value): ... these.
1055         (get_global_value_if_present, is_typename_at_global_scope): Delete.
1056         * decl.c (poplevel): Use get_namespace_value.
1057         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1058         * class.c (build_vtbl_initializer): Stash library decl in
1059         static var. Use IDENTIFIER_GLOBAL_VALUE.
1060         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1061         do_allocate_exception, do_free_exception, build_throw): Likewise.
1062         * init.c (throw_bad_array_new_length): Likewise.
1063         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1064         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1065         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1066         get_namespace_value.
1067         (set_namespace_binding_1): Rename to
1068         (set_namespace_binding): ... here.
1069         (set_global_value): New.
1070         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1071         get_namespace_value.
1072         * pt.c (listify): Use get_namespace_value.
1074         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1075         current scope.
1076         * lex.c (unqualified_name_lookup_error): Likewise.
1078         * class.c (alter_class): Use retrofit_lang_decl directly.
1079         * decl.c (push_local_name, dupliate_decls): Likewise.
1080         * semantics.c (omp_privatize_field): Likewise.
1082         Kill walk_namespaces.
1083         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1084         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1086         Kill per-namespace static_decls.
1087         * cp-tree.h (static_decls): Declare.
1088         (wrapup_globals_for_namespace,
1089         diagnose_inline_vars_for_namespace): Replace with ...
1090         (wrapup_namespace_globals): ... this.
1091         * decl.c (static_decls): Define.
1092         (wrapup_globals_for_namespace,
1093         diagnose_inline_vars_for_namespace): Replace with ...
1094         (wrapup_namespace_globals): ... this.
1095         (cxx_init_decl_processing): Initialize static_decls.
1096         * decl2.c (c_parse_final_cleanups): Adjust.
1097         * name-lookup.h (cp_binding_level): Remove static_decls member.
1098         * name-lookup.c (add_decl_to_level): Adjust.
1099         (begin_scope): Adjust.
1101 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
1103         PR c++/71577
1104         * decl.c (reshape_init): Unconditionally return error_mark_node
1105         upon error about too many initializers.
1107 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1109         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1111 2017-05-04  Martin Sebor  <msebor@redhat.com>
1113         PR translation/80280
1114         * call.c (print_z_candidate): Add missing quoting to %D and other
1115         like directives.
1116         (build_op_call_1): Same.
1117         * constraint.cc (diagnose_check_constraint): Same.
1118         * mangle.c (mangle_decl): Same.
1119         * name-lookup.c (cp_binding_level_debug): Same.
1120         (set_decl_namespace): Same.
1121         * parser.c (cp_parser_tx_qualifier_opt): Same.
1122         * pt.c (print_candidates_1): Same.
1123         (check_template_variable): Same.
1124         (tsubst_default_argument): Same.
1125         (most_specialized_partial_spec): Same.
1126         * semantics.c (omp_reduction_lookup): Same.
1127         * tree.c (check_abi_tag_redeclaration): Same.
1128         * typeck.c (comptypes): Same.
1129         * typeck2.c (abstract_virtuals_error_sfinae): Same.
1131 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1133         More global trees.
1134         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1135         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1136         CPTI_INIT_LIST_IDENTIFIER.
1137         (global_namespace, global_type_node, global_identifier,
1138         anon_identifier, init_list_identifier): New.
1139         * decl.c (global_type_node, global_scope_name): Delete.
1140         (initialize_predefined_identifiers): Add new identifiers.
1141         (cxx_init_decl_processing): Adjust.
1142         * name-lookup.h (global_namespace, global_type_node): Delete.
1143         * name-lookup.c (global_namespace, anonymous_namespace_name,
1144         get_anonymous_namespace_name): Delete.
1145         (namespace_scope_ht_size, begin_scope, pushtag_1,
1146         push_namespace): Adjust,
1147         * call.c (type_has_extended_temps): Use init_list_identifier.
1148         * pt.c (listify): Likewise.
1150         * name-lookup.c: Reorder functions to make merging from modules
1151         branch simpler.
1153 2017-05-03  Jason Merrill  <jason@redhat.com>
1155         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1157 2017-05-03  Nathan Sidwell  <nathan@acm.org>
1159         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1160         along with #defines, to before name-lookup include.
1162 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
1164         * pt.c (is_auto_or_concept): Remove.
1165         (type_uses_auto_or_concept): Remove, unused.
1166         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1167         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1168         * cp-tree.h (is_auto_or_concept): Remove.
1170 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
1172         PR c++/80038
1173         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1174         add pedigree operation and detach call here.
1175         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1176         cilk_cp_gimplify_call_params_in_spawned_fn.
1177         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1178         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1180 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
1182         * parser.c (cp_parser_member_declaration): Add fix-it hints for
1183         stray comma and missing semicolon at end of member declaration.
1185 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
1187         * parser.c (cp_parser_cast_expression): Add target type of cast to
1188         diagnostic.
1189         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1191 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1193         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1194         return type to bool.
1195         * cp-tree.h (grok_ctor_properties): Update.
1197 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
1199         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1200         information to diagnostic of invalid colon in nested-name-specifier.
1202 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
1204         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1205         diagnostic of invalid class/struct keyword after enum.
1207 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1209         * parser.c (cp_parser_member_declaration): Add fix-it hint
1210         for removing stray semicolons.
1212 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1214         * name-lookup.c (get_std_name_hint): New function.
1215         (maybe_suggest_missing_header): New function.
1216         (suggest_alternative_in_explicit_scope): Call
1217         maybe_suggest_missing_header.
1219 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1221         PR c++/80177
1222         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1223         candidate type of bm from tree to const char *.
1224         (consider_binding_level): Likewise.
1225         (lookup_name_fuzzy): Likewise, using this to merge the best
1226         result from the preprocessor into bm, rather than immediately
1227         returning, so that better matches from reserved words can "win".
1228         Guard the rejection of keywords that don't start decl-specifiers
1229         so it only happens for FUZZY_LOOKUP_TYPENAME.
1231 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
1233         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1234         (start_enum): Likewise.
1235         (build_enumerator): Likewise. Use %qE instead of plain %E.
1236         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1237         %<%D%> in diagnostics.
1238         (cp_parser_elaborated_type_specifier): Likewise.
1239         * pt.c (make_pack_expansion): Use %qT and %qE instead of
1240         %<%T%> and %<%E%> in diagnostics.
1241         (tsubst_pack_expansion): Likewise.
1243 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
1245         PR c++/80016
1246         * parser.c (cp_parser_unary_expression):  Generate a location
1247         range for alignof and sizeof expressions.
1249 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
1251         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1252         error message.
1253         (cp_parser_virt_specifier_seq_opt): Likewise.
1254         (set_and_check_decl_spec_loc): Likewise twice.
1256 2017-04-21  Jason Merrill  <jason@redhat.com>
1258         PR c++/80179 - ICE with initialized flexible array member.
1259         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1261 2017-04-21  Richard Biener  <rguenther@suse.de>
1263         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1264         (copy_type): Likewise.
1265         * lex.c (copy_decl): Pass down mem-stat info.
1266         (copy_type): Likewise.
1268 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
1270         PR c++/80473
1271         * init.c (build_new_1): Suppress notes about over-aligned new when
1272         the warning is suppressed.
1274 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
1276         * parser.c (cp_parser_member_declaration): Add warning with fixit
1277         information for extra semicolon after in-class function definition.
1279 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
1281         PR middle-end/80423
1282         * tree.c (build_cplus_array_type): Call build_array_type
1283         with the intended TYPE_TYPELESS_STORAGE flag value, instead
1284         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1285         on the shared type.
1287 2017-04-18  Marek Polacek  <polacek@redhat.com>
1289         PR c++/80244 - ICE with attribute in template alias.
1290         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1292         PR c++/80241 - ICE with alignas pack expansion.
1293         * error.c (dump_expr): Handle TREE_LIST.
1294         * parser.c (cp_parser_std_attribute_list): Return error_mark if
1295         make_pack_expansion returns an error.
1297 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1299         PR c++/80287
1300         * class.c (fixup_may_alias): Fix all type variants.
1302 2017-04-17  Jason Merrill  <jason@redhat.com>
1304         PR c++/80415 - wrong error with default arg and array reference.
1305         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1307         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1309 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
1311         * decl.c (name_unnamed_type): Split out of...
1312         (grokdeclarator): ... this.
1313         * decl.h (name_unnamed_type): Declare.
1315 2017-04-12  Richard Biener  <rguenther@suse.de>
1316         Bernd Edlinger  <bernd.edlinger@hotmail.de>
1318         PR middle-end/79671
1319         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1320         for arrays of character or std::byte type.
1322 2017-04-11  Jason Merrill  <jason@redhat.com>
1324         PR c++/80294 - ICE with constexpr and inheritance.
1325         * constexpr.c (reduced_constant_expression_p):
1326         A null constructor element is non-constant.
1327         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1328         returning an empty base.
1330 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
1332         PR c++/80370
1333         * decl.c (cp_finish_decomp): If processing_template_decl on
1334         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1335         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
1336         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1337         processing.
1338         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1339         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1340         dependent.
1342 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
1344         PR c++/80363
1345         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1347 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
1349         PR c++/80176
1350         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1351         operand, if it is a static member function, recurse on the
1352         BASELINK.
1354 2017-04-10  Marek Polacek  <polacek@redhat.com>
1356         PR sanitizer/80348
1357         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
1358         ORIG_TYPE earlier and not only when shortening.
1360 2017-04-07  Jason Merrill  <jason@redhat.com>
1362         PR c++/80356 - ICE with reference to function template argument.
1363         PR c++/79294
1364         * pt.c (convert_nontype_argument_function): Adjust type even with a
1365         value-dependent argument.
1367         PR c++/80267 - ICE with nested capture of reference
1368         PR c++/60992
1369         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1371 2017-04-07  Marek Polacek  <polacek@redhat.com>
1373         PR sanitizer/80348
1374         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1376         PR c++/80095
1377         * call.c (build_over_call): Don't check cxx_dialect.
1378         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1379         whether SUB is a CONSTRUCTOR.
1380         * init.c (build_new_1): Don't check cxx_dialect.
1381         * tree.c (replace_placeholders): Add a function comment.  Return if
1382         not in C++14, or if the object isn't a (member of a) class.
1383         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1384         TYPE is CLASS_TYPE_P.
1386 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
1388         PR c++/80309
1389         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1390         of a loop doing vec_safe_push of NULL.  Formatting fixes.
1391         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1392         to newidx before calling canonical_type_parameter on newtype.
1394 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
1396         PR c++/80296
1397         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1398         UNARY_PLUS_EXPR case.
1400 2017-04-03  Jason Merrill  <jason@redhat.com>
1402         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1404 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
1406         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1407         * decl2.c (one_static_initialization_or_destruction): Likewise.
1408         * name-lookup.c (store_bindings): Likewise.
1409         * parser.c (make_call_declarator): Likewise.
1410         * pt.c (check_explicit_specialization): Likewise.
1412 2017-04-03  Jason Merrill  <jason@redhat.com>
1414         PR sanitizer/79993 - ICE with VLA initialization from string
1415         PR c++/69487 - wrong VLA initialization from string
1416         * init.c (finish_length_check): Split out from build_vec_init.
1417         (build_vec_init): Handle STRING_CST.
1418         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1419         (digest_init_r): Don't give a STRING_CST VLA type.
1421 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
1423         PR c++/79572
1424         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1425         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
1426         for NOP_EXPR to REFERENCE_TYPE.
1428         PR libstdc++/80251
1429         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1430         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1431         CPTK_IS_AGGREGATE.
1432         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1433         Remove extraneous parens.
1434         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1435         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1436         (cp_parser_trait_expr): Likewise.
1438 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
1440         PR middle-end/80162
1441         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1442         * typeck.c (cxx_mark_addressable): Likewise.  Look through
1443         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1444         to ARRAY_TYPE.
1445         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1447 2017-03-24  Jason Merrill  <jason@redhat.com>
1449         PR c++/77339 - ICE with invalid use of alias template.
1450         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1451         alias template.
1453 2017-03-24  Marek Polacek  <polacek@redhat.com>
1455         PR c++/80119
1456         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1457         doesn't have side effects.
1459 2017-03-23  Jason Merrill  <jason@redhat.com>
1461         PR c++/80150 - ICE with overloaded variadic deduction.
1462         * pt.c (try_one_overload): Remove asserts.
1464         PR c++/77563 - missing ambiguous conversion error.
1465         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1467 2017-03-23  Marek Polacek  <polacek@redhat.com>
1469         * cp-tree.h: Remove a C_RID_YYCODE reference.
1471 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
1473         PR c++/80141
1474         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1475         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1476         processing_template_decl.
1478 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
1480         PR c++/77752
1481         * name-lookup.c (pushtag_1): Add check for bogus, non template,
1482         std::initializer_list.
1484 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
1486         PR c++/35878
1487         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1489 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
1491         PR c++/35878
1492         * init.c (std_placement_new_fn_p): New.
1493         (build_new_1): Call it.
1495 2017-03-20  Jason Merrill  <jason@redhat.com>
1497         PR c++/80096 - ICE with C++17 non-type auto.
1498         * pt.c (tsubst): Delay tsubst of type of template non-type
1499         parameter.
1501         PR c++/79519 - ICE with deleted template friend.
1502         * decl.c (grokdeclarator): Complain about misplaced function
1503         definition using =, as well.
1505         PR c++/79640 - infinite recursion with generic lambda.
1506         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1507         before substituting its initializer.
1509 2017-03-20  Marek Polacek  <polacek@redhat.com>
1510             Paolo Carlini  <paolo.carlini@oracle.com>
1512         PR c++/80059 - ICE with noexcept and __transaction_atomic
1513         * except.c (build_must_not_throw_expr): Call
1514         instantiate_non_dependent_expr.
1516 2017-03-19  Jason Merrill  <jason@redhat.com>
1518         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1519         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1520         reference decomposition.
1522         PR c++/80077 - error with constexpr and -fno-elide-constructors.
1523         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1524         expanding trivial constructor.
1526 2017-03-17  Jason Merrill  <jason@redhat.com>
1528         PR c++/78345 - ICE initializing array from lambda.
1529         * init.c (build_aggr_init): Check array initializer.
1530         (build_vec_init): Check the type of a CONSTRUCTOR.
1532         PR c++/80073 - C++17 ICE with virtual base.
1533         * decl.c (xref_basetypes): Also check for indirect vbases.
1535 2017-03-16  Jason Merrill  <jason@redhat.com>
1537         * decl.c (start_enum): std::byte aliases anything.
1539         PR c++/79797
1540         * constexpr.c (lookup_placeholder): Tweak.
1542 2017-03-15  Jason Merrill  <jason@redhat.com>
1544         PR c++/80043 - ICE with -fpermissive
1545         * typeck.c (convert_for_assignment): Handle instantiate_type
1546         not giving an error.
1548 2017-03-14  Nathan Sidwell  <nathan@acm.org>
1550         PR c++/79393 DR 1658 workaround
1551         * method.c (synthesized_method_base_walk): Inihibit abstract class
1552         virtual base access check here.
1553         (synthesized_method_walk): Not here.
1555 2017-03-13  Nathan Sidwell  <nathan@acm.org>
1557         PR c++/79393 DR 1658 workaround
1558         * method.c (synthesized_method_walk): Check vbases of abstract
1559         classes for dtor walk.
1561 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
1563         PR translation/79848
1564         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1566 2017-03-10  Jason Merrill  <jason@redhat.com>
1568         PR c++/79960 - alias templates and partial ordering
1569         * pt.c (comp_template_args): Add partial_order parm.
1570         (template_args_equal): Likewise.
1571         (comp_template_args_porder): New.
1572         (get_partial_spec_bindings): Use it.
1574 2017-03-10  Marek Polacek  <polacek@redhat.com>
1576         PR c++/79967
1577         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1579 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
1581         PR c++/79899
1582         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1583         Use XALLOCAVEC macro.
1585         PR c++/79896
1586         * decl.c (finish_enum_value_list): If value is error_mark_node,
1587         don't copy it and change its type.
1588         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1589         of CONST_DECL is error_mark_node.
1591 2017-03-09  Marek Polacek  <polacek@redhat.com>
1593         PR c++/79900 - ICE in strip_typedefs
1594         * tree.c (strip_typedefs): Skip the attribute handling if T is
1595         a variant type which hasn't been updated yet.
1597         PR c++/79687 - wrong code with pointer-to-member
1598         * init.c (constant_value_1): Break if the variable has a dynamic
1599         initializer.
1601 2017-03-08  Jason Merrill  <jason@redhat.com>
1603         PR c++/79797 - ICE with self-reference in array DMI.
1604         * constexpr.c (lookup_placeholder): Split out...
1605         (cxx_eval_constant_expression): ...from here.
1607 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
1609         PR c/79834
1610         * parser.c (cp_parser_omp_cancellation_point,
1611         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1612         cp_parser_omp_target_update): Change "may only be used in compound
1613         statements" diagnostics, such that the same translatable string is
1614         used for all pragmas.
1615         (cp_parser_pragma): Likewise.  Use error_at instead of
1616         cp_parser_error for that diagnostics.
1618 2017-03-06  Marek Polacek  <polacek@redhat.com>
1620         PR c++/79796 - ICE with NSDMI and this pointer
1621         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1622         replace_placeholders.
1624 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
1626         PR c++/79822
1627         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1628         ({ (void) 0; }).
1630 2017-03-06  Jason Merrill  <jason@redhat.com>
1632         Revert "Allow deduction guides to look into primary template."
1633         * cp-tree.h, parser.c, pt.c, search.c: Revert.
1635 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
1637         PR c++/70266
1638         * except.c (build_must_not_throw_expr): Perform the implicit
1639         conversions on the condition.
1641 2017-03-03  Jason Merrill  <jason@redhat.com>
1643         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1644         -Wc++1z-compat.
1646         Core issues 2273 and 2277
1647         * call.c (joust): Adjust using-declaration tiebreaker to handle
1648         the intermediate base case.
1649         * method.c (strip_inheriting_ctors): Just return the argument if
1650         !flag_new_inheriting_ctors.
1652 2017-03-03  Richard Biener  <rguenther@suse.de>
1654         PR c++/79825
1655         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1657 2017-03-03  Marek Polacek  <polacek@redhat.com>
1659         PR c++/79791
1660         * typeck.c (string_conv_p): In C++11, always call pedwarn with
1661         OPT_Wwrite_strings.
1663 2017-03-02  Jason Merrill  <jason@redhat.com>
1665         Update overload resolution with deduction guides.
1666         * pt.c (do_class_deduction): Always build the copy guide.
1667         (copy_guide_p, template_guide_p): New.
1668         (build_deduction_guide): Remember the original constructor.
1669         * call.c (joust): Prefer the copy guide and non-template guides.
1671         Allow deduction guides to look into primary template.
1672         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1673         (struct cp_decl_specifier_seq): Add constructor_p.
1674         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1675         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
1676         Clear deduction_guide_type.  Don't handle deduction guide names.
1677         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1678         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
1679         (cp_parser_member_declaration, cp_parser_cache_defarg)
1680         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1681         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1682         (build_deduction_guide): Set deduction_guide_type.
1683         (dependent_scope_p): Check deduction_guide_type.
1684         * search.c (lookup_member): Likewise.
1686 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
1688         PR c++/79782
1689         * init.c (mark_exp_read_r): New function.
1690         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1691         whole arguments instead of plain mark_exp_read on TREE_LIST values.
1693 2017-03-01  Jason Merrill  <jason@redhat.com>
1695         Class template argument deduction in new-expression
1696         * init.c (build_new): Handle deduction from no initializer.
1697         * parser.c (cp_parser_new_expression): Don't require a single
1698         expression for class template deduction.
1699         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1700         class template placeholder.
1701         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1702         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1703         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1705 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
1707         PR c++/79746
1708         * init.c (emit_mem_initializers): When not constructing vbases of
1709         abstract classes, mark arguments as read for
1710         -Wunused-but-set-parameter.
1712 2017-02-28  Jason Merrill  <jason@redhat.com>
1714         Class template argument deduction refinements
1715         * call.c (joust): Move deduction guide tiebreaker down.
1716         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1717         deduction with no initializer.
1718         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1719         (do_class_deduction): Use that rather than special case.
1720         (do_auto_deduction): Handle null initializer.
1722 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
1724         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1725         instead of just cond ? "..." : "...".
1726         (grokdeclarator): Likewise.
1727         (build_enumerator): Likewise.
1728         * init.c (build_new_1): Likewise.
1729         * call.c (build_new_method_call_1): Likewise.
1730         * parser.c: Include intl.h.
1731         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1732         "enter"/"exit" keyword.
1733         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1734         message.
1736 2017-02-27  Jason Merrill  <jason@redhat.com>
1738         PR c++/71568 - SFINAE forming pointer to member function
1739         * init.c (build_offset_ref): Check the return value of
1740         perform_or_defer_access_check.
1742 2017-02-27  Marek Polacek  <polacek@redhat.com>
1744         * decl.c (expand_static_init): Add missing } in a comment.
1746 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
1748         * init.c: Include intl.h.
1749         (build_new_1): Move message strings into pedwarn to make them
1750         -Wformat-security friendly. Mark string for translation.
1751         * pt.c (tsubst_copy_and_build): Mark string for translation.
1752         Make the pointer const.
1753         * semantics.c (finish_id_expression): Mark strings for translation.
1755 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
1757         * call.c (build_op_delete_call): Make msg1 and msg2 const.
1759 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
1761         PR c++/79588
1762         * call.c (build_over_call): Call check_function_arguments even for
1763         -Wrestrict, adjust check_function_arguments caller.
1764         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1765         here.
1766         * typeck.c (cp_build_function_call_vec): Adjust
1767         check_function_arguments caller.
1769 2017-02-24  Marek Polacek  <polacek@redhat.com>
1771         PR translation/79705
1772         * decl.c (check_redeclaration_exception_specification): Mark a string
1773         for translation.  Make the pointer const.
1775 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
1777         PR c++/79361
1778         * pt.c (register_specialization): Check duplicate_decls return value
1779         for error_mark_node and pass it back.
1781 2017-02-22  Jason Merrill  <jason@redhat.com>
1783         PR c++/79679 - missing destructor for argument
1784         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1785         conversions.
1787         * pt.c (do_class_deduction): Handle 0 argument case.
1789 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
1791         PR c++/79664
1792         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1793         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1794         * constexpr.c (potential_constant_expression_1): Handle
1795         OMP_*, OACC_* and CILK_* trees.  Use error_at with
1796         EXPR_LOC_OR_LOC (t, input_location) computed early
1797         instead of error, or error_at with location_of (t).
1799 2017-02-22  Marek Polacek  <polacek@redhat.com>
1801         PR c++/79653
1802         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1803         if the alignas expression is erroneous.
1804         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1805         error_mark_node.
1807         PR c++/79657
1808         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1810 2017-02-21  Jason Merrill  <jason@redhat.com>
1812         PR c++/50308 - wrong deprecated warning with ADL
1813         PR c++/17729 - duplicate deprecated warning
1814         * semantics.c (finish_id_expression): Only call mark_used on a
1815         function if we aren't building a call.
1817         PR c++/41727 - ICE with partial spec of partial instantiation
1818         * pt.c (process_partial_specialization): For now, don't check more
1819         specialized if there is more than one level of args.
1821 2017-02-21  Marek Polacek  <polacek@redhat.com>
1823         PR c++/79535
1824         * cp-tree.h (maybe_reject_flexarray_init): Declare.
1825         * init.c (maybe_reject_flexarray_init): No longer static.
1826         Add check for current_function_decl.
1827         * parser.c (cp_parser_late_parse_one_default_arg): Reject
1828         a default mem-initializer for a flexible array.
1830 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1831             Paolo Carlini  <paolo.carlini@oracle.com>
1833         PR c++/79654
1834         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1835         on error.
1836         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1837         decl after the decomposition artificial decl has error_mark_node.
1838         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1839         instead of just == error_mark_node comparison.
1841 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
1843         PR sanitizer/79589
1844         * decl.c: Include gimplify.h.
1845         (cp_finish_decomp): Make sure there is no sharing of trees
1846         in between DECL_VALUE_EXPR of decomposition decls.
1848         PR c++/79655
1849         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1851         PR c++/79639
1852         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1853         call cplus_expand_constant on it first.
1855 2017-02-19  Jason Merrill  <jason@redhat.com>
1857         PR c++/78139 - destructor needed by new-expression
1858         * call.c (build_special_member_call): Use tf_no_cleanup.
1860         PR c++/78282 - auto template and pack expansion
1861         * pt.c (find_parameter_packs_r): Don't walk into the type of
1862         templates other than template template-parameters.
1864         PR c++/79606 - ICE with this->base_member in NSDMI
1865         * class.c (build_base_path): Check processing_template_decl.
1867         PR c++/79607 - ICE with T{} initializer
1868         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1870         PR c++/79566 - elaborated-type-specifier in range for
1871         * parser.c (cp_parser_simple_declaration): Fix check for type
1872         definition.
1874         PR c++/79400 - confusing suggestion of 'noexcept'
1875         * parser.c (cp_parser_exception_specification_opt): Remove
1876         suggestion for deprecated dynamic exception-specification.
1878         PR c++/79470 - partial ordering with reference parameters
1879         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1881         PR c++/79500 - ICE with non-template deduction guide
1882         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1883         DECL_TEMPLATE_RESULT.
1885         PR c++/79580 - ICE with compound literal
1886         * parser.c (cp_parser_class_head): If we're in the middle of an
1887         expression, use ts_within_enclosing_non_class.
1889         PR c++/79503 - inherited ctor taking base class
1890         * call.c (add_function_candidate): Also check that
1891         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1893 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
1895         PR c++/79380
1896         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1897         argument.
1899 2017-02-19  Eric Fiselier  <eric@efcs.ca>
1900             Jonathan Wakely  <jwakely@redhat.com>
1902         PR c++/69523
1903         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1904         control warning about literal suffix identifiers without a leading
1905         underscore.
1907 2017-02-17  Jason Merrill  <jason@redhat.com>
1909         PR c++/79508 - lookup error with member template
1910         * parser.c (cp_parser_template_name): Clear
1911         parser->context->object_type if we aren't doing lookup.
1913         PR c++/78690 - ICE with using and global type with same name
1914         * pt.c (type_dependent_object_expression_p): True for
1915         IDENTIFIER_NODE.
1917         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1918         * pt.c (convert_template_argument): Just return an auto arg pack.
1919         (tsubst_template_args): Don't tsubst an auto pack type.
1921         PR c++/79556 - C++17 ICE with non-type auto
1922         * pt.c (do_auto_deduction): Don't try to deduce from null type.
1924         PR c++/79533 - C++17 ICE with temporary cast to reference
1925         * call.c (build_over_call): Conversion to a reference prevents copy
1926         elision.
1928 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1929             Jason Merrill  <jason@redhat.com>
1931         PR c++/79502 - lost nodiscard attribute
1932         * pt.c (apply_late_template_attributes): Do apply non-dependent
1933         attributes to types.
1935 2017-02-16  Jason Merrill  <jason@redhat.com>
1937         PR c++/78572 - ICE with self-modifying array initializer
1938         * constexpr.c (cxx_eval_store_expression): The object we're
1939         initializing is outside the constant-expression.
1940         (cxx_eval_call_expression): Set ctx->call.
1942         PR c++/79050 - ICE with undeduced auto and LTO
1943         * decl.c (poplevel): Remove undeduced auto decls.
1945 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
1947         PR c++/79512
1948         * parser.c (cp_parser_omp_target): For -fopenmp-simd
1949         ignore #pragma omp target even when not followed by identifier.
1951 2017-02-15  Jason Merrill  <jason@redhat.com>
1952             Jakub Jelinek  <jakub@redhat.com>
1954         PR c++/79464 - ICE in IPA with omitted constructor parms
1955         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1956         (adjust_clone_args): Adjust.
1957         (add_method): Remember omitted parms.
1958         * call.c (add_function_candidate): Likewise.
1959         * mangle.c (write_method_parms): Likewise.
1960         * method.c (ctor_omit_inherited_parms): Return false if there are no
1961         parms to omit.
1963 2017-02-15  Martin Sebor  <msebor@redhat.com>
1965         PR c++/79363
1966         * init.c (maybe_reject_flexarray_init): New function.
1967         (perform_member_init): Call it.
1969 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
1971         PR c++/79301
1972         * parser.c (cp_parser_std_attribute): Don't pedwarn about
1973         [[deprecated]] with -std=c++11 and [[fallthrough]] with
1974         -std=c++11 and -std=c++14.
1976         PR c++/79288
1977         * decl.c (grokdeclarator): For static data members, handle thread_p
1978         only after handling inline.
1980 2017-02-14  Marek Polacek  <polacek@redhat.com>
1982         PR c++/79420
1983         PR c++/79463
1984         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1985         clobbering if the postfix expression isn't an EXPR_P.
1987 2017-02-13  Jason Merrill  <jason@redhat.com>
1989         PR c++/79461 - ICE with lambda in constexpr constructor
1990         * constexpr.c (build_data_member_initialization): Ignore
1991         initialization of a local variable.
1993 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
1995         * init.c (warn_placement_new_too_small): Add missing space in
1996         diagnostics.
1997         * parser.c (cp_parser_oacc_declare): Likewise.
1998         * mangle.c (maybe_check_abi_tags): Likewise.
2000         PR c++/79232
2001         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2002         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2003         in the rightmost operand.
2005 2017-02-13  Nathan Sidwell  <nathan@acm.org>
2007         PR c++/79296 - ICE mangling localized template instantiation
2008         * decl2.c (determine_visibility): Use template fn context for
2009         local class instantiations.
2011 2017-02-11  Jason Merrill  <jason@redhat.com>
2013         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2014         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2015         (build_new_1): Use replace_placeholders.
2016         * tree.c (replace_placeholders_t): Also track whether we've seen a
2017         placeholder.
2018         (replace_placeholders, replace_placeholders_r): Adjust.
2019         * cp-tree.h: Adjust.
2021         PR c++/77790 - ICE with auto function in C++11 mode
2022         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2023         (require_deduced_type): Add complain parm, return bool.
2024         * cp-tree.h: Adjust.
2025         * decl2.c (mark_used): Use require_deduced_type.
2027 2017-02-10  Jason Merrill  <jason@redhat.com>
2029         PR c++/78908 - template ops and bitfields
2030         * tree.c (build_min_non_dep): Use unlowered_expr_type.
2032         PR c++/78897 - constexpr union
2033         * constexpr.c (cxx_eval_store_expression): A store to a union member
2034         erases a previous store to another member.
2036         PR c++/71285 - member of fold-expression
2037         * semantics.c (finish_unary_fold_expr)
2038         (finish_binary_fold_expr): Use null type for fold-expressions.
2040         PR c++/79401 - protected inherited constructor
2041         * call.c (enforce_access): For inheriting constructor, find a base
2042         binfo in the path we already have.
2044 2017-02-10  Marek Polacek  <polacek@redhat.com>
2046         PR c++/79435
2047         * pt.c (type_dependent_expression_p): Check if the expression type
2048         is null.
2050         PR c++/79184
2051         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2052         if warnings shouldn't be given.
2054 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
2056         PR c++/71737
2057         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2058         an error_mark_node as type.
2060 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2061             Jason Merrill  <jason@redhat.com>
2063         PR c++/79143
2064         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2065         from pattern to type.
2067 2017-02-09  Jason Merrill  <jason@redhat.com>
2069         PR c++/79316 - default argument in deduction guide
2070         PR c++/79350 - explicit deduction guide
2071         * parser.c (cp_parser_constructor_declarator_p)
2072         (cp_parser_direct_declarator): Parse deduction guides more like
2073         constructors.
2074         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2075         * tree.c (special_function_p): Return it.
2076         * decl.c (check_special_function_return_type): Handle it.
2077         (grokdeclarator, grokfndecl): Adjust.
2078         (cp_finish_decl): Pass flags to do_auto_deduction.
2079         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2080         * pt.c (dguide_name_p): Take a const_tree.
2081         (do_class_deduction): Handle explicit.
2082         (do_auto_deduction): Pass flags through.
2083         (build_deduction_guide): Copy explicit flag.
2085 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2087         PR c++/79429
2088         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2089         non-pragma_compound context here.
2090         (cp_parser_omp_target): Likewise.
2091         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2092         parsing for ordered and target omp pragmas in non-pragma_stmt
2093         non-pragma_compound contexts.
2095         PR c/79431
2096         * parser.c (cp_parser_oacc_declare): Formatting fix.
2097         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2098         automatic variables.
2100 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
2101             Chung-Lin Tang  <cltang@codesourcery.com>
2103         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
2104         parsing.  Parse constant expression. Remove semantic checking.
2105         (cp_parser_omp_clause_collapse): Disallow tile.
2106         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
2107         error about missing for after already emitting one.  Use more
2108         conventional for idiom for unbounded loop.
2109         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2110         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2111         (finish_omp_for): Deal with tile clause.
2113 2017-02-07  Nathan Sidwell  <nathan@acm.org>
2115         * method.c (synthesized_method_base_walk): New.  Broken out of ...
2116         (synthesized_method_walk): ... here.  Call it.  Cleanup
2117         initializations.
2119 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
2121         PR c++/79360
2122         * typeck2.c (process_init_constructor_union): Consider only
2123         FIELD_DECLs when looking for an NSDMI.
2125 2017-02-06  Jason Merrill  <jason@redhat.com>
2127         PR c++/71193 - incomplete types in templates
2128         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2129         handle incomplete type by pedwarning and then treating as dependent.
2131 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
2133         PR c++/79379
2134         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2135         (potential_constant_expression_1): Likewise.
2137         PR c++/79377
2138         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2139         allow one fewer than expected arguments if flag_permissive.
2141         PR c++/79372
2142         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2143         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2144         with error_mark_node type.
2146 2017-02-03  Jason Merrill  <jason@redhat.com>
2148         PR c++/78689 - ICE on constructor with label
2149         * optimize.c (maybe_clone_body): Replace omitted parameters with
2150         null lvalues.
2151         * class.c (build_clone): Fix logic for omitting inherited parms.
2153         PR c++/12245 - excessive memory use
2154         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2155         back in.  Don't cache constants.
2156         (maybe_constant_init): Don't cache constants.
2158         PR c++/79294 - ICE with invalid template argument
2159         * pt.c (convert_nontype_argument_function): Check value-dependence.
2160         (convert_nontype_argument): Don't check it here for function ptrs.
2162 2017-02-02  Richard Biener  <rguenther@suse.de>
2164         PR cp/14179
2165         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2166         it lazily on the first changed element only and copy it
2167         fully upfront, only storing changed elements.
2169 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
2171         PR c++/69637
2172         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2173         to the width.
2175 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
2177         PR c++/79304
2178         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2179         after ARROW_EXPR.
2181 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
2183         PR c++/79298
2184         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2185         any namespace aliases.
2187 2017-01-31  Nathan Sidwell  <nathan@acm.org>
2189         PR c++/79290
2190         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2192         PR c++/67273
2193         PR c++/79253
2194         * pt.c: (instantiate_decl): Push to top level when current
2195         function scope doesn't match.  Only push lmabda scope stack when
2196         pushing to top.
2198         * cp-tree.h (instantiate_decl): Make defer_ok bool.
2199         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2200         (instantiate_decl): Simplify and reorder state saving and restoration.
2202         PR c++/79264
2203         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2204         * semantics.c (finish_member_declaration): Assert class is being
2205         defined.
2207 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
2209         Introduce C++ support in libcc1.
2210         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2211         (ansi_opname): Rename to...
2212         (cp_operator_id): ... this.  Adjust all callers.
2213         (ansi_assopname): Rename to...
2214         (cp_assignment_operator_id): ... this.  Adjust all callers.
2215         (cp_literal_operator_id): Declare.
2216         (set_global_friend): Declare.
2217         (is_global_friend): Declare.
2218         (enum cp_oracle_request): New type.
2219         (cp_binding_oracle_function): New type.
2220         (cp_binding_oracle): Declare.
2221         (cp_finish_injected_record_type): Declare.
2222         * friend.c (global_friend): New var.
2223         (set_global_friend): New fn.
2224         (is_global_friend): New fn.
2225         (is_friend): Call is_global_friend.
2226         * name-lookup.c (cp_binding_oracle): New var.
2227         (query_oracle): New fn.
2228         (qualified_lookup_using_namespace): Call query_oracle.
2229         (lookup_name_real_1): Likewise.
2230         * parser.c (cp_literal_operator_id): Drop static.
2231         * search.c (friend_accessible_p): Call is_global_friend.
2232         * semantics.c (is_this_parameter): Accept a variable if the
2233         binding oracle is enabled.
2235 2017-01-27  Jason Merrill  <jason@redhat.com>
2237         PR c++/78771 - ICE with inherited constructor.
2238         * call.c (build_over_call): Call deduce_inheriting_ctor here.
2239         * pt.c (tsubst_decl): Not here.
2240         * class.c (add_method): Or here.
2241         * method.c (deduce_inheriting_ctor): Handle clones.
2242         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2244 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
2246         PR c++/64382
2247         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2248         New function.
2249         * cp/cp-tree.h: Declare it.
2250         * cp/semantics.c (finish_id_expression): Resolve names within a default
2251         capturing generic lambda defined within a template prior to
2252         instantiation to allow for captures to be added to the closure type.
2254 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
2256         PR c++/68727
2257         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2258         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2259         * parser.c (cp_parser_builtin_offsetof): Pass result of
2260         build_static_cast of null_pointer_node to finish_offsetof.
2261         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2262         it for -Winvalid-offsetof pedwarn instead of trying to guess
2263         original offsetof type from EXPR.  Save OBJECT_PTR as a new
2264         second operand to OFFSETOF_EXPR.
2265         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2266         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2267         as OBJECT_PTR.
2269 2017-01-26  Jason Merrill  <jason@redhat.com>
2271         * name-lookup.c (parse_using_directive): Deprecate strong using.
2273         PR c++/79176 - lambda ICE with -flto -Os
2274         * decl2.c (vague_linkage_p): Handle decloned 'tors.
2275         * tree.c (decl_linkage): Likewise.
2277 2017-01-25  Martin Sebor  <msebor@redhat.com>
2279         * decl.c (grokdeclarator): Fix a typo in a comment.
2281 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
2283         PR c++/78896
2284         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2285         lambda expressions.
2287         PR c++/77914
2288         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2289         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2291 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
2293         PR lto/79061
2294         * decl.c (cxx_init_decl_processing): Pass main_input_filename
2295         to build_translation_unit_decl.
2297 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
2299         PR c++/79205
2300         * cp-gimplify.c (cp_genericize_r): Add result of
2301         convert_from_reference on invisiref parm to p_set.
2303 2017-01-24  Nathan Sidwell  <nathan@acm.org>
2305         PR c++/78469 - defaulted ctor and inaccessible dtor
2306         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2307         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2308         * tree.c (build_target_expr): Check tf_no_cleanup.
2310         PR c++/79118 - anon-members and constexpr
2311         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2312         ctor decl.  Recursively check anonymous members.
2313         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2314         call.
2315         (explain_invalid_constexpr_fn): Likewise.
2317 2017-01-23  Nathan Sidwell  <nathan@acm.org>
2319         PR c++/71710 - template using directive of field
2320         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2321         check earlier.
2323         PR c++/71406 - ICE with scope-ref'd template id exprs
2324         PR c++/77508
2325         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2326         before breaking up TEMPLATE_ID_EXPR.
2328 2017-01-20  Nathan Sidwell  <nathan@acm.org>
2330         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2331         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2333 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
2335         PR c++/77829
2336         PR c++/78656
2337         * cp-tree.h (suggest_alternatives_for): Add bool param.
2338         (suggest_alternative_in_explicit_scope): New decl.
2339         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2340         that isn't the global one, call new function
2341         suggest_alternative_in_explicit_scope, only calling
2342         suggest_alternatives_for if it fails, and disabling near match
2343         searches fort that case.  When SCOPE is the global namespace,
2344         pass true for new param to suggest_alternatives_for to allow for
2345         fuzzy name lookups.
2346         * lex.c (unqualified_name_lookup_error): Pass true for new param
2347         to suggest_alternatives_for.
2348         * name-lookup.c (consider_binding_level): Add forward decl.
2349         (suggest_alternatives_for): Add "suggest_misspellings" param,
2350         using it to conditionalize the fuzzy name-lookup code.
2351         (suggest_alternative_in_explicit_scope): New function.
2352         * parser.c (cp_parser_primary_expression): When calling
2353         finish_id_expression, pass location of id_expression rather
2354         than that of id_expr_token.
2355         (cp_parser_id_expression): Convert local "unqualified_id" from
2356         tree to cp_expr to avoid implicitly dropping location information.
2358 2017-01-20  Marek Polacek  <polacek@redhat.com>
2360         PR c/64279
2361         * call.c (build_conditional_expr_1): Warn about duplicated branches.
2362         * semantics.c (finish_expr_stmt): Build statement using the proper
2363         location.
2365 2017-01-19  Jason Merrill  <jason@redhat.com>
2367         US 20 - forwarding references and class template argument deduction
2368         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2369         * pt.c (push_template_decl_real): Set it.
2370         (maybe_adjust_types_for_deduction): Check it.
2371         (rewrite_template_parm): Copy it.
2373         US 19 - deduction guides and constructors
2374         * call.c (joust): Prefer deduction guides to constructors.
2375         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2376         (deduction_guide_p): Check DECL_P.
2378         * decl.c (check_initializer): Always use build_aggr_init for array
2379         decomposition.
2381         PR c++/79130 - decomposition and direct-initialization
2382         * init.c (build_aggr_init): Communicate direct-initialization to
2383         build_vec_init.
2384         (build_vec_init): Check for array copy sooner.
2385         * parser.c (cp_parser_decomposition_declaration): Remove call to
2386         build_x_compound_expr_from_list.
2388 2017-01-18  Jason Merrill  <jason@redhat.com>
2390         PR c++/68666 - member variable template-id
2391         * typeck.c (finish_class_member_access_expr): Handle variable
2392         template-id.
2393         * pt.c (lookup_and_finish_template_variable): No longer static.
2394         * cp-tree.h: Declare it.
2396 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2398         PR c++/78488
2399         * call.c (build_over_call): When checking ellipsis conversions for
2400         an inherited ctor, make sure there is at least one conversion.
2402 2017-01-18  Jason Merrill  <jason@redhat.com>
2404         PR c++/78894 - ICE with class deduction and default arg
2405         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2407 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2409         PR c++/77489
2410         * mangle.c (write_discriminator): Reorganize abi warning check.
2412 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2414         * cp-tree.h: Clarify exception spec node comment.
2415         * except.c (nothrow_spec_p): Simplify by checking node-equality.
2417         PR c++/79091
2418         * mangle.c (write_exception_spec): Check nothrow explicitly.
2419         (write_encoding): Don't increment processing_template_decl around
2420         encoding.
2422 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2424         PR c++/70182
2425         * mangle.c (write_template_args): Add "on" for operator names.
2427 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2429         PR c++/77489
2430         * mangle.c (write_discriminator): Handle discriminator >= 10.
2432 2017-01-17  Nathan Sidwell  <nathan@acm.org>
2434         PR c++/61636
2435         * cp-tree.h (maybe_generic_this_capture): Declare.
2436         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2437         (maybe_resolve_dummy): ... here.  Call it.
2438         (maybe_generic_this_capture): New.
2439         * parser.c (cp_parser_postfix_expression): Speculatively capture
2440         this in generic lambda in unresolved member function call.
2441         * pt.c (tsubst_copy_and_build): Force hard error from failed
2442         member function lookup in generic lambda.
2444 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
2446         PR c++/70565
2447         * cp-array-notation.c (expand_array_notation_exprs): Handle
2448         OMP_PARALLEL.
2450 2017-01-11  Jason Merrill  <jason@redhat.com>
2452         PR c++/78337 - ICE on invalid with generic lambda
2453         * semantics.c (process_outer_var_ref): Check if containing_function
2454         is null.  Move inform call under complain test.
2456 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2458         PR c++/77812
2459         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2460         is a new overload.
2462 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2464         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2466 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
2468         PR c++/78341
2469         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2470         assertion.  Formatting fix.
2472         PR c++/72813
2473         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2474         writing PCH file.
2476 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
2478         PR c++/77949
2479         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2480         a missing semicolon if we have a valid insertion location for
2481         the fix-it hint.
2483 2017-01-10  Jason Merrill  <jason@redhat.com>
2485         FI 20, decomposition declaration with parenthesized initializer.
2486         * parser.c (cp_parser_decomposition_declaration): Use
2487         cp_parser_initializer.
2489 2017-01-09  Jason Merrill  <jason@redhat.com>
2491         Implement P0195R2, C++17 variadic using.
2492         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2493         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2494         * error.c (dump_decl): Likewise.
2496 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
2498         PR translation/79019
2499         PR translation/79020
2500         * semantics.c (finish_omp_clauses): Add missing whitespace to
2501         translatable strings.
2502         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2504 2017-01-07  Jason Merrill  <jason@redhat.com>
2506         PR c++/78948 - instantiation from discarded statement
2507         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2508         * cp-tree.h (in_discarded_stmt): Declare it.
2509         (struct saved_scope): Add discarded_stmt bitfield.
2510         (in_discarded_stmt): New macro.
2511         * decl2.c (mark_used): Check it.
2512         * parser.c (cp_parser_selection_statement): Adjust.
2513         (cp_parser_jump_statement): Adjust.
2515 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
2517         PR c++/78931
2518         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2519         REFERENCE_REF_P, set tt to its operand.
2521         PR c++/78890
2522         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2523         unions even for C++11 and later.
2525 2017-01-05  Nathan Sidwell  <nathan@acm.org>
2527         PR c++/78765
2528         * pt.c (convert_nontype_argument): Don't try and see if integral
2529         or enum expressions are constants prematurely.
2531 2017-01-04  Marek Polacek  <polacek@redhat.com>
2533         PR c++/64767
2534         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2535         a zero character literal.
2537 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
2539         PR c++/78949
2540         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2541         vector type.
2543         PR c++/78693
2544         * parser.c (cp_parser_simple_declaration): Only complain about
2545         inconsistent auto deduction if auto_result doesn't use auto.
2547         * parser.c (cp_parser_simple_declaration): Diagnose function
2548         declaration among more than one init-declarators with auto
2549         specifier.
2551         PR c++/71182
2552         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2553         assertion, as lexer->buffer may be NULL.
2555 2017-01-04  Marek Polacek  <polacek@redhat.com>
2557         PR c++/77545
2558         PR c++/77284
2559         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2561 2017-01-04  Nathan Sidwell  <nathan@acm.org>
2563         PR c++/66735
2564         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2565         (lambda_capture_field_type): Update prototype.
2566         * lambda.c (lambda_capture_field_type): Add is_reference parm.
2567         Add referenceness here.
2568         (add_capture): Adjust lambda_capture_field_type call, refactor
2569         error checking.
2570         * pt.c (tsubst): Adjust lambda_capture_field_type call.
2572 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
2574         Update copyright years.
2576 Copyright (C) 2017 Free Software Foundation, Inc.
2578 Copying and distribution of this file, with or without modification,
2579 are permitted in any medium without royalty provided the copyright
2580 notice and this notice are preserved.