PR c++/81045 - Wrong type-dependence with auto return type.
[official-gcc.git] / gcc / cp / ChangeLog
blob88e148b1d8f5e617abe62bf71372db42cb09a377
1 2017-06-16  Jason Merrill  <jason@redhat.com>
3         PR c++/81045 - Wrong type-dependence with auto return type.
4         * pt.c (type_dependent_expression_p): An undeduced auto outside the
5         template isn't dependent.
6         * call.c (build_over_call): Instantiate undeduced auto even in a
7         template.
9         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
10         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
11         set longer for a generic lambda.
13         PR c++/80614 - Wrong mangling for C++17 noexcept type
14         * mangle.c (write_type): Put the eh spec back on the function type.
16         PR c++/81102 - Wrong error with partial specialization.
17         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
18         types.  Do type deduction later.
20         PR c++/80174 - ICE with partial specialization of member template.
21         PR c++/71747
22         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
24         PR c++/80831 - ICE with -fsyntax-only.
25         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
27         PR c++/80639 - ICE with invalid PMF initialization.
28         PR c++/80043 - ICE with -fpermissive
29         * typeck.c (convert_for_assignment): Recurse when instantiate_type
30         returns without an error.
32 2017-06-16  Nathan Sidwell  <nathan@acm.org>
34         * pt.c (tsubst_baselink): Fix & clarify formatting.
36         * cp-tree.h (build_this_parm, cp_build_parm_decl,
37         build_artificial_parm): Add FN parm.
38         * decl.c (start_cleanup_fn): Adjust.
39         (build_this_parm): Add FN parm, pass it through.
40         (grokfndecl): Adjust parm building.
41         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
42         (build_artificial_parm): Add FN parm, pass through.
43         (maybe_retrofit_in_chrg): Adjust parm building.
44         (start_static_storage_duration_function): Likwise.
45         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
46         * method.c (implicitly_declare_fn): Likewise.
47         * parser.c (inject_this_parameter): Likewise.
49         Symbol tables are insert only.
50         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
51         derive from pointer_hash.  Make undeletable.
53         * class.c (resort_type_method_vec): Avoid potential unsigned
54         overflow.
56         Don't defer noexcept_deferred_spec.
57         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
58         * decl.c (cxx_init_decl_processing): Initialize
59         noexcept_deferred_spec.
60         * except.c (unevaluated_noexcept_spec): Delete.
61         * class.c (deduce_noexcept_on_destructor): Use
62         noexcept_deferred_spec directly.
63         * method.c (implicitly_declare_fn): Likewise.
65         Make keyed_classes a vector.
66         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
67         (keyed_classes): Declare as vector.
68         * decl.c (keyed_classes): Define.
69         (cxx_init_decl_processing): Allocate it.
70         (record_key_method_defined): Use vec_safe_push.
71         * class.c (finish_struct_1): Likewise.
72         * pt.c (instantiate_class_template_1): Likewise.
73         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
75         Make rtti lazier
76         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
77         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
78         (tinfo_names): New.
79         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
80         (get_tinfo_decl): Use get_tinfo_desc.
81         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
82         (create_pseudo_type_info): Delete.
83         (get_pseudo_ti_index): Just determine the index.
84         (get_tinfo_desc): New.  Create all types lazily.
85         (create_tinfo_types): Just allocate the descriptor array.
86         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
87         location.
89 2017-06-15  Martin Sebor  <msebor@redhat.com>
91         PR c++/80560
92         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
93         functions.
94         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
95         (build_cxx_call): Call maybe_warn_class_memaccess.
97 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
99         * cp-gimplify.c (cp_genericize_r): Turn most of the function
100         into a switch (TREE_CODE (stmt)) statement from long else if
101         sequence.
103 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
105         PR c++/80973
106         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
107         argument even if it has REFERENCE_TYPE.
109         PR c++/80984
110         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
111         BLOCK_VARS (outer) chain.
112         (cxx_omp_const_qual_no_mutable): Likewise.
114 2017-06-13  Martin Liska  <mliska@suse.cz>
116         PR sanitize/78204
117         * class.c (build_base_path): Use sanitize_flags_p.
118         * cp-gimplify.c (cp_genericize_r): Likewise.
119         (cp_genericize_tree): Likewise.
120         (cp_genericize): Likewise.
121         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
122         * decl.c (compute_array_index_type): Likewise.
123         (start_preparsed_function): Likewise.
124         * decl2.c (one_static_initialization_or_destruction): Likewise.
125         * init.c (finish_length_check): Likewise.
126         * lambda.c (maybe_add_lambda_conv_op): Likewise.
127         * typeck.c (cp_build_binary_op): Likewise.
128         (build_static_cast_1): Likewise.
130 2017-06-11  Jason Merrill  <jason@redhat.com>
132         * error.c (dump_expr): Use is_this_parameter.
134         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
135         id_equal.
137 2017-06-09  Jason Merrill  <jason@redhat.com>
139         Missing bits from N4268, constant evaluation for all non-type args.
140         * call.c (build_converted_constant_expr): Rename from
141         build_integral_nontype_arg_conv, handle all types.
142         * pt.c (convert_nontype_argument): In C++17 call it for all types.
143         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
144         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
146         Overhaul pointer-to-member conversion and template argument handling.
147         * call.c (standard_conversion): Avoid creating ck_pmem when the
148         class type is the same.
149         * cvt.c (can_convert_qual): Split from
150         perform_qualification_conversions.
151         * constexpr.c (cxx_eval_constant_expression): Check it.
152         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
153         adjustment is necessary.
154         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
155         (convert_nontype_argument): Avoid redundant error.
157         * call.c (convert_like_real): Remove "inner" parameter.
158         Don't replace a constant with its value.
159         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
161         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
162         nullptr_node.
164         * parser.c (cp_parser_constant_expression): Check
165         potential_rvalue_constant_expression after decay_conversion.
166         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
168         PR c++/80384 - ICE with dependent noexcept-specifier
169         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
170         noexcept-specifier.
172         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
174 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
176         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
177         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
178         (excpet.c): Mark terminate as cold.
180 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
182         PR c/81006
183         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
184         to sizetype before size_binop.
186         PR c++/81011
187         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
188         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
189         and OMP_CLAUSE_SHARED_READONLY flags.
191 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
193         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
195 2017-06-07  Nathan Sidwell  <nathan@acm.org>
197         * class.c (layout_class_type): Restructure overlong-bitfield tpe
198         search.
200 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
202         PR c++/80990
203         * pt.c (do_class_deduction): Build qualified type.
205 2017-06-06  Nathan Sidwell  <nathan@acm.org>
207         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
208         sans using directives.  Don't walk into inline namespaces.
210         PR c++/80979
211         * name-lookup.c (adl_class_only): Don't add visible friends.
213 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
215         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
217 2017-06-02  Nathan Sidwell  <nathan@acm.org>
219         Remove lang_type_ptrmem.
220         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
221         into ...
222         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
223         (lang_type): ... this.  Delete old definition.
224         (lang_type_ptrmem): Delete.
225         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
226         (LANG_TYPE_PTRMEM_CHECK): Delete.
227         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
228         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
229         * decl.c (build_ptrmemfunc_type): Adjust.
230         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
231         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
232         
233         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
234         setting.
235         
236         Remove cp_binding_level::namespaces
237         * name-lookup.h (cp_binding_level): Lose namespaces field.
238         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
239         list.
240         (suggest_alternatives_for): Adjust for namespace list.  Do
241         breadth-first search.
242         * decl2.c (collect_source_refs): Namespaces are on the regulr
243         list.
244         (collect_ada_namespace): Likewise.
246 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
248         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
249         warning.
251 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
253         PR c++/80812
254         * method.c (constructible_expr): Strip array types before calling
255         build_value_init.
257 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
259         PR c++/80896
260         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
261         for case INDIRECT_REF too in the main switch.
263 2017-05-31  Jason Merrill  <jason@redhat.com>
265         PR c++/80840 - ICE with constexpr and reference
266         * pt.c (convert_nontype_argument): Don't test whether a decl is
267         value-dependent when binding to a reference.
269 2017-05-31  Nathan Sidwell  <nathan@acm.org>
271         * cp-tree.h (lang_decl_slector): New enum.
272         (lang_decl_base): Make selector an enum.  Drop decomposition_p
273         field.
274         (lang_decl): Use enum for discrimination.
275         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
276         LANG_DECL_DEOMP_CHECK): Use enum.
277         (DECL_DECOMPOSITION_P): Use selector value.
278         (SET_DECL_DECOMPOSITION_P): Delete.
279         (retrofit_lang_decl): Lose SEL parm.
280         (fit_decomposition_lang_decl): Declare.
281         * decl.c (cp_finish_decomp, grokdeclarator): Use
282         fit_decomposition_lang_decl.
283         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
284         retrofit_lang_decl.
285         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
286         (fit_decomposition_lang_decl): Likewise.
287         (retrofit_lang_decl): Use worker functions.
288         (cxx_dup_lang_specific_decl): Use selector enum.
289         (maybe_add_lang_type_raw): New.  Broken out of ...
290         (cxx_make_type_name): ... here.  Call it.
292 2017-05-30  Jason Merrill  <jason@redhat.com>
294         PR c++/80856 - ICE with local extern in template
295         * semantics.c (finish_call_expr): Replace a local extern overload
296         set in a template with the IDENTIFIER_NODE.
298 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
300         * call.c (perform_implicit_conversion_flags): Convert
301         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
302         (print_conversion_rejection): Replace pairs of %qT with
303         %qH and %qI in various places.
304         (build_user_type_conversion_1): Likewise.
305         (build_integral_nontype_arg_conv): Likewise.
306         (build_conditional_expr_1): Likewise.
307         (convert_like_real): Likewise.
308         (convert_arg_to_ellipsis): Likewise.
309         (joust): Likewise.
310         (initialize_reference): Likewise.
311         * cvt.c (cp_convert_to_pointer): Likewise.
312         (cp_convert_to_pointer): Likewise.
313         (convert_to_reference): Likewise.
314         (ocp_convert): Likewise.
315         * error.c (cp_printer): Gain bool and const char ** parameters.
316         (struct deferred_printed_type): New struct.
317         (class cxx_format_postprocessor): New class.
318         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
319         to pp->m_format_postprocessor.
320         (comparable_template_types_p): New function.
321         (newline_and_indent): New function.
322         (arg_to_string): New function.
323         (print_nonequal_arg): New function.
324         (print_template_differences): New function.
325         (type_to_string_with_compare): New function.
326         (print_template_tree_comparison): New function.
327         (append_formatted_chunk): New function.
328         (add_quotes): New function.
329         (cxx_format_postprocessor::handle): New function.
330         (defer_phase_2_of_type_diff): New function.
331         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
332         %H and %I.
333         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
334         %qH and %qI in various places.
335         (convert_member_func_to_ptr): Likewise.
336         (build_reinterpret_cast_1): Likewise.
337         (convert_for_assignment): Likewise.
338         * typeck2.c (check_narrowing): Likewise.
340 2017-05-30  Nathan Sidwell  <nathan@acm.org>
342         Kill IDENTIFIER_NAMESPACE_BINDINGS
343         * cp-tree.h (lang_identifier): Delete namespace_bindings.
344         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
345         (lang_decl_ns): Add bindings.
346         (DECL_NAMESPACE_BINDINGS): New.
347         * lex.c (retrofit_lang_decl): Create namespace hash table.
348         * name-lookup.c (find_namespace_slot): Change to use hash-map.
349         * ptree.c (cxx_print_binding): Delete.
350         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
352         * cp-tree.def (OVERLOAD): Fix comment.
353         * cp-tree.h: Fix comments and whitespace.
354         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
355         * name-lookup.c (add_decl_to_level): Assert not class.
356         (check_local_shadow): Use OVL_P.
357         (pushdecl_with_scope_1): Rename to ...
358         (do_pushdecl_with_Scope): ... here.
359         (do_nonmember_using_decl): Use qualified_namespace_lookup return
360         value.
361         (push_class_level_binding_1): Use OVL_P.
362         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
363         (pushtag_1): Rename to ...
364         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
365         (pushtag): Adjust.
366         (store_class_bindings): Do not time here.
367         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
368         * pt.c (listify): Declare argvec at point of initialization.
370         PR c++/80913
371         * name-lookup.c (add_decl_to_level): Assert not making a circular
372         chain.
373         (update_binding): Don't prematurely slide artificial decl.
375 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
377         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
379 2017-05-29  Nathan Sidwell  <nathan@acm.org>
381         PR c++/80891 (#1,#5)
382         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
383         * name-lookup.c (name_lookup): Add deduping field.
384         (name_lookup::preserve_state, name_lookup::restore_state): Deal
385         with deduping.
386         (name_lookup::add_overload): New.
387         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
388         (name_lookup::search_adl): Set deduping.  Don't unmark here.
389         * pt.c (most_specialized_instantiation): Revert previous change,
390         Assert not given duplicates.
391         * tree.c (lookup_mark): Just mark the underlying decls.
392         (lookup_maybe_add): Dedup using marked decls.
394         PR c++/80891 (#4)
395         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
396         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
398         Stat hack representation
399         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
400         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
401         (stat_hack): New.
402         (find_namespace_binding): Replace with ...
403         (find_namespace_slot): ... this.
404         (find_namespace_value): New.
405         (name_lookup::search_namespace_only,
406         name_lookup::adl_namespace_only): Adjust.
407         (update_binding): Add SLOT parameter, adjust.
408         (check_local_shadow): Use find_namespace_value.
409         (set_local_extern_decl_linkage): Likewise.
410         (do_pushdecl): Adjust for namespace slot.
411         (push_local_binding): Assert not a namespace binding.
412         (check_for_out_of_scope_variable): Use find_namespace_value.
413         (set_identifier_type_value_with_scope): Likewise.
414         (get_namespace_binding): Likewise.
415         (set_namespace_binding): Delete.
416         (set_global_binding): Directly update the binding.
417         (finish_namespace_using_decl): Likewise.
418         (lookup_type_scope_1): Use find_namespace_slot and update.
419         (do_push_nested_namespace): Use find_namespace_value.
421         PR c++/80891 (#1)
422         * pt.c (most_specialized_instantiation): Cope with duplicate
423         instantiations.
425         PR c++/80891 (#3)
426         * cp-tree.h (build_min_nt_call_vec): Declare.
427         * decl.c (build_offset_ref_call_from_tree): Call it.
428         * parser.c (cp_parser_postfix_expression): Likewise.
429         * pt.c (tsubst_copy_and_build): Likewise.
430         * semantics.c (finish_call_expr): Likewise.
431         * tree.c (build_min_nt_loc): Keep unresolved lookups.
432         (build_min): Likewise.
433         (build_min_non_dep): Likewise.
434         (build_min_non_dep_call_vec): Likewise.
435         (build_min_nt_call_vec): New.
437         PR c++/80891 (#2)
438         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
439         (ovl_used): New.
440         (lookup_keep): Call it.
442 2017-05-26  Nathan Sidwell  <nathan@acm.org>
444         Implement DR2061
445         * name-lookup.c (push_inline_namespaces): New.
446         (push_namespace): Look inside inline namespaces.
448         Inline and using namespace representation change.
449         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
450         inlinees as vector.
451         (DECL_NAMESPACE_USING): Adjust.
452         (DECL_NAMESPACE_INLINEES): New.
453         * name-lookup.h (struct cp_binding_level): Change usings
454         representation.
455         * name-lookup.c (name_lookup::do_queue_usings,
456         name_lookup::queue_usings): Adjust.
457         (name_lookup::search_namespace, name_lookup::search_usings,
458         name_lookup::queue_namespace): Adjust.
459         (name_lookup::adl_namespace_only): Adjust.
460         (add_using_namespace, push_namespace): Push onto vector.
461         (pop_namespace): Add timing logic.
463         * call.c (build_operator_new_call): Do namelookup and ADL here.
464         (build_new_op_1): Likewise.
465         * name-lookup.h (lookup_function_nonclass): Delete declaration.
466         (do_using_directive): Likewise.
467         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
468         declare early.
469         (struct scope_binding): Delete.
470         (EMPTY_SCOPE_BINDING): Delete.
471         (set_decl_namespace): Use OVL_P.
472         (finish_local_using_decl): Lose unnecesary checks.
473         (lookup_function_nonclass): Delete.
474         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
476         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
477         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
478         unduplicatable.
479         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
480         (lkp_iterator): Add outer field.  Adjust ctor.
481         (lkp_iterator::operator++): New.
482         (lookup_mark, lookup_maybe_add): Declare.
483         * name-lookup.c (name_lookup): Delete fn_set member.
484         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
485         and mark lookup.
486         (name_lookup::add_value): Use lookup_add directly.
487         (name_lookup::add_fns: Use lookup_maybe_add.
488         (name_lookup::search_adl): Mark and unmark fns.
489         (pushdecl): Adjust.
490         * pt.c (check_explicit_specialization): Use lookup_add directly.
491         * ptree.c (cxx_print_xnode): Show complete overload structure.
492         * tree.c (lookup_mark, lookup_maybe_add): New.
494         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
496 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
498         * cp-tree.h (struct lang_decl_decomp): New type.
499         (struct lang_decl): Add u.decomp.
500         (LANG_DECL_DECOMP_CHECK): Define.
501         (DECL_DECOMPOSITION_P): Note it is set also on the vars
502         for user identifiers.
503         (DECL_DECOMP_BASE): Define.
504         (retrofit_lang_decl): Add extra int = 0 argument.
505         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
506         use it to influence the selector choices and for selector
507         0 to non-zero transition copy old content.
508         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
509         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
510         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
511         wording if decl is a structured binding.
512         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
513         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
514         of individual variables for tuple structured bindings.
515         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
516         Clear DECL_DECOMP_BASE.
517         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
518         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
519         is expected.
520         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
521         DECL_VALUE_EXPR.
523 2017-05-25  Jason Merrill  <jason@redhat.com>
525         PR c++/80605 - __is_standard_layout and zero-length array
526         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
528 2017-05-25  Nathan Sidwell  <nathan@acm.org>
530         Kill OVL_CURRENT, OVL_NEXT.
531         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
532         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
533         (consider_binding_level): Use OVL_FIRST.
534         (cp_emit_debug_info_for_using): Use lkp_iterator.
535         * pt.c (check_explicit_specialization): Use ovl_iterator.       
537         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
538         * cp-tree.h (lang_decl_ns): Remove ns_users field.
539         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
540         (TREE_INDIRECT_USING): Delete.
541         * name-lookup.h (is_associated_namespace): Delete.
542         * name-lookup.c (name_lookup::search_usings,
543         name_lookup::do_queue_usings): Usings are always direct.
544         (is_associated_namespace): Delete.
545         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
546         (namespace_ancestor_1, namespace_ancestor): Delete.
547         (push_using_directive_1, push_using_directive): Delete.
548         (add_using_namespace_1): Delete.
549         (add_using_namespace): Reimplement.
550         (emit_debug_info_using_namespace): New.
551         (finish_namespace_using_directive, finish_local_using_directive,
552         push_namespace): Adjust.
553         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
555 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
557         * semantics.c (finish_handler_parms): Warn about non-reference type
558         catch handlers.
560 2017-05-25  Nathan Sidwell  <nathan@acm.org>
562         Reimplement unqualified namespace lookup.
563         * name-lookup.c (name_lookup::using_pair,
564         name_lookup::using_queue): New typedefs.
565         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
566         name_lookup::queue_usings): New.
567         (name_lookup::search_unqualified): New.
568         (merge_functions, same_entity_p, ambiguous_decl,
569         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
570         lookup_using_namespace): Delete.
571         (lookup_name_real_1): Adjust.
573         Reimplement qualified namespace lookup.
574         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
575         (name_lookup::ambiguous, name_lookup::add_value,
576         name_lookup::add_type, name_lookup::process_binding): New.
577         (name_lookup::search_namespace_only,
578         name_lookup::search_namespace, name_lookup::search_usings): New.
579         (name_lookup::search_qualified): New.
580         (do_nonmember_using_decl, suggest_alternatives_for,
581         lookup_qualified_name): Adjust.
582         (tree_vec_contains): Delete.
583         (qualified_lookup_using_namespace): Rename to ...
584         (qualified_namespace_lookup): ... here.  Reimplement.
586         Reimplement ADL.
587         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
588         * name-lookup.h (lookup_arg_dependent): Return plain tree.
589         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
590         arg_assoc_args_vec, arg_assoc_type, add_function,
591         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
592         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
593         lookup_arg_dependent_1): Delete.
594         (name_lookup): New lookup object.
595         (name_lookup::preserve_state, name_lookup::restore_state,
596         name_lookup::mark_seen, name_lookup::find_and_mark,
597         name_lookup::add_fns, name_lookup::adl_namespace_only,
598         name_lookup::adl_namespace, name_lookup::adl_class_only,
599         name_lookup::adl_bases, name_lookup::adl_class,
600         name_lookup::adl_expr, name_lookup::adl_type,
601         name_lookup::adl_template_arg, name_lookup::search_adl): New.
602         (lookup_arg_dependent): Return a plain tree.  Adjust.
603         (is_associated_namespace): Move later.
604         
605 2017-05-24  Nathan Sidwell  <nathan@acm.org>
607         * friend.c (do_friend): Remove check for existing decl.
608         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
609         * name-lookup.c (push_local_binding): Directly look for binding.
610         (lookup_name_innermost_nonclass_level_1): Delete.
611         (lookup_name_innermost_nonclass_level): Delete.
613         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
615         * cp-tree.h (cp_free_lang_data): Add extern.
616         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
617         ATTRIBUTE_PURE.
618         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
619         * typeck.c (type_unknown_p): Delete.
620         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
621         overload management.
622         (dependent_name): Likewise.
623         (decl_anon_ns_mem_p): Simplify.
625 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
627         PR c++/80544
628         * tree.c (reshape_init): Use unqualified type for direct enum init.
629         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
630         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
631         non-class destination types.
632         (build_const_cast_1): Strip cv-quals from destination types.
633         (build_static_cast, build_reinterpret_cast, build_const_cast)
634         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
636 2017-05-24  Martin Sebor  <msebor@redhat.com>
638         PR c/80731
639         * call.c (fully_fold_internal): Adjust.
641 2017-05-24  Nathan Sidwell  <nathan@acm.org>
643         * cp-tree.h (ovl_skip_hidden): Declare.
644         * tree.c (ovl_skip_hidden): New.
645         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
646         (lookup_arg_dependent_1): Likewise.
647         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
648         (hidden_name_p, remove_hidden_names): Delete.
649         (lookup_name_real_1): Do not strip hidden names.
650         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
652         * cp-tree.h (OVL_HIDDEN_P): New.
653         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
654         (ovl_iterator::reveal_node): Declare.
655         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
656         (ovl_insert): Order on hiddenness.
657         (ovl_iterator::reveal_node): New.
658         * name-lookup.c (anticipated_builtin_p): New.
659         (supplement_binding_1): Use it.
660         (set_local_extern_decl_linkage): Use hidden_p.
661         (do_pushdecl): Deal with unhiding a hidden decl, use
662         anticipated_builtin_p.
663         (do_nonmember_using_decl): Use anticipated_decl_p.
664         (lookup_name_real_1): Use DECL_HIDDEN_P.
666 2017-05-23  Jason Merrill  <jason@redhat.com>
668         -Wunused and C++17 structured bindings
669         * decl.c (poplevel): Don't warn about unused structured bindings,
670         only real variables.
671         * error.c (dump_simple_decl): Handle structured bindings.
672         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
674 2017-05-23  Nathan Sidwell  <nathan@acm.org>
676         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
677         * name-lookup.c (create_local_binding): New.
678         (update_binding): New.
679         (pushdecl_maybe_friend_1): Rename to ...
680         (do_pushdecl): ... this.  Reimplement.
681         (pushdecl): Adjust.
682         (push_overloaded_decl_1, push_overloaded_decl): Delete.
684 2017-05-23  Jason Merrill  <jason@redhat.com>
686         PR c++/80396 - built-in for make_integer_sequence.
687         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
688         (expand_integer_pack, expand_builtin_pack_call): New.
689         (find_parameter_packs_r): Check builtin_pack_call_p.
690         (check_for_bare_parameter_packs): Handle it.
691         (tsubst_pack_expansion): Call expand_builtin_pack_call.
692         (declare_integer_pack): New.
693         (init_template_processing): Call it.
694         * decl2.c (mark_used): Check builtin_pack_fn_p.
696 2017-05-23  Nathan Sidwell  <nathan@acm.org>
698         * name-lookup.c (find_namespace_binding): New.
699         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
700         (set_identifier_type_value_with_scope): Use find_namespace_binding.
701         (find_binding, cp_binding_level_find_binding_for_name,
702         binding_for_name, namespace_binding_1): Delete.
703         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
704         (get_namespace_binding, set_namespace_binding,
705         finish_namespace_using_decl, unqualified_namespace_lookup_1,
706         qualified_lookup_using_namespace, lookup_type_scope_1,
707         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
709         PR c++/80866
710         * parser.c (cp_parser_template_id): Keep the lookup when stashing
711         the template_id.
713         * cp-tree.h (DECL_HIDDEN_P): New.
714         * name-lookup.c (set_decl_context,
715         set_local_extern_decl_linkage): New, broken out of ...
716         (pushdecl_maybe_friend_1): ... here.  Call them.
718 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
720         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
721         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
722         "VECTOR_LENGTH".
724 2017-05-23  Nathan Sidwell  <nathan@acm.org>
726         * cp-tree.h (OVL_P): New.
727         * name-lookup.h (push_local_binding): Delete.
728         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
729         (finish_namespace_using_decl, finish_local_using_decl): ... here
730         * name-lookup.c (add_decl_to_level): Swap args.
731         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
732         (diagnose_name_conflict): Check contexts are same for redecl.
733         (update_local_overload): New.
734         (compparms_for_decl_and_using): Rename to ...
735         (matching_fn_p): ... here.
736         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
737         push_local_bindings call.
738         (push_local_binding): Make static, replace FLAGS arg with
739         IS_USING.
740         (validate_nonmember_using_decl): Use OVL_FIRST.
741         (do_nonmember_using_decl): Use in/out parameters.  Use
742         lkp_iterator and simplify.
743         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
744         (finish_namespace_using_decl, finish_local_using_decl): ... here.
745         Adjust.
746         (lookup_type_current_level): Delete.
747         * parser.c (cp_parser_using_declaration): Adjust.
748         * pt.c (tsubst_expr): Adjust.
750 2017-05-22  Nathan Sidwell  <nathan@acm.org>
752         * name-lookup.h (parse_using_directive): Replace with ...
753         (finish_namespace_using_directive): ... this and ...
754         (finish_local_using_directive): ... this.
755         * name-lookup.c (add_using_namespace_1): Move later.
756         (add_using_namespace): Move later, add namespace_p arg, remove
757         indirect arg.
758         (push_using_directive_1): Directly recurse.
759         (do_using_directive, parse_using_directive): Delete, split into ...
760         (finish_namespace_using_directive): ... this and ...
761         (finish_local_using_directive): ... this.
762         (push_namespace): Use add_using_namespace.
763         * parser.c (cp_parser_using_directive): Call
764         finish_namespace_using_directive or finish_local_using_directive.
765         * pt.c (tsubst_expr): Call finish_local_using_directive.
767         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
768         * cp-tree.h (raw_dump_id): Declare.
769         * decl2.c (raw_dump_id): Define.
770         (dump_tu): Use raw_dump_id.
772         * config-lang.in (gtfiles): Sort list, break lines.
774         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
775         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
776         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
777         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
778         CPTI_RETHROW_FN): New.
779         (noexcept_deferred_spec): New.
780         (terminate_node, call_unexpected_node): Rename to ...
781         (terminate_fn, call_unexpected_fn): ... here.
782         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
783         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
784         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
785         (init_exception_processing): Adjust.
786         (declare_library_fn): Create and push the fns here.
787         (do_get_exception_ptr, do_begin_catch, do_end_catch,
788         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
789         declare_library_fn use.
790         (unevaluated_noexcept_spec): Adjust.
791         * cp-gimplify.c (genericize_eh_spec_block,
792         gimplify_most_not_throw_expr): Adjust.
794         * name-lookup.c (pushdecl_top_level,
795         pushdecl_top_level_and_finish): Move after namespace pushing and
796         popping functions.
797         (push_to_top_level): Rename to ...
798         (do_push_to_top_level): ... here.  Remove timing code.
799         (pop_from_top_level_1): Rename to ...
800         (do_pop_from_top_level): ... here.
801         (do_push_nested_namespace, do_pop_nested_namespace)
802         (push_to_top_level): New wrapper for do_push_to_top_level.
803         (pop_from_top_level): Adjust.
804         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
806 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
808         * config-lang.in (gtfiles): Add c-family/c-format.c,
809         except.c, init.c, lambda.c and friend.c.
810         * class.c (dvirt_fn): Move out of function scope,
811         add GTY attribute.
812         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
813         * init.c (fn): Likewise.
814         * lambda.c (ptr_id, max_id): Likewise.
815         * friend.c (global_friend): Add GTY attribute.
817 2017-05-19  Nathan Sidwell  <nathan@acm.org>
819         * call.c (add_list_candidates): Use OVL_FIRST.
820         (build_new_method_call_1): Likewise.
821         * cp-tree.h (OVL_SINGLE_P): New.
822         (TYPE_HIDDEN_P): New.
823         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
824         * dump.c (cp_tump_tree): Adjust overload dumping.
825         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
826         printing.
827         * method.c (lazily_declare_fn): Assert we added it.
828         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
829         OVL_FIRST.
830         (cp_parser_template_name): Use lkp_iterator.
831         * pt.c (begin_template_parm_list): Fixup comment.
832         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
833         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
834         (ovl_scope): Use lkp_iterator.
836 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
838         * parser.c (cp_parser_omp_clause_default): Handle
839         "OMP_CLAUSE_DEFAULT_PRESENT".
841         * parser.c (cp_parser_omp_clause_default): Avoid printing more
842         than one syntax error message.
844 2017-05-19  Nathan Sidwell  <nathan@acm.org>
846         * class.c (class_dump_id): Define.
847         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
848         * cp-objcp-common.c (cp_register_dumps): New.
849         * cp-objcp-common.h (cp_register_dumps): Declare.
850         (LANG_HOOKS_REGISTER_DUMPS): Override.
851         * cp-tree.h (class_dump_id): Declare.
853 2017-05-18  Nathan Sidwell  <nathan@acm.org>
855         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
856         (OVL_USED_P): New.
857         (lookup_keep): Declare.
858         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
859         * pt.c (tsubst_copy): Assert lookup is persistent.
860         * semantics.c (finish_call_expr): Use lkp_iterator, call
861         lookup_keep.
862         * tree.c (ovl_copy): New.
863         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
864         (lookup_keep): New.
866         * cp-tree.h (OVL_USED): Replace with ...
867         (OVL_USING_P): ... this.
868         (ovl_iterator::using_p): Adjust.
869         * name-lookup.c (push_overloaded_decl_1,
870         do_nonmember_using_decl): Adjust.
871         * search.c (lookup_field_r): Adjust.
872         * tree.c (ovl_insert, ovl_scope): Adjust.
874         * cp-tree.h (lookup_add): Swap args.
875         (ovl_cons, build_overload): Delete.
876         * name-lookup.c (add_function, push_overloaded_decl_1,
877         do_nonmember_using_decl, merge_functions, remove_hidden_names):
878         Use lookup_add, ovl_insert.
879         * pt.c (check_explicit_specialization): Use lookup_add.
880         (do_class_deduction): Likewise. Refactor if.
881         * tree.c (lookup_add): Swap args.
882         (ovl_cons, build_overload): Delete.
884         * name-lookup.c (find_local_binding): New, broken out of ...
885         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
886         (set_namespace_binding): Swap scope & name args.
887         (namespace_binding_1): Likewise.
888         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
889         (push_overloaded_decl_1): Likewise.
890         (set_global_binding): Likewise.
891         (get_namespace_binding): Adjust namespace_binding_1 call.
893 2017-05-17  Nathan Sidwell  <nathan@acm.org>
895         * cp-tree.h (default_hash_traits <lang_identifier *>): New
896         specialization.
897         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
898         (extern_c_fns): New hash table.
899         (check_extern_c_conflict): New, broken out of ...
900         (pushdecl_maybe_friend_1): ... here.  Call it.
901         (c_linkage_bindings): Just look in hash table.
903 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
905         PR c++/80654
906         PR c++/80682
907         Implement new C++ intrinsics __is_assignable and __is_constructible.
908         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
909         (is_xible): New.
910         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
911         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
912         * method.c (constructible_expr): Set cp_unevaluated.
913         (is_xible_helper): New.
914         (is_trivially_xible): Adjust.
915         (is_xible): New.
916         * parser.c (cp_parser_primary_expression): Handle
917         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
918         (cp_parser_trait_expr): Likewise.
919         * semantics.c (trait_expr_value): Handle
920         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
922 2017-05-17  Nathan Sidwell  <nathan@acm.org>
924         * cp-tree.h (ovl_iterator::using_p): New predicate.
925         (ovl_iterator::remove_node): New worker.
926         (ovl_insert): Declare.
927         * tree.c (ovl_insert): New.
928         (ovl_iterator::remove_node): New.
929         * class.c (add_method): Use ovl_iterator, ovl_insert.
930         (clone_function_decl): Fix description.
931         (clone_constructors_and_destructors): Use ovl_iterator.
933         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
934         (maybe_warn_about_overly_private_class): Use ovl_iterator.
935         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
936         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
937         (get_base_fndecls): Use ovl_iterator.
938         (warn_hidden): Use OVL_NAME, ovl_iterator.
939         (add_implicitly_declared_members): Use ovl_iterator.
940         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
941         flatten nested if.
942         (finish_shorthand_constraint): Simplify, use ovl_make.
943         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
944         * search.c (shared_member_p): Use ovl_iterator.
945         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
946         (lookup_conversion_operator): Use OVL_FIRST.
947         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
948         (look_for_overrides_here): Use ovl_iterator.
949         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
950         * typeck.c (build_x_unary_op): Use ovl_make.
952 2017-05-17  Martin Liska  <mliska@suse.cz>
954         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
955         use it instead of int type.
956         (dump_vtable): Likewise.
957         (dump_vtt): Likewise.
958         * decl2.c (dump_tu): Likewise.
960 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
962         * call.c (enforce_access): Add access_failure_info * param and use
963         it to record access failures.
964         * cp-tree.h (class access_failure_info): New class.
965         (enforce_access): Add access_failure_info * param, defaulting to
966         NULL.
967         (lookup_member): Likewise.
968         (locate_field_accessor): New function decl.
969         (perform_or_defer_access_check): Add access_failure_info * param,
970         defaulting to NULL.
971         * search.c (lookup_member): Add access_failure_info * param and
972         pass it on to call to perform_or_defer_access_check.
973         (matches_code_and_type_p): New function.
974         (field_access_p): New function.
975         (direct_accessor_p): New function.
976         (reference_accessor_p): New function.
977         (field_accessor_p): New function.
978         (struct locate_field_data): New struct.
979         (dfs_locate_field_accessor_pre): New function.
980         (locate_field_accessor): New function.
981         * semantics.c (perform_or_defer_access_check): Add
982         access_failure_info * param, and pass it on to call to
983         enforce_access.
984         * typeck.c (access_failure_info::record_access_failure): New method.
985         (access_failure_info::maybe_suggest_accessor): New method.
986         (finish_class_member_access_expr): Pass an access_failure_info
987         instance to the lookup_member call, and call its
988         maybe_suggest_accessor method afterwards.
990 2017-05-16  Marek Polacek  <polacek@redhat.com>
992         PR sanitizer/80536
993         PR sanitizer/80386
994         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
996 2017-05-16  Nathan Sidwell  <nathan@acm.org>
998         * name-lookup.c (check_local_shadow): New, broke out of ...
999         (pushdecl_maybe_friend_1): ... here.  Call it.
1001         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1002         (ovl_first): Move inline definition to end of file.
1003         (ovl_make, lookup_add): Declare.
1004         (get_fns, get_first_fn): Make pure.
1005         * tree.c (ovl_cache): New.
1006         (ovl_make, lookup_add): New.
1007         * pt.c (do_class_deduction): Don't add candidates that will be
1008         elided.
1010         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1011         (print_error_for_call_failure): Use OVL_NAME.
1012         (build_op_call_1): Use ovl_iterator.
1013         (add_candidates): Use OVL_FIRST & lkp_iterator.
1014         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1015         lkp_iterator.
1016         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1017         (type_has_user_nondefault_constructor,
1018         in_class_defaulted_default_constructor,
1019         type_has_user_provided_constructor,
1020         type_has_user_provided_or_explicit_constructor,
1021         type_has_non_user_provided_default_constructor,
1022         vbase_has_user_provided_move_assign,
1023         type_has_move_constructor, type_has_move_assign,
1024         type_has_user_declared_move_constructor,
1025         type_has_user_declared_move_assign,
1026         type_build_ctor_call, type_build_dtor_call,
1027         type_requires_array_cookie, explain_non_literal_class): Likewise.
1028         (finish_struct): Use lkp_iterator.
1029         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1030         (note_name_declared_in_class): Use OVL_NAME.
1031         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1032         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1033         cxx_pretty_printer::expression): Likewise.
1034         * decl2.c (check_classfn): Use ovl_iterator.
1035         * pt.c (retrieve_specialization): Use ovl_iterator.
1036         * tree.c (cp_tree_equal): Use lkp_iterator.
1037         (type_has_nontrivial_copy_init): Use ovl_iterator.
1039         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1040         check is_overloaded_fn.
1042 2017-05-16  Martin Liska  <mliska@suse.cz>
1044         * parser.c (cp_lexer_print_token): Add default value for flags
1045         argument of print_gimple_stmt, print_gimple_expr,
1046         print_generic_stmt and print_generic_expr.
1048 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1050         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1051         iterators.
1052         (MAYBE_BASELINK_FUNCTIONS): New.
1053         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1054         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1055         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1056         * method.c (inherited_ctor_binfo): Use ovl_iterator.
1057         (binfo_inherited_from): Likewise.
1058         * parser.c (lookup_literal_operator): Use lkp_iterator.
1059         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1060         (print_candidates_1): Likewise.
1061         (determine_specialization): Likewise.
1062         (resolve_overloaded_unification): Likewise.
1063         (resolve_nondeduced_context): Likewise.
1064         (type_dependent_expression_p): Likewise.
1065         (dependent_template_p): Likewise.
1066         * ptree.c (cxx_print_xnode): Likewise.
1067         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1068         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1069         * typeck.c (check_template_keyword): Use lkp_iterator.
1071         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1072         (ovl_first): New.
1073         * constexpr.c (function_concept_check): Use OVL_FIRST.
1074         * cvt.c (build_expr_type_conversion): Likewise.
1075         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1076         * decl2.c (mark_used): Use OVL_FIRST.
1077         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1078         (dump_expr, location_of): Use OVL_FIRST.
1079         * friend.c (do_friend): Use OVL_NAME.
1080         * init.c (build_offset_ref): Use OVL_FIRST.
1081         * mangle.c (write_member_name): Likewise.
1082         (write_expression): Use OVL_NAME.
1083         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1084         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1085         * pt.c (check_explicit_specialization): Use OVL_FIRST.
1086         (check_template_shadow): Likewise.
1087         (tsubst_template_args): Use OVL_NAME.
1088         (tsubst_baselink): Use OVL_FIRST.
1089         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1090         * tree.c (get_first_fn): Use OVL_FIRST.
1091         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1092         (cp_build_addr_expr_1): Use OVL_FIRST.
1094         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1095         peeking.
1096         * semantics.c (finish_id_expression): Directly init local var.
1097         (finish_omp_reduction_clause): Use really_overloaded_fn.
1098         * tree.c (get_fns): Document.  Assert we got an overload.
1099         (get_first_fn) Document.
1100         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1101         really_overloaded_fn.
1102         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1104         * cp-tree.h (SCOPE_DEPTH): New.
1105         * name-lookup.h (is_nested_namespace): Declare.
1106         * name-lookup.c (is_nested_namespace): New.
1107         (is_ancestor): Use it.
1108         (set_decl_namespace): Likewise.
1109         (push_namespace): Set SCOPE_DEPTH.
1110         * pt.c (check_specialization_namespace): Use is_nested_namespace.
1111         (check_unqualigied_spec_or_inst): Likewise.
1113 2017-05-15  Nathan Sidwell  <nathan@acm.org>
1115         PR c++/79369
1116         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1117         * name-lookup.h (push_namespace): Return int, add make_inline arg.
1118         * name-lookup.c (push_namespace): Deal with inline directly.
1119         Return pushed count.
1120         * parser.c (cp_parser_namespace_definition): Adjust for
1121         push_namespace change.
1123 2017-05-11  Nathan Sidwell  <nathan@acm.org>
1125         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1126         LANG_HOOKS_PUSHDECL): Move to ...
1127         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1128         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1129         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1131         * name-lookup.h (pushdecl): Add default friend parm.
1132         (pushdecl_maybe_friend): Delete.
1133         (pushdecl_top_level): Add default friend parm.
1134         (pushdecl_top_level_maybe_friend): Delete.
1135         * name-lookup.c (pushdecl_maybe_friend): Delete.
1136         (pushdecl): Add is_friend parm.
1137         (pushdecl_top_level): Add is friend_parm.
1138         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1139         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1140         * friend.c (do_friend): Adjust.
1141         * pt.c (tsubst_friend_class): Adjust.
1143         Revert pushdecl_top_level_and_finish name change.
1144         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1145         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1146         * decl.c (cp_make_fname_decl): Adjust.
1147         * decl2.c (get_guard, handle_tls_init):  Adjust.
1148         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
1150         * name-lookup.c (pushdecl_outermost_localscope): Always
1151         conditionally stop timer.
1153         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1154         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1156         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1157         pushtag_top_level_maybe_friend,
1158         pushdecl_top_level_and_finish): Move declarations to ...
1159         * name-lookup.h: ... here.  Group pushdecl variants.
1160         (pushdecl_top_level_and_finish): Rename to ...
1161         (pushdecl_top_level_with_init): ... here.
1162         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1163         * decl2.c (get_guard, handle_tls_init): Likewise.
1164         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1165         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1166         * method.c (implicitly_declare_fn): Likewise.
1167         * searchc (node_debug_info_needed): Likewise.
1168         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1169         (pushdecl_top_level_with_init): ... here.
1170         (pop_everything): Use namespace_bindings_p.
1172         * name-lookup.h (pop_binding): Rename to pop_local_binding.
1173         (getdecls): Rename to get_local_decls.
1174         * name-lookup.c (pop_binding): Rename to ...
1175         (pop_local_binding): ... here.
1176         (pop_bindings_and_leave_scope): Adjust.
1177         (getdecls): Rename to ...
1178         (get_local_decls): ... here.  Assert local scope.
1179         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
1180         logic.
1181         (store_parm_decls): Adjust get_local_decls call.
1182         (parser.c (synthesize_implicit_template_parm): Likewise.
1184 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
1186         PR c++/80682
1187         * method.c (is_trivially_xible): Reject void types.
1189 2017-05-10  Nathan Sidwell  <nathan@acm.org>
1191         * class.c (handle_using_decl): Always use OVL_CURRENT.
1192         (resolve_address_of_overloaded_function): Move iterator decl into
1193         for scope.  Don't strip anticipated decls here.
1195         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1196         printing.
1197         (print_candidates): Adjust.
1199         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
1200         line breaking.
1201         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
1202         koenig_p handling here.
1203         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1204         (tsubst_omp_clauses): Likewise.
1205         (do_class_deduction): Adjust buld_new_function_call calls.
1206         * semantics.c (finish_call_expr): Likewise.
1208 2017-05-10  Jason Merrill  <jason@redhat.com>
1210         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1211         (unify_type_mismatch, unify_parameter_pack_mismatch)
1212         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1213         (unify_parameter_pack_inconsistent, unify_inconsistency)
1214         (unify_vla_arg, unify_method_type_error, unify_arity)
1215         (unify_arg_conversion, unify_no_common_base)
1216         (unify_inconsistent_template_template_parameters)
1217         (unify_template_deduction_failure)
1218         (unify_template_argument_mismatch)
1219         (unify_overload_resolution_failure): Call unify_invalid.
1221         CWG 1847 - Clarifying compatibility during partial ordering
1222         * pt.c (more_specialized_fn): No order between two non-deducible
1223         parameters.
1225         * pt.c (dependent_type_p): Make sure we aren't called with
1226         global_type_node.
1228         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1229         * pt.c (convert_template_argument): Just return an argument pack.
1230         (coerce_template_parameter_pack, template_parm_to_arg)
1231         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1232         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1233         Don't set the type of a NONTYPE_ARGUMENT_PACK.
1234         * parser.c (make_char_string_pack, make_string_pack): Likewise.
1236 2017-05-10  Nathan Sidwell  <nathan@acm.org>
1238         * cp-tree.h (add_method, clone_function_decl): Change last arg to
1239         bool.
1240         * class.c (add_method): Change third arg to bool.  Adjust.
1241         (one_inheriting_sig, one_inherited_ctor): Adjust.
1242         (clone_function_decl): Change 2nd arg to bool.  Adjust.
1243         (clone_constructors_and_destructors): Adjust.
1244         * lambda.c (maybe_add_lambda_conv_op): Adjust.
1245         * method.c (lazily_declare_fn): Adjust.
1246         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1247         * semantics.c (finish_member_declaration): Adjust.
1249 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1251         PR c++/80145
1252         * decl.c (finish_function): To improve error recovery, change the
1253         logic for calling apply_deduced_return_type.
1255 2017-05-09  Jason Merrill  <jason@redhat.com>
1257         PR c++/80605 - __is_standard_layout and empty base
1258         * class.c (check_bases): Ignore empty bases.
1260         PR c++/70979 - literal class and closure types
1261         * class.c (finalize_literal_type_property): Handle closures
1262         specifically.
1263         (explain_non_literal_class): Likewise.
1265         PR c++/66297, DR 1684 - literal class and constexpr member fns
1266         * constexpr.c (is_valid_constexpr_fn): Only complain about
1267         non-literal enclosing class in C++11.
1268         * class.c (finalize_literal_type_property): Likewise.
1270 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
1272         PR c++/80186
1273         * pt.c (tsubst_decl): Early return error_mark_node if
1274         grok_ctor_properties returns false.
1276 2017-05-09  Jason Merrill  <jason@redhat.com>
1278         PR c++/70167 - array prvalue treated as lvalue
1279         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1280         (enum fcl_t): New.
1281         * semantics.c (finish_compound_literal): Add fcl_context parameter.
1282         Only make a static variable for C99 syntax.
1283         * parser.c (cp_parser_postfix_expression): Pass it.
1284         * pt.c (tsubst_copy_and_build): Likewise.
1285         * call.c (extend_ref_init_temps): Set
1286         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1288 2017-05-09  Nathan Sidwell  <nathan@acm.org>
1290         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1291         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1292         * name-lookup.h (pushdecl_top_level): Declare.
1294 2017-05-08  Jason Merrill  <jason@redhat.com>
1296         PR c++/80178 - parameter passing for uncopyable classes
1297         * tree.c (type_has_nontrivial_copy_init): True for classes with only
1298         deleted copy/move ctors.
1299         (remember_deleted_copy, maybe_warn_parm_abi): New.
1300         * decl.c (require_complete_types_for_parms, check_function_type):
1301         Call maybe_warn_parm_abi.
1302         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1304 2017-05-08  Nathan Sidwell  <nathan@acm.org>
1306         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1307         (start_preparsed_function): Do decl pushing before setting
1308         current_funciton_decl and announcing it.
1310         * name-lookup.h (pushdecl_with_scope): Replace with ...
1311         (pushdecl_outermost_localscope): ... this.
1312         * name-lookup.c (pushdecl_with_scope): Replace with ...
1313         (pushdecl_outermost_localscope): ... this.
1314         (pushdecl_namespace_level): Adjust.
1315         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1316         * lambda.c (insert_capture_proxy): Likewise.
1318         * class.c (build_vtbl_initializer): Don't shadow outer variable
1319         with static var.
1321         Revert _binding -> _value change.
1322         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1323         (get_namespace_binding, set_global_binding): ... these.
1324         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1325         (get_namespace_binding, set_global_binding): ... these.
1326         (arg_assoc_namespace, pushdecl_maybe_friend_1,
1327         check_for_out_of_scope_variable, push_overloaded_decl_1,
1328         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1329         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1330         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1331         * decl.c (poplevel): Adjust.
1332         * pt.c (make_constrained_auto): Likewise.
1334 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
1336         PR translation/80280
1337         * call.c (print_z_candidate): Fix quoting.
1339 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
1341         * error.c (pedwarn_cxx98): Replace report_diagnostic
1342         with diagnostic_report_diagnostic.
1344 2017-05-05  Nathan Sidwell  <nathan@acm.org>
1346         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1347         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1348         (IDENTIFIER_NAMESPACE_VALUE): Delete.
1349         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1350         with ...
1351         (get_namespace_value, set_global_value): ... these.
1352         (get_global_value_if_present, is_typename_at_global_scope): Delete.
1353         * decl.c (poplevel): Use get_namespace_value.
1354         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1355         * class.c (build_vtbl_initializer): Stash library decl in
1356         static var. Use IDENTIFIER_GLOBAL_VALUE.
1357         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1358         do_allocate_exception, do_free_exception, build_throw): Likewise.
1359         * init.c (throw_bad_array_new_length): Likewise.
1360         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1361         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1362         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1363         get_namespace_value.
1364         (set_namespace_binding_1): Rename to
1365         (set_namespace_binding): ... here.
1366         (set_global_value): New.
1367         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1368         get_namespace_value.
1369         * pt.c (listify): Use get_namespace_value.
1371         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1372         current scope.
1373         * lex.c (unqualified_name_lookup_error): Likewise.
1375         * class.c (alter_class): Use retrofit_lang_decl directly.
1376         * decl.c (push_local_name, dupliate_decls): Likewise.
1377         * semantics.c (omp_privatize_field): Likewise.
1379         Kill walk_namespaces.
1380         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1381         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1383         Kill per-namespace static_decls.
1384         * cp-tree.h (static_decls): Declare.
1385         (wrapup_globals_for_namespace,
1386         diagnose_inline_vars_for_namespace): Replace with ...
1387         (wrapup_namespace_globals): ... this.
1388         * decl.c (static_decls): Define.
1389         (wrapup_globals_for_namespace,
1390         diagnose_inline_vars_for_namespace): Replace with ...
1391         (wrapup_namespace_globals): ... this.
1392         (cxx_init_decl_processing): Initialize static_decls.
1393         * decl2.c (c_parse_final_cleanups): Adjust.
1394         * name-lookup.h (cp_binding_level): Remove static_decls member.
1395         * name-lookup.c (add_decl_to_level): Adjust.
1396         (begin_scope): Adjust.
1398 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
1400         PR c++/71577
1401         * decl.c (reshape_init): Unconditionally return error_mark_node
1402         upon error about too many initializers.
1404 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1406         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1408 2017-05-04  Martin Sebor  <msebor@redhat.com>
1410         PR translation/80280
1411         * call.c (print_z_candidate): Add missing quoting to %D and other
1412         like directives.
1413         (build_op_call_1): Same.
1414         * constraint.cc (diagnose_check_constraint): Same.
1415         * mangle.c (mangle_decl): Same.
1416         * name-lookup.c (cp_binding_level_debug): Same.
1417         (set_decl_namespace): Same.
1418         * parser.c (cp_parser_tx_qualifier_opt): Same.
1419         * pt.c (print_candidates_1): Same.
1420         (check_template_variable): Same.
1421         (tsubst_default_argument): Same.
1422         (most_specialized_partial_spec): Same.
1423         * semantics.c (omp_reduction_lookup): Same.
1424         * tree.c (check_abi_tag_redeclaration): Same.
1425         * typeck.c (comptypes): Same.
1426         * typeck2.c (abstract_virtuals_error_sfinae): Same.
1428 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1430         More global trees.
1431         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1432         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1433         CPTI_INIT_LIST_IDENTIFIER.
1434         (global_namespace, global_type_node, global_identifier,
1435         anon_identifier, init_list_identifier): New.
1436         * decl.c (global_type_node, global_scope_name): Delete.
1437         (initialize_predefined_identifiers): Add new identifiers.
1438         (cxx_init_decl_processing): Adjust.
1439         * name-lookup.h (global_namespace, global_type_node): Delete.
1440         * name-lookup.c (global_namespace, anonymous_namespace_name,
1441         get_anonymous_namespace_name): Delete.
1442         (namespace_scope_ht_size, begin_scope, pushtag_1,
1443         push_namespace): Adjust,
1444         * call.c (type_has_extended_temps): Use init_list_identifier.
1445         * pt.c (listify): Likewise.
1447         * name-lookup.c: Reorder functions to make merging from modules
1448         branch simpler.
1450 2017-05-03  Jason Merrill  <jason@redhat.com>
1452         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1454 2017-05-03  Nathan Sidwell  <nathan@acm.org>
1456         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1457         along with #defines, to before name-lookup include.
1459 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
1461         * pt.c (is_auto_or_concept): Remove.
1462         (type_uses_auto_or_concept): Remove, unused.
1463         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1464         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1465         * cp-tree.h (is_auto_or_concept): Remove.
1467 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
1469         PR c++/80038
1470         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1471         add pedigree operation and detach call here.
1472         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1473         cilk_cp_gimplify_call_params_in_spawned_fn.
1474         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1475         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1477 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
1479         * parser.c (cp_parser_member_declaration): Add fix-it hints for
1480         stray comma and missing semicolon at end of member declaration.
1482 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
1484         * parser.c (cp_parser_cast_expression): Add target type of cast to
1485         diagnostic.
1486         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1488 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1490         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1491         return type to bool.
1492         * cp-tree.h (grok_ctor_properties): Update.
1494 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
1496         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1497         information to diagnostic of invalid colon in nested-name-specifier.
1499 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
1501         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1502         diagnostic of invalid class/struct keyword after enum.
1504 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1506         * parser.c (cp_parser_member_declaration): Add fix-it hint
1507         for removing stray semicolons.
1509 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1511         * name-lookup.c (get_std_name_hint): New function.
1512         (maybe_suggest_missing_header): New function.
1513         (suggest_alternative_in_explicit_scope): Call
1514         maybe_suggest_missing_header.
1516 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1518         PR c++/80177
1519         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1520         candidate type of bm from tree to const char *.
1521         (consider_binding_level): Likewise.
1522         (lookup_name_fuzzy): Likewise, using this to merge the best
1523         result from the preprocessor into bm, rather than immediately
1524         returning, so that better matches from reserved words can "win".
1525         Guard the rejection of keywords that don't start decl-specifiers
1526         so it only happens for FUZZY_LOOKUP_TYPENAME.
1528 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
1530         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1531         (start_enum): Likewise.
1532         (build_enumerator): Likewise. Use %qE instead of plain %E.
1533         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1534         %<%D%> in diagnostics.
1535         (cp_parser_elaborated_type_specifier): Likewise.
1536         * pt.c (make_pack_expansion): Use %qT and %qE instead of
1537         %<%T%> and %<%E%> in diagnostics.
1538         (tsubst_pack_expansion): Likewise.
1540 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
1542         PR c++/80016
1543         * parser.c (cp_parser_unary_expression):  Generate a location
1544         range for alignof and sizeof expressions.
1546 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
1548         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1549         error message.
1550         (cp_parser_virt_specifier_seq_opt): Likewise.
1551         (set_and_check_decl_spec_loc): Likewise twice.
1553 2017-04-21  Jason Merrill  <jason@redhat.com>
1555         PR c++/80179 - ICE with initialized flexible array member.
1556         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1558 2017-04-21  Richard Biener  <rguenther@suse.de>
1560         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1561         (copy_type): Likewise.
1562         * lex.c (copy_decl): Pass down mem-stat info.
1563         (copy_type): Likewise.
1565 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
1567         PR c++/80473
1568         * init.c (build_new_1): Suppress notes about over-aligned new when
1569         the warning is suppressed.
1571 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
1573         * parser.c (cp_parser_member_declaration): Add warning with fixit
1574         information for extra semicolon after in-class function definition.
1576 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
1578         PR middle-end/80423
1579         * tree.c (build_cplus_array_type): Call build_array_type
1580         with the intended TYPE_TYPELESS_STORAGE flag value, instead
1581         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1582         on the shared type.
1584 2017-04-18  Marek Polacek  <polacek@redhat.com>
1586         PR c++/80244 - ICE with attribute in template alias.
1587         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1589         PR c++/80241 - ICE with alignas pack expansion.
1590         * error.c (dump_expr): Handle TREE_LIST.
1591         * parser.c (cp_parser_std_attribute_list): Return error_mark if
1592         make_pack_expansion returns an error.
1594 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1596         PR c++/80287
1597         * class.c (fixup_may_alias): Fix all type variants.
1599 2017-04-17  Jason Merrill  <jason@redhat.com>
1601         PR c++/80415 - wrong error with default arg and array reference.
1602         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1604         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1606 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
1608         * decl.c (name_unnamed_type): Split out of...
1609         (grokdeclarator): ... this.
1610         * decl.h (name_unnamed_type): Declare.
1612 2017-04-12  Richard Biener  <rguenther@suse.de>
1613         Bernd Edlinger  <bernd.edlinger@hotmail.de>
1615         PR middle-end/79671
1616         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1617         for arrays of character or std::byte type.
1619 2017-04-11  Jason Merrill  <jason@redhat.com>
1621         PR c++/80294 - ICE with constexpr and inheritance.
1622         * constexpr.c (reduced_constant_expression_p):
1623         A null constructor element is non-constant.
1624         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1625         returning an empty base.
1627 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
1629         PR c++/80370
1630         * decl.c (cp_finish_decomp): If processing_template_decl on
1631         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1632         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
1633         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1634         processing.
1635         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1636         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1637         dependent.
1639 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
1641         PR c++/80363
1642         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1644 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
1646         PR c++/80176
1647         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1648         operand, if it is a static member function, recurse on the
1649         BASELINK.
1651 2017-04-10  Marek Polacek  <polacek@redhat.com>
1653         PR sanitizer/80348
1654         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
1655         ORIG_TYPE earlier and not only when shortening.
1657 2017-04-07  Jason Merrill  <jason@redhat.com>
1659         PR c++/80356 - ICE with reference to function template argument.
1660         PR c++/79294
1661         * pt.c (convert_nontype_argument_function): Adjust type even with a
1662         value-dependent argument.
1664         PR c++/80267 - ICE with nested capture of reference
1665         PR c++/60992
1666         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1668 2017-04-07  Marek Polacek  <polacek@redhat.com>
1670         PR sanitizer/80348
1671         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1673         PR c++/80095
1674         * call.c (build_over_call): Don't check cxx_dialect.
1675         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1676         whether SUB is a CONSTRUCTOR.
1677         * init.c (build_new_1): Don't check cxx_dialect.
1678         * tree.c (replace_placeholders): Add a function comment.  Return if
1679         not in C++14, or if the object isn't a (member of a) class.
1680         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1681         TYPE is CLASS_TYPE_P.
1683 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
1685         PR c++/80309
1686         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1687         of a loop doing vec_safe_push of NULL.  Formatting fixes.
1688         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1689         to newidx before calling canonical_type_parameter on newtype.
1691 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
1693         PR c++/80296
1694         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1695         UNARY_PLUS_EXPR case.
1697 2017-04-03  Jason Merrill  <jason@redhat.com>
1699         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1701 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
1703         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1704         * decl2.c (one_static_initialization_or_destruction): Likewise.
1705         * name-lookup.c (store_bindings): Likewise.
1706         * parser.c (make_call_declarator): Likewise.
1707         * pt.c (check_explicit_specialization): Likewise.
1709 2017-04-03  Jason Merrill  <jason@redhat.com>
1711         PR sanitizer/79993 - ICE with VLA initialization from string
1712         PR c++/69487 - wrong VLA initialization from string
1713         * init.c (finish_length_check): Split out from build_vec_init.
1714         (build_vec_init): Handle STRING_CST.
1715         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1716         (digest_init_r): Don't give a STRING_CST VLA type.
1718 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
1720         PR c++/79572
1721         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1722         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
1723         for NOP_EXPR to REFERENCE_TYPE.
1725         PR libstdc++/80251
1726         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1727         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1728         CPTK_IS_AGGREGATE.
1729         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1730         Remove extraneous parens.
1731         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1732         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1733         (cp_parser_trait_expr): Likewise.
1735 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
1737         PR middle-end/80162
1738         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1739         * typeck.c (cxx_mark_addressable): Likewise.  Look through
1740         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1741         to ARRAY_TYPE.
1742         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1744 2017-03-24  Jason Merrill  <jason@redhat.com>
1746         PR c++/77339 - ICE with invalid use of alias template.
1747         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1748         alias template.
1750 2017-03-24  Marek Polacek  <polacek@redhat.com>
1752         PR c++/80119
1753         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1754         doesn't have side effects.
1756 2017-03-23  Jason Merrill  <jason@redhat.com>
1758         PR c++/80150 - ICE with overloaded variadic deduction.
1759         * pt.c (try_one_overload): Remove asserts.
1761         PR c++/77563 - missing ambiguous conversion error.
1762         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1764 2017-03-23  Marek Polacek  <polacek@redhat.com>
1766         * cp-tree.h: Remove a C_RID_YYCODE reference.
1768 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
1770         PR c++/80141
1771         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1772         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1773         processing_template_decl.
1775 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
1777         PR c++/77752
1778         * name-lookup.c (pushtag_1): Add check for bogus, non template,
1779         std::initializer_list.
1781 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
1783         PR c++/35878
1784         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1786 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
1788         PR c++/35878
1789         * init.c (std_placement_new_fn_p): New.
1790         (build_new_1): Call it.
1792 2017-03-20  Jason Merrill  <jason@redhat.com>
1794         PR c++/80096 - ICE with C++17 non-type auto.
1795         * pt.c (tsubst): Delay tsubst of type of template non-type
1796         parameter.
1798         PR c++/79519 - ICE with deleted template friend.
1799         * decl.c (grokdeclarator): Complain about misplaced function
1800         definition using =, as well.
1802         PR c++/79640 - infinite recursion with generic lambda.
1803         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1804         before substituting its initializer.
1806 2017-03-20  Marek Polacek  <polacek@redhat.com>
1807             Paolo Carlini  <paolo.carlini@oracle.com>
1809         PR c++/80059 - ICE with noexcept and __transaction_atomic
1810         * except.c (build_must_not_throw_expr): Call
1811         instantiate_non_dependent_expr.
1813 2017-03-19  Jason Merrill  <jason@redhat.com>
1815         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1816         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1817         reference decomposition.
1819         PR c++/80077 - error with constexpr and -fno-elide-constructors.
1820         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1821         expanding trivial constructor.
1823 2017-03-17  Jason Merrill  <jason@redhat.com>
1825         PR c++/78345 - ICE initializing array from lambda.
1826         * init.c (build_aggr_init): Check array initializer.
1827         (build_vec_init): Check the type of a CONSTRUCTOR.
1829         PR c++/80073 - C++17 ICE with virtual base.
1830         * decl.c (xref_basetypes): Also check for indirect vbases.
1832 2017-03-16  Jason Merrill  <jason@redhat.com>
1834         * decl.c (start_enum): std::byte aliases anything.
1836         PR c++/79797
1837         * constexpr.c (lookup_placeholder): Tweak.
1839 2017-03-15  Jason Merrill  <jason@redhat.com>
1841         PR c++/80043 - ICE with -fpermissive
1842         * typeck.c (convert_for_assignment): Handle instantiate_type
1843         not giving an error.
1845 2017-03-14  Nathan Sidwell  <nathan@acm.org>
1847         PR c++/79393 DR 1658 workaround
1848         * method.c (synthesized_method_base_walk): Inihibit abstract class
1849         virtual base access check here.
1850         (synthesized_method_walk): Not here.
1852 2017-03-13  Nathan Sidwell  <nathan@acm.org>
1854         PR c++/79393 DR 1658 workaround
1855         * method.c (synthesized_method_walk): Check vbases of abstract
1856         classes for dtor walk.
1858 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
1860         PR translation/79848
1861         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1863 2017-03-10  Jason Merrill  <jason@redhat.com>
1865         PR c++/79960 - alias templates and partial ordering
1866         * pt.c (comp_template_args): Add partial_order parm.
1867         (template_args_equal): Likewise.
1868         (comp_template_args_porder): New.
1869         (get_partial_spec_bindings): Use it.
1871 2017-03-10  Marek Polacek  <polacek@redhat.com>
1873         PR c++/79967
1874         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1876 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
1878         PR c++/79899
1879         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1880         Use XALLOCAVEC macro.
1882         PR c++/79896
1883         * decl.c (finish_enum_value_list): If value is error_mark_node,
1884         don't copy it and change its type.
1885         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1886         of CONST_DECL is error_mark_node.
1888 2017-03-09  Marek Polacek  <polacek@redhat.com>
1890         PR c++/79900 - ICE in strip_typedefs
1891         * tree.c (strip_typedefs): Skip the attribute handling if T is
1892         a variant type which hasn't been updated yet.
1894         PR c++/79687 - wrong code with pointer-to-member
1895         * init.c (constant_value_1): Break if the variable has a dynamic
1896         initializer.
1898 2017-03-08  Jason Merrill  <jason@redhat.com>
1900         PR c++/79797 - ICE with self-reference in array DMI.
1901         * constexpr.c (lookup_placeholder): Split out...
1902         (cxx_eval_constant_expression): ...from here.
1904 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
1906         PR c/79834
1907         * parser.c (cp_parser_omp_cancellation_point,
1908         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1909         cp_parser_omp_target_update): Change "may only be used in compound
1910         statements" diagnostics, such that the same translatable string is
1911         used for all pragmas.
1912         (cp_parser_pragma): Likewise.  Use error_at instead of
1913         cp_parser_error for that diagnostics.
1915 2017-03-06  Marek Polacek  <polacek@redhat.com>
1917         PR c++/79796 - ICE with NSDMI and this pointer
1918         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1919         replace_placeholders.
1921 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
1923         PR c++/79822
1924         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1925         ({ (void) 0; }).
1927 2017-03-06  Jason Merrill  <jason@redhat.com>
1929         Revert "Allow deduction guides to look into primary template."
1930         * cp-tree.h, parser.c, pt.c, search.c: Revert.
1932 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
1934         PR c++/70266
1935         * except.c (build_must_not_throw_expr): Perform the implicit
1936         conversions on the condition.
1938 2017-03-03  Jason Merrill  <jason@redhat.com>
1940         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1941         -Wc++1z-compat.
1943         Core issues 2273 and 2277
1944         * call.c (joust): Adjust using-declaration tiebreaker to handle
1945         the intermediate base case.
1946         * method.c (strip_inheriting_ctors): Just return the argument if
1947         !flag_new_inheriting_ctors.
1949 2017-03-03  Richard Biener  <rguenther@suse.de>
1951         PR c++/79825
1952         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1954 2017-03-03  Marek Polacek  <polacek@redhat.com>
1956         PR c++/79791
1957         * typeck.c (string_conv_p): In C++11, always call pedwarn with
1958         OPT_Wwrite_strings.
1960 2017-03-02  Jason Merrill  <jason@redhat.com>
1962         Update overload resolution with deduction guides.
1963         * pt.c (do_class_deduction): Always build the copy guide.
1964         (copy_guide_p, template_guide_p): New.
1965         (build_deduction_guide): Remember the original constructor.
1966         * call.c (joust): Prefer the copy guide and non-template guides.
1968         Allow deduction guides to look into primary template.
1969         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1970         (struct cp_decl_specifier_seq): Add constructor_p.
1971         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1972         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
1973         Clear deduction_guide_type.  Don't handle deduction guide names.
1974         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1975         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
1976         (cp_parser_member_declaration, cp_parser_cache_defarg)
1977         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1978         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1979         (build_deduction_guide): Set deduction_guide_type.
1980         (dependent_scope_p): Check deduction_guide_type.
1981         * search.c (lookup_member): Likewise.
1983 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
1985         PR c++/79782
1986         * init.c (mark_exp_read_r): New function.
1987         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1988         whole arguments instead of plain mark_exp_read on TREE_LIST values.
1990 2017-03-01  Jason Merrill  <jason@redhat.com>
1992         Class template argument deduction in new-expression
1993         * init.c (build_new): Handle deduction from no initializer.
1994         * parser.c (cp_parser_new_expression): Don't require a single
1995         expression for class template deduction.
1996         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1997         class template placeholder.
1998         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1999         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2000         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2002 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
2004         PR c++/79746
2005         * init.c (emit_mem_initializers): When not constructing vbases of
2006         abstract classes, mark arguments as read for
2007         -Wunused-but-set-parameter.
2009 2017-02-28  Jason Merrill  <jason@redhat.com>
2011         Class template argument deduction refinements
2012         * call.c (joust): Move deduction guide tiebreaker down.
2013         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2014         deduction with no initializer.
2015         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2016         (do_class_deduction): Use that rather than special case.
2017         (do_auto_deduction): Handle null initializer.
2019 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
2021         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2022         instead of just cond ? "..." : "...".
2023         (grokdeclarator): Likewise.
2024         (build_enumerator): Likewise.
2025         * init.c (build_new_1): Likewise.
2026         * call.c (build_new_method_call_1): Likewise.
2027         * parser.c: Include intl.h.
2028         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2029         "enter"/"exit" keyword.
2030         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2031         message.
2033 2017-02-27  Jason Merrill  <jason@redhat.com>
2035         PR c++/71568 - SFINAE forming pointer to member function
2036         * init.c (build_offset_ref): Check the return value of
2037         perform_or_defer_access_check.
2039 2017-02-27  Marek Polacek  <polacek@redhat.com>
2041         * decl.c (expand_static_init): Add missing } in a comment.
2043 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
2045         * init.c: Include intl.h.
2046         (build_new_1): Move message strings into pedwarn to make them
2047         -Wformat-security friendly. Mark string for translation.
2048         * pt.c (tsubst_copy_and_build): Mark string for translation.
2049         Make the pointer const.
2050         * semantics.c (finish_id_expression): Mark strings for translation.
2052 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
2054         * call.c (build_op_delete_call): Make msg1 and msg2 const.
2056 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
2058         PR c++/79588
2059         * call.c (build_over_call): Call check_function_arguments even for
2060         -Wrestrict, adjust check_function_arguments caller.
2061         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2062         here.
2063         * typeck.c (cp_build_function_call_vec): Adjust
2064         check_function_arguments caller.
2066 2017-02-24  Marek Polacek  <polacek@redhat.com>
2068         PR translation/79705
2069         * decl.c (check_redeclaration_exception_specification): Mark a string
2070         for translation.  Make the pointer const.
2072 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
2074         PR c++/79361
2075         * pt.c (register_specialization): Check duplicate_decls return value
2076         for error_mark_node and pass it back.
2078 2017-02-22  Jason Merrill  <jason@redhat.com>
2080         PR c++/79679 - missing destructor for argument
2081         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2082         conversions.
2084         * pt.c (do_class_deduction): Handle 0 argument case.
2086 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
2088         PR c++/79664
2089         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2090         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2091         * constexpr.c (potential_constant_expression_1): Handle
2092         OMP_*, OACC_* and CILK_* trees.  Use error_at with
2093         EXPR_LOC_OR_LOC (t, input_location) computed early
2094         instead of error, or error_at with location_of (t).
2096 2017-02-22  Marek Polacek  <polacek@redhat.com>
2098         PR c++/79653
2099         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2100         if the alignas expression is erroneous.
2101         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2102         error_mark_node.
2104         PR c++/79657
2105         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2107 2017-02-21  Jason Merrill  <jason@redhat.com>
2109         PR c++/50308 - wrong deprecated warning with ADL
2110         PR c++/17729 - duplicate deprecated warning
2111         * semantics.c (finish_id_expression): Only call mark_used on a
2112         function if we aren't building a call.
2114         PR c++/41727 - ICE with partial spec of partial instantiation
2115         * pt.c (process_partial_specialization): For now, don't check more
2116         specialized if there is more than one level of args.
2118 2017-02-21  Marek Polacek  <polacek@redhat.com>
2120         PR c++/79535
2121         * cp-tree.h (maybe_reject_flexarray_init): Declare.
2122         * init.c (maybe_reject_flexarray_init): No longer static.
2123         Add check for current_function_decl.
2124         * parser.c (cp_parser_late_parse_one_default_arg): Reject
2125         a default mem-initializer for a flexible array.
2127 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
2128             Paolo Carlini  <paolo.carlini@oracle.com>
2130         PR c++/79654
2131         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2132         on error.
2133         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2134         decl after the decomposition artificial decl has error_mark_node.
2135         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2136         instead of just == error_mark_node comparison.
2138 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
2140         PR sanitizer/79589
2141         * decl.c: Include gimplify.h.
2142         (cp_finish_decomp): Make sure there is no sharing of trees
2143         in between DECL_VALUE_EXPR of decomposition decls.
2145         PR c++/79655
2146         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2148         PR c++/79639
2149         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2150         call cplus_expand_constant on it first.
2152 2017-02-19  Jason Merrill  <jason@redhat.com>
2154         PR c++/78139 - destructor needed by new-expression
2155         * call.c (build_special_member_call): Use tf_no_cleanup.
2157         PR c++/78282 - auto template and pack expansion
2158         * pt.c (find_parameter_packs_r): Don't walk into the type of
2159         templates other than template template-parameters.
2161         PR c++/79606 - ICE with this->base_member in NSDMI
2162         * class.c (build_base_path): Check processing_template_decl.
2164         PR c++/79607 - ICE with T{} initializer
2165         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2167         PR c++/79566 - elaborated-type-specifier in range for
2168         * parser.c (cp_parser_simple_declaration): Fix check for type
2169         definition.
2171         PR c++/79400 - confusing suggestion of 'noexcept'
2172         * parser.c (cp_parser_exception_specification_opt): Remove
2173         suggestion for deprecated dynamic exception-specification.
2175         PR c++/79470 - partial ordering with reference parameters
2176         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2178         PR c++/79500 - ICE with non-template deduction guide
2179         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2180         DECL_TEMPLATE_RESULT.
2182         PR c++/79580 - ICE with compound literal
2183         * parser.c (cp_parser_class_head): If we're in the middle of an
2184         expression, use ts_within_enclosing_non_class.
2186         PR c++/79503 - inherited ctor taking base class
2187         * call.c (add_function_candidate): Also check that
2188         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2190 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
2192         PR c++/79380
2193         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2194         argument.
2196 2017-02-19  Eric Fiselier  <eric@efcs.ca>
2197             Jonathan Wakely  <jwakely@redhat.com>
2199         PR c++/69523
2200         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2201         control warning about literal suffix identifiers without a leading
2202         underscore.
2204 2017-02-17  Jason Merrill  <jason@redhat.com>
2206         PR c++/79508 - lookup error with member template
2207         * parser.c (cp_parser_template_name): Clear
2208         parser->context->object_type if we aren't doing lookup.
2210         PR c++/78690 - ICE with using and global type with same name
2211         * pt.c (type_dependent_object_expression_p): True for
2212         IDENTIFIER_NODE.
2214         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2215         * pt.c (convert_template_argument): Just return an auto arg pack.
2216         (tsubst_template_args): Don't tsubst an auto pack type.
2218         PR c++/79556 - C++17 ICE with non-type auto
2219         * pt.c (do_auto_deduction): Don't try to deduce from null type.
2221         PR c++/79533 - C++17 ICE with temporary cast to reference
2222         * call.c (build_over_call): Conversion to a reference prevents copy
2223         elision.
2225 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
2226             Jason Merrill  <jason@redhat.com>
2228         PR c++/79502 - lost nodiscard attribute
2229         * pt.c (apply_late_template_attributes): Do apply non-dependent
2230         attributes to types.
2232 2017-02-16  Jason Merrill  <jason@redhat.com>
2234         PR c++/78572 - ICE with self-modifying array initializer
2235         * constexpr.c (cxx_eval_store_expression): The object we're
2236         initializing is outside the constant-expression.
2237         (cxx_eval_call_expression): Set ctx->call.
2239         PR c++/79050 - ICE with undeduced auto and LTO
2240         * decl.c (poplevel): Remove undeduced auto decls.
2242 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
2244         PR c++/79512
2245         * parser.c (cp_parser_omp_target): For -fopenmp-simd
2246         ignore #pragma omp target even when not followed by identifier.
2248 2017-02-15  Jason Merrill  <jason@redhat.com>
2249             Jakub Jelinek  <jakub@redhat.com>
2251         PR c++/79464 - ICE in IPA with omitted constructor parms
2252         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2253         (adjust_clone_args): Adjust.
2254         (add_method): Remember omitted parms.
2255         * call.c (add_function_candidate): Likewise.
2256         * mangle.c (write_method_parms): Likewise.
2257         * method.c (ctor_omit_inherited_parms): Return false if there are no
2258         parms to omit.
2260 2017-02-15  Martin Sebor  <msebor@redhat.com>
2262         PR c++/79363
2263         * init.c (maybe_reject_flexarray_init): New function.
2264         (perform_member_init): Call it.
2266 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
2268         PR c++/79301
2269         * parser.c (cp_parser_std_attribute): Don't pedwarn about
2270         [[deprecated]] with -std=c++11 and [[fallthrough]] with
2271         -std=c++11 and -std=c++14.
2273         PR c++/79288
2274         * decl.c (grokdeclarator): For static data members, handle thread_p
2275         only after handling inline.
2277 2017-02-14  Marek Polacek  <polacek@redhat.com>
2279         PR c++/79420
2280         PR c++/79463
2281         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2282         clobbering if the postfix expression isn't an EXPR_P.
2284 2017-02-13  Jason Merrill  <jason@redhat.com>
2286         PR c++/79461 - ICE with lambda in constexpr constructor
2287         * constexpr.c (build_data_member_initialization): Ignore
2288         initialization of a local variable.
2290 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
2292         * init.c (warn_placement_new_too_small): Add missing space in
2293         diagnostics.
2294         * parser.c (cp_parser_oacc_declare): Likewise.
2295         * mangle.c (maybe_check_abi_tags): Likewise.
2297         PR c++/79232
2298         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2299         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2300         in the rightmost operand.
2302 2017-02-13  Nathan Sidwell  <nathan@acm.org>
2304         PR c++/79296 - ICE mangling localized template instantiation
2305         * decl2.c (determine_visibility): Use template fn context for
2306         local class instantiations.
2308 2017-02-11  Jason Merrill  <jason@redhat.com>
2310         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2311         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2312         (build_new_1): Use replace_placeholders.
2313         * tree.c (replace_placeholders_t): Also track whether we've seen a
2314         placeholder.
2315         (replace_placeholders, replace_placeholders_r): Adjust.
2316         * cp-tree.h: Adjust.
2318         PR c++/77790 - ICE with auto function in C++11 mode
2319         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2320         (require_deduced_type): Add complain parm, return bool.
2321         * cp-tree.h: Adjust.
2322         * decl2.c (mark_used): Use require_deduced_type.
2324 2017-02-10  Jason Merrill  <jason@redhat.com>
2326         PR c++/78908 - template ops and bitfields
2327         * tree.c (build_min_non_dep): Use unlowered_expr_type.
2329         PR c++/78897 - constexpr union
2330         * constexpr.c (cxx_eval_store_expression): A store to a union member
2331         erases a previous store to another member.
2333         PR c++/71285 - member of fold-expression
2334         * semantics.c (finish_unary_fold_expr)
2335         (finish_binary_fold_expr): Use null type for fold-expressions.
2337         PR c++/79401 - protected inherited constructor
2338         * call.c (enforce_access): For inheriting constructor, find a base
2339         binfo in the path we already have.
2341 2017-02-10  Marek Polacek  <polacek@redhat.com>
2343         PR c++/79435
2344         * pt.c (type_dependent_expression_p): Check if the expression type
2345         is null.
2347         PR c++/79184
2348         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2349         if warnings shouldn't be given.
2351 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
2353         PR c++/71737
2354         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2355         an error_mark_node as type.
2357 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2358             Jason Merrill  <jason@redhat.com>
2360         PR c++/79143
2361         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2362         from pattern to type.
2364 2017-02-09  Jason Merrill  <jason@redhat.com>
2366         PR c++/79316 - default argument in deduction guide
2367         PR c++/79350 - explicit deduction guide
2368         * parser.c (cp_parser_constructor_declarator_p)
2369         (cp_parser_direct_declarator): Parse deduction guides more like
2370         constructors.
2371         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2372         * tree.c (special_function_p): Return it.
2373         * decl.c (check_special_function_return_type): Handle it.
2374         (grokdeclarator, grokfndecl): Adjust.
2375         (cp_finish_decl): Pass flags to do_auto_deduction.
2376         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2377         * pt.c (dguide_name_p): Take a const_tree.
2378         (do_class_deduction): Handle explicit.
2379         (do_auto_deduction): Pass flags through.
2380         (build_deduction_guide): Copy explicit flag.
2382 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2384         PR c++/79429
2385         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2386         non-pragma_compound context here.
2387         (cp_parser_omp_target): Likewise.
2388         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2389         parsing for ordered and target omp pragmas in non-pragma_stmt
2390         non-pragma_compound contexts.
2392         PR c/79431
2393         * parser.c (cp_parser_oacc_declare): Formatting fix.
2394         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2395         automatic variables.
2397 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
2398             Chung-Lin Tang  <cltang@codesourcery.com>
2400         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
2401         parsing.  Parse constant expression. Remove semantic checking.
2402         (cp_parser_omp_clause_collapse): Disallow tile.
2403         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
2404         error about missing for after already emitting one.  Use more
2405         conventional for idiom for unbounded loop.
2406         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2407         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2408         (finish_omp_for): Deal with tile clause.
2410 2017-02-07  Nathan Sidwell  <nathan@acm.org>
2412         * method.c (synthesized_method_base_walk): New.  Broken out of ...
2413         (synthesized_method_walk): ... here.  Call it.  Cleanup
2414         initializations.
2416 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
2418         PR c++/79360
2419         * typeck2.c (process_init_constructor_union): Consider only
2420         FIELD_DECLs when looking for an NSDMI.
2422 2017-02-06  Jason Merrill  <jason@redhat.com>
2424         PR c++/71193 - incomplete types in templates
2425         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2426         handle incomplete type by pedwarning and then treating as dependent.
2428 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
2430         PR c++/79379
2431         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2432         (potential_constant_expression_1): Likewise.
2434         PR c++/79377
2435         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2436         allow one fewer than expected arguments if flag_permissive.
2438         PR c++/79372
2439         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2440         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2441         with error_mark_node type.
2443 2017-02-03  Jason Merrill  <jason@redhat.com>
2445         PR c++/78689 - ICE on constructor with label
2446         * optimize.c (maybe_clone_body): Replace omitted parameters with
2447         null lvalues.
2448         * class.c (build_clone): Fix logic for omitting inherited parms.
2450         PR c++/12245 - excessive memory use
2451         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2452         back in.  Don't cache constants.
2453         (maybe_constant_init): Don't cache constants.
2455         PR c++/79294 - ICE with invalid template argument
2456         * pt.c (convert_nontype_argument_function): Check value-dependence.
2457         (convert_nontype_argument): Don't check it here for function ptrs.
2459 2017-02-02  Richard Biener  <rguenther@suse.de>
2461         PR cp/14179
2462         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2463         it lazily on the first changed element only and copy it
2464         fully upfront, only storing changed elements.
2466 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
2468         PR c++/69637
2469         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2470         to the width.
2472 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
2474         PR c++/79304
2475         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2476         after ARROW_EXPR.
2478 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
2480         PR c++/79298
2481         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2482         any namespace aliases.
2484 2017-01-31  Nathan Sidwell  <nathan@acm.org>
2486         PR c++/79290
2487         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2489         PR c++/67273
2490         PR c++/79253
2491         * pt.c: (instantiate_decl): Push to top level when current
2492         function scope doesn't match.  Only push lmabda scope stack when
2493         pushing to top.
2495         * cp-tree.h (instantiate_decl): Make defer_ok bool.
2496         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2497         (instantiate_decl): Simplify and reorder state saving and restoration.
2499         PR c++/79264
2500         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2501         * semantics.c (finish_member_declaration): Assert class is being
2502         defined.
2504 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
2506         Introduce C++ support in libcc1.
2507         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2508         (ansi_opname): Rename to...
2509         (cp_operator_id): ... this.  Adjust all callers.
2510         (ansi_assopname): Rename to...
2511         (cp_assignment_operator_id): ... this.  Adjust all callers.
2512         (cp_literal_operator_id): Declare.
2513         (set_global_friend): Declare.
2514         (is_global_friend): Declare.
2515         (enum cp_oracle_request): New type.
2516         (cp_binding_oracle_function): New type.
2517         (cp_binding_oracle): Declare.
2518         (cp_finish_injected_record_type): Declare.
2519         * friend.c (global_friend): New var.
2520         (set_global_friend): New fn.
2521         (is_global_friend): New fn.
2522         (is_friend): Call is_global_friend.
2523         * name-lookup.c (cp_binding_oracle): New var.
2524         (query_oracle): New fn.
2525         (qualified_lookup_using_namespace): Call query_oracle.
2526         (lookup_name_real_1): Likewise.
2527         * parser.c (cp_literal_operator_id): Drop static.
2528         * search.c (friend_accessible_p): Call is_global_friend.
2529         * semantics.c (is_this_parameter): Accept a variable if the
2530         binding oracle is enabled.
2532 2017-01-27  Jason Merrill  <jason@redhat.com>
2534         PR c++/78771 - ICE with inherited constructor.
2535         * call.c (build_over_call): Call deduce_inheriting_ctor here.
2536         * pt.c (tsubst_decl): Not here.
2537         * class.c (add_method): Or here.
2538         * method.c (deduce_inheriting_ctor): Handle clones.
2539         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2541 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
2543         PR c++/64382
2544         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2545         New function.
2546         * cp/cp-tree.h: Declare it.
2547         * cp/semantics.c (finish_id_expression): Resolve names within a default
2548         capturing generic lambda defined within a template prior to
2549         instantiation to allow for captures to be added to the closure type.
2551 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
2553         PR c++/68727
2554         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2555         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2556         * parser.c (cp_parser_builtin_offsetof): Pass result of
2557         build_static_cast of null_pointer_node to finish_offsetof.
2558         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2559         it for -Winvalid-offsetof pedwarn instead of trying to guess
2560         original offsetof type from EXPR.  Save OBJECT_PTR as a new
2561         second operand to OFFSETOF_EXPR.
2562         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2563         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2564         as OBJECT_PTR.
2566 2017-01-26  Jason Merrill  <jason@redhat.com>
2568         * name-lookup.c (parse_using_directive): Deprecate strong using.
2570         PR c++/79176 - lambda ICE with -flto -Os
2571         * decl2.c (vague_linkage_p): Handle decloned 'tors.
2572         * tree.c (decl_linkage): Likewise.
2574 2017-01-25  Martin Sebor  <msebor@redhat.com>
2576         * decl.c (grokdeclarator): Fix a typo in a comment.
2578 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
2580         PR c++/78896
2581         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2582         lambda expressions.
2584         PR c++/77914
2585         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2586         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2588 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
2590         PR lto/79061
2591         * decl.c (cxx_init_decl_processing): Pass main_input_filename
2592         to build_translation_unit_decl.
2594 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
2596         PR c++/79205
2597         * cp-gimplify.c (cp_genericize_r): Add result of
2598         convert_from_reference on invisiref parm to p_set.
2600 2017-01-24  Nathan Sidwell  <nathan@acm.org>
2602         PR c++/78469 - defaulted ctor and inaccessible dtor
2603         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2604         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2605         * tree.c (build_target_expr): Check tf_no_cleanup.
2607         PR c++/79118 - anon-members and constexpr
2608         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2609         ctor decl.  Recursively check anonymous members.
2610         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2611         call.
2612         (explain_invalid_constexpr_fn): Likewise.
2614 2017-01-23  Nathan Sidwell  <nathan@acm.org>
2616         PR c++/71710 - template using directive of field
2617         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2618         check earlier.
2620         PR c++/71406 - ICE with scope-ref'd template id exprs
2621         PR c++/77508
2622         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2623         before breaking up TEMPLATE_ID_EXPR.
2625 2017-01-20  Nathan Sidwell  <nathan@acm.org>
2627         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2628         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2630 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
2632         PR c++/77829
2633         PR c++/78656
2634         * cp-tree.h (suggest_alternatives_for): Add bool param.
2635         (suggest_alternative_in_explicit_scope): New decl.
2636         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2637         that isn't the global one, call new function
2638         suggest_alternative_in_explicit_scope, only calling
2639         suggest_alternatives_for if it fails, and disabling near match
2640         searches fort that case.  When SCOPE is the global namespace,
2641         pass true for new param to suggest_alternatives_for to allow for
2642         fuzzy name lookups.
2643         * lex.c (unqualified_name_lookup_error): Pass true for new param
2644         to suggest_alternatives_for.
2645         * name-lookup.c (consider_binding_level): Add forward decl.
2646         (suggest_alternatives_for): Add "suggest_misspellings" param,
2647         using it to conditionalize the fuzzy name-lookup code.
2648         (suggest_alternative_in_explicit_scope): New function.
2649         * parser.c (cp_parser_primary_expression): When calling
2650         finish_id_expression, pass location of id_expression rather
2651         than that of id_expr_token.
2652         (cp_parser_id_expression): Convert local "unqualified_id" from
2653         tree to cp_expr to avoid implicitly dropping location information.
2655 2017-01-20  Marek Polacek  <polacek@redhat.com>
2657         PR c/64279
2658         * call.c (build_conditional_expr_1): Warn about duplicated branches.
2659         * semantics.c (finish_expr_stmt): Build statement using the proper
2660         location.
2662 2017-01-19  Jason Merrill  <jason@redhat.com>
2664         US 20 - forwarding references and class template argument deduction
2665         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2666         * pt.c (push_template_decl_real): Set it.
2667         (maybe_adjust_types_for_deduction): Check it.
2668         (rewrite_template_parm): Copy it.
2670         US 19 - deduction guides and constructors
2671         * call.c (joust): Prefer deduction guides to constructors.
2672         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2673         (deduction_guide_p): Check DECL_P.
2675         * decl.c (check_initializer): Always use build_aggr_init for array
2676         decomposition.
2678         PR c++/79130 - decomposition and direct-initialization
2679         * init.c (build_aggr_init): Communicate direct-initialization to
2680         build_vec_init.
2681         (build_vec_init): Check for array copy sooner.
2682         * parser.c (cp_parser_decomposition_declaration): Remove call to
2683         build_x_compound_expr_from_list.
2685 2017-01-18  Jason Merrill  <jason@redhat.com>
2687         PR c++/68666 - member variable template-id
2688         * typeck.c (finish_class_member_access_expr): Handle variable
2689         template-id.
2690         * pt.c (lookup_and_finish_template_variable): No longer static.
2691         * cp-tree.h: Declare it.
2693 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2695         PR c++/78488
2696         * call.c (build_over_call): When checking ellipsis conversions for
2697         an inherited ctor, make sure there is at least one conversion.
2699 2017-01-18  Jason Merrill  <jason@redhat.com>
2701         PR c++/78894 - ICE with class deduction and default arg
2702         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2704 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2706         PR c++/77489
2707         * mangle.c (write_discriminator): Reorganize abi warning check.
2709 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2711         * cp-tree.h: Clarify exception spec node comment.
2712         * except.c (nothrow_spec_p): Simplify by checking node-equality.
2714         PR c++/79091
2715         * mangle.c (write_exception_spec): Check nothrow explicitly.
2716         (write_encoding): Don't increment processing_template_decl around
2717         encoding.
2719 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2721         PR c++/70182
2722         * mangle.c (write_template_args): Add "on" for operator names.
2724 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2726         PR c++/77489
2727         * mangle.c (write_discriminator): Handle discriminator >= 10.
2729 2017-01-17  Nathan Sidwell  <nathan@acm.org>
2731         PR c++/61636
2732         * cp-tree.h (maybe_generic_this_capture): Declare.
2733         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2734         (maybe_resolve_dummy): ... here.  Call it.
2735         (maybe_generic_this_capture): New.
2736         * parser.c (cp_parser_postfix_expression): Speculatively capture
2737         this in generic lambda in unresolved member function call.
2738         * pt.c (tsubst_copy_and_build): Force hard error from failed
2739         member function lookup in generic lambda.
2741 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
2743         PR c++/70565
2744         * cp-array-notation.c (expand_array_notation_exprs): Handle
2745         OMP_PARALLEL.
2747 2017-01-11  Jason Merrill  <jason@redhat.com>
2749         PR c++/78337 - ICE on invalid with generic lambda
2750         * semantics.c (process_outer_var_ref): Check if containing_function
2751         is null.  Move inform call under complain test.
2753 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2755         PR c++/77812
2756         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2757         is a new overload.
2759 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2761         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2763 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
2765         PR c++/78341
2766         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2767         assertion.  Formatting fix.
2769         PR c++/72813
2770         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2771         writing PCH file.
2773 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
2775         PR c++/77949
2776         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2777         a missing semicolon if we have a valid insertion location for
2778         the fix-it hint.
2780 2017-01-10  Jason Merrill  <jason@redhat.com>
2782         FI 20, decomposition declaration with parenthesized initializer.
2783         * parser.c (cp_parser_decomposition_declaration): Use
2784         cp_parser_initializer.
2786 2017-01-09  Jason Merrill  <jason@redhat.com>
2788         Implement P0195R2, C++17 variadic using.
2789         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2790         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2791         * error.c (dump_decl): Likewise.
2793 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
2795         PR translation/79019
2796         PR translation/79020
2797         * semantics.c (finish_omp_clauses): Add missing whitespace to
2798         translatable strings.
2799         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2801 2017-01-07  Jason Merrill  <jason@redhat.com>
2803         PR c++/78948 - instantiation from discarded statement
2804         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2805         * cp-tree.h (in_discarded_stmt): Declare it.
2806         (struct saved_scope): Add discarded_stmt bitfield.
2807         (in_discarded_stmt): New macro.
2808         * decl2.c (mark_used): Check it.
2809         * parser.c (cp_parser_selection_statement): Adjust.
2810         (cp_parser_jump_statement): Adjust.
2812 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
2814         PR c++/78931
2815         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2816         REFERENCE_REF_P, set tt to its operand.
2818         PR c++/78890
2819         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2820         unions even for C++11 and later.
2822 2017-01-05  Nathan Sidwell  <nathan@acm.org>
2824         PR c++/78765
2825         * pt.c (convert_nontype_argument): Don't try and see if integral
2826         or enum expressions are constants prematurely.
2828 2017-01-04  Marek Polacek  <polacek@redhat.com>
2830         PR c++/64767
2831         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2832         a zero character literal.
2834 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
2836         PR c++/78949
2837         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2838         vector type.
2840         PR c++/78693
2841         * parser.c (cp_parser_simple_declaration): Only complain about
2842         inconsistent auto deduction if auto_result doesn't use auto.
2844         * parser.c (cp_parser_simple_declaration): Diagnose function
2845         declaration among more than one init-declarators with auto
2846         specifier.
2848         PR c++/71182
2849         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2850         assertion, as lexer->buffer may be NULL.
2852 2017-01-04  Marek Polacek  <polacek@redhat.com>
2854         PR c++/77545
2855         PR c++/77284
2856         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2858 2017-01-04  Nathan Sidwell  <nathan@acm.org>
2860         PR c++/66735
2861         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2862         (lambda_capture_field_type): Update prototype.
2863         * lambda.c (lambda_capture_field_type): Add is_reference parm.
2864         Add referenceness here.
2865         (add_capture): Adjust lambda_capture_field_type call, refactor
2866         error checking.
2867         * pt.c (tsubst): Adjust lambda_capture_field_type call.
2869 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
2871         Update copyright years.
2873 Copyright (C) 2017 Free Software Foundation, Inc.
2875 Copying and distribution of this file, with or without modification,
2876 are permitted in any medium without royalty provided the copyright
2877 notice and this notice are preserved.