PR bootstrap/81216
[official-gcc.git] / gcc / cp / ChangeLog
blob53aadf4ac44cc78c1396cab230722b30bebecc08
1 2017-06-27  Marek Polacek  <polacek@redhat.com>
3         PR bootstrap/81216
4         * parser.c (cp_parser_already_scoped_statement): Initialize
5         LOC_AFTER_LABELS.
7 2017-06-26  Jason Merrill  <jason@redhat.com>
9         PR c++/81215 - deduction failure with variadic TTP.
10         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
12 2017-06-26  Martin Sebor  <msebor@redhat.com>
14         PR c++/81169
15         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
16         to detect casting away cv-qualifiers.
18 2017-06-26  Nathan Sidwell  <nathan@acm.org>
20         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
21         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
22         identifier.
23         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
24         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
25         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
26         * decl.c (grok_op_properties): Adjust identifier checking.
27         * init.c (expand_default_init): Adjust identifier descision.
28         * method.c (implicitly_declare_fn): Don't use
29         DECL_ASSIGNMENT_OPERATOR_P.
30         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
31         IDENTIFIER_DTOR_P.
32         * call.c (in_charge_arg_for_name): Reimplement.
33         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
34         IDENTIFIER_DTOR_P.
36 2017-06-26  Marek Polacek  <polacek@redhat.com>
38         PR c/80116
39         * parser.c (cp_parser_statement): Add a default argument.  Save the
40         location of the expression-statement after labels have been parsed.
41         (cp_parser_implicitly_scoped_statement): Set the location of the
42         body of the conditional after parsing all the labels.  Call
43         warn_for_multistatement_macros.
44         (cp_parser_already_scoped_statement): Likewise.
46 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
48         PR c++/62315
49         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
50         'typename' in error messages about missing 'typename'.
52 2017-06-23  Jason Merrill  <jason@redhat.com>
54         PR c++/79056 - C++17 ICE with invalid template syntax.
55         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
56         is a TYPE_DECL.
57         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
58         * pt.c (template_placeholder_p): New.
59         * cp-tree.h: Declare it.
61 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
63         * decl.c (duplicate_decls): Use builtin_structptr_types.
65 2017-06-22  Nathan Sidwell  <nathan@acm.org>
67         Reorder IDENTIFIER flags
68         gcc/cp/
69         * cp-tree.h (enum cp_identifier_kind): New.
70         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
71         IDENTIFIER_KIND_BIT_2): New.
72         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
73         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
74         (C_IS_RESERVED_WORD): Replace with ...
75         (IDENTIFIER_KEYWORD_P): ... this.
76         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
77         (IDENTIFIER_CDTOR_P): ... this.
78         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
79         (IDENTIFIER_OPNAME_P): Replace with ...
80         (IDENTIFIER_ANY_OP_P): ... this.
81         (IDENTIFIER_ASSIGN_OP_P): New.
82         (IDENTIFIER_TYPENAME_P): Replace with ...
83         (IDENTIFIER_CONV_OP_P): ... this.
84         (NEW_DELETE_OPNAME_P): Replace with ...
85         (IDENTIFIER_NEWDEL_OP_P): ... this.
86         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
87         (get_identifier_kind_name, set_identifier_kind): Declare.
88         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
89         (init_operators): Adjust to avoid keywords, use
90         set_identifier_kind. Copy TYPE_EXPR slot.
91         (init_reswords): Call set_identifier_kind.
92         (unqualified_name_lookup_error): Adjust.
93         * operators.def (TYPE_EXPR): Remove.
94         * decl.c (struct predefined_identifier): Move into ...
95         (initialize_predefined_identifiers): ... here.  Call
96         set_identifier_kind.
97         (grokfndecl, check_var_type, grokdeclarator): Adjust.
98         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
99         space.  Adjust.
100         * call.c (name_as_c_string): Adjust.
101         (build_new_method_call_1): Likewise.
102         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
103         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
104         * dump.c (cp_dump_tree): Adjust.
105         * error.c (dump_decl_name): Adjust.
106         * mangle.c (write_unqualified_id, write_member_name,
107         write_expression): Adjust.
108         (mangle_conv_op_name_for_type): Use set_identifier_kind.
109         * name-lookup.c (do_class_using_decl): Adjust.
110         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
111         * parser.c (cp_lexer_get_preprocessor_token,
112         cp_parser_direct_declarator): Likewise.
113         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
114         tsubst_copy, tsubst_copy_and_build): Adjust.
115         * ptree.c (cxx_print_identifier): Print identifier kind.
116         * search.c (lookup_field_r, lookup_member,
117         lookup_fnfields_idx_nolazy): Adjust.
118         * semantics.c (finish_id_expression): Adjust..
119         * typeck.c (cp_build_addr_expr_1): Adjust.
121 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
123         PR c++/81154
124         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
125         Complain about t not being a variable if t is OVERLOAD even
126         when processing_template_decl.
128 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
130         * parser.c (get_cast_suggestion): New function.
131         (maybe_add_cast_fixit): New function.
132         (cp_parser_cast_expression): Capture the location of the closing
133         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
134         about old-style casts.
136 2017-06-20  Jason Merrill  <jason@redhat.com>
138         PR c++/80972 - C++17 ICE with attribute packed.
139         * call.c (build_over_call): Allow a TARGET_EXPR from reference
140         binding.
142 2017-06-20  Nathan Sidwell  <nathan@acm.org>
144         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
145         (nelts_identifier): Delete.
146         * decl.c (initialize_predefined_identifiers): Remove nelts.
148         PR c++/67074 - namespace aliases
149         * decl.c (duplicate_decls): Don't error here on mismatched
150         namespace alias.
151         * name-lookup.c (name_lookup::add_value): Matching namespaces are
152         not ambiguous.
153         (diagnose_name_conflict): Namespaces are never redeclarations.
154         (update_binding): An alias can match a real namespace.
156 2017-06-19  Jason Merrill  <jason@redhat.com>
158         PR c++/80562 - ICE with constexpr if.
159         * semantics.c (finish_if_stmt_cond): Call
160         instantiate_non_dependent_expr.
162         PR c++/80829 - ICE with constexpr copy of base subobject.
163         * constexpr.c (clear_no_implicit_zero): New.
164         (cxx_eval_call_expression): Call it.
166 2017-06-19  Nathan Sidwell  <nathan@acm.org>
168         PR c++/81124
169         PR c++/79766
170         * name-lookup.c (set_decl_namespace): Don't follow using
171         directives and ignore using decls.  Only check overly-explicit
172         scope after discovering decl.
174 2017-06-19  Jason Merrill  <jason@redhat.com>
176         PR c++/81073 - constexpr and static var in statement-expression.
177         * typeck2.c (store_init_value): Always call
178         require_potential_constant_expression.
179         * pt.c (convert_nontype_argument): Likewise.
180         * constexpr.c (potential_constant_expression_1): Adjust message.
181         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
182         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
184 2017-06-19  Nathan Sidwell  <nathan@acm.org>
186         * pt.c (coerce_template_parms): Fix indentation.
187         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
188         in to single block.
190         PR c++/81119
191         * name-lookup.c (update_binding): Only warn about constructors
192         hidden by functions.
194 2017-06-17  Jason Merrill  <jason@redhat.com>
196         PR c++/60063 - -Wunused-local-typedefs and templates.
197         * decl2.c (is_late_template_attribute): Return false for "used".
199         PR c++/70844 - -Wuseless-cast and inheriting constructor.
200         * method.c (forward_parm): Suppress warn_useless_cast.
202 2017-06-16  Jason Merrill  <jason@redhat.com>
204         PR c++/81045 - Wrong type-dependence with auto return type.
205         * pt.c (type_dependent_expression_p): An undeduced auto outside the
206         template isn't dependent.
207         * call.c (build_over_call): Instantiate undeduced auto even in a
208         template.
210         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
211         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
212         set longer for a generic lambda.
214         PR c++/80614 - Wrong mangling for C++17 noexcept type
215         * mangle.c (write_type): Put the eh spec back on the function type.
217         PR c++/81102 - Wrong error with partial specialization.
218         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
219         types.  Do type deduction later.
221         PR c++/81074 - ICE with partial specialization of member template.
222         PR c++/71747
223         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
225         PR c++/80831 - ICE with -fsyntax-only.
226         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
228         PR c++/80639 - ICE with invalid PMF initialization.
229         PR c++/80043 - ICE with -fpermissive
230         * typeck.c (convert_for_assignment): Recurse when instantiate_type
231         returns without an error.
233 2017-06-16  Nathan Sidwell  <nathan@acm.org>
235         * pt.c (tsubst_baselink): Fix & clarify formatting.
237         * cp-tree.h (build_this_parm, cp_build_parm_decl,
238         build_artificial_parm): Add FN parm.
239         * decl.c (start_cleanup_fn): Adjust.
240         (build_this_parm): Add FN parm, pass it through.
241         (grokfndecl): Adjust parm building.
242         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
243         (build_artificial_parm): Add FN parm, pass through.
244         (maybe_retrofit_in_chrg): Adjust parm building.
245         (start_static_storage_duration_function): Likwise.
246         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
247         * method.c (implicitly_declare_fn): Likewise.
248         * parser.c (inject_this_parameter): Likewise.
250         Symbol tables are insert only.
251         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
252         derive from pointer_hash.  Make undeletable.
254         * class.c (resort_type_method_vec): Avoid potential unsigned
255         overflow.
257         Don't defer noexcept_deferred_spec.
258         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
259         * decl.c (cxx_init_decl_processing): Initialize
260         noexcept_deferred_spec.
261         * except.c (unevaluated_noexcept_spec): Delete.
262         * class.c (deduce_noexcept_on_destructor): Use
263         noexcept_deferred_spec directly.
264         * method.c (implicitly_declare_fn): Likewise.
266         Make keyed_classes a vector.
267         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
268         (keyed_classes): Declare as vector.
269         * decl.c (keyed_classes): Define.
270         (cxx_init_decl_processing): Allocate it.
271         (record_key_method_defined): Use vec_safe_push.
272         * class.c (finish_struct_1): Likewise.
273         * pt.c (instantiate_class_template_1): Likewise.
274         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
276         Make rtti lazier
277         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
278         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
279         (tinfo_names): New.
280         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
281         (get_tinfo_decl): Use get_tinfo_desc.
282         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
283         (create_pseudo_type_info): Delete.
284         (get_pseudo_ti_index): Just determine the index.
285         (get_tinfo_desc): New.  Create all types lazily.
286         (create_tinfo_types): Just allocate the descriptor array.
287         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
288         location.
290 2017-06-15  Martin Sebor  <msebor@redhat.com>
292         PR c++/80560
293         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
294         functions.
295         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
296         (build_cxx_call): Call maybe_warn_class_memaccess.
298 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
300         * cp-gimplify.c (cp_genericize_r): Turn most of the function
301         into a switch (TREE_CODE (stmt)) statement from long else if
302         sequence.
304 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
306         PR c++/80973
307         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
308         argument even if it has REFERENCE_TYPE.
310         PR c++/80984
311         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
312         BLOCK_VARS (outer) chain.
313         (cxx_omp_const_qual_no_mutable): Likewise.
315 2017-06-13  Martin Liska  <mliska@suse.cz>
317         PR sanitize/78204
318         * class.c (build_base_path): Use sanitize_flags_p.
319         * cp-gimplify.c (cp_genericize_r): Likewise.
320         (cp_genericize_tree): Likewise.
321         (cp_genericize): Likewise.
322         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
323         * decl.c (compute_array_index_type): Likewise.
324         (start_preparsed_function): Likewise.
325         * decl2.c (one_static_initialization_or_destruction): Likewise.
326         * init.c (finish_length_check): Likewise.
327         * lambda.c (maybe_add_lambda_conv_op): Likewise.
328         * typeck.c (cp_build_binary_op): Likewise.
329         (build_static_cast_1): Likewise.
331 2017-06-11  Jason Merrill  <jason@redhat.com>
333         * error.c (dump_expr): Use is_this_parameter.
335         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
336         id_equal.
338 2017-06-09  Jason Merrill  <jason@redhat.com>
340         Missing bits from N4268, constant evaluation for all non-type args.
341         * call.c (build_converted_constant_expr): Rename from
342         build_integral_nontype_arg_conv, handle all types.
343         * pt.c (convert_nontype_argument): In C++17 call it for all types.
344         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
345         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
347         Overhaul pointer-to-member conversion and template argument handling.
348         * call.c (standard_conversion): Avoid creating ck_pmem when the
349         class type is the same.
350         * cvt.c (can_convert_qual): Split from
351         perform_qualification_conversions.
352         * constexpr.c (cxx_eval_constant_expression): Check it.
353         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
354         adjustment is necessary.
355         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
356         (convert_nontype_argument): Avoid redundant error.
358         * call.c (convert_like_real): Remove "inner" parameter.
359         Don't replace a constant with its value.
360         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
362         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
363         nullptr_node.
365         * parser.c (cp_parser_constant_expression): Check
366         potential_rvalue_constant_expression after decay_conversion.
367         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
369         PR c++/80384 - ICE with dependent noexcept-specifier
370         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
371         noexcept-specifier.
373         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
375 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
377         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
378         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
379         (excpet.c): Mark terminate as cold.
381 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
383         PR c/81006
384         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
385         to sizetype before size_binop.
387         PR c++/81011
388         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
389         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
390         and OMP_CLAUSE_SHARED_READONLY flags.
392 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
394         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
396 2017-06-07  Nathan Sidwell  <nathan@acm.org>
398         * class.c (layout_class_type): Restructure overlong-bitfield tpe
399         search.
401 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
403         PR c++/80990
404         * pt.c (do_class_deduction): Build qualified type.
406 2017-06-06  Nathan Sidwell  <nathan@acm.org>
408         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
409         sans using directives.  Don't walk into inline namespaces.
411         PR c++/80979
412         * name-lookup.c (adl_class_only): Don't add visible friends.
414 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
416         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
418 2017-06-02  Nathan Sidwell  <nathan@acm.org>
420         Remove lang_type_ptrmem.
421         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
422         into ...
423         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
424         (lang_type): ... this.  Delete old definition.
425         (lang_type_ptrmem): Delete.
426         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
427         (LANG_TYPE_PTRMEM_CHECK): Delete.
428         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
429         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
430         * decl.c (build_ptrmemfunc_type): Adjust.
431         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
432         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
433         
434         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
435         setting.
436         
437         Remove cp_binding_level::namespaces
438         * name-lookup.h (cp_binding_level): Lose namespaces field.
439         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
440         list.
441         (suggest_alternatives_for): Adjust for namespace list.  Do
442         breadth-first search.
443         * decl2.c (collect_source_refs): Namespaces are on the regulr
444         list.
445         (collect_ada_namespace): Likewise.
447 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
449         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
450         warning.
452 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
454         PR c++/80812
455         * method.c (constructible_expr): Strip array types before calling
456         build_value_init.
458 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
460         PR c++/80896
461         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
462         for case INDIRECT_REF too in the main switch.
464 2017-05-31  Jason Merrill  <jason@redhat.com>
466         PR c++/80840 - ICE with constexpr and reference
467         * pt.c (convert_nontype_argument): Don't test whether a decl is
468         value-dependent when binding to a reference.
470 2017-05-31  Nathan Sidwell  <nathan@acm.org>
472         * cp-tree.h (lang_decl_slector): New enum.
473         (lang_decl_base): Make selector an enum.  Drop decomposition_p
474         field.
475         (lang_decl): Use enum for discrimination.
476         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
477         LANG_DECL_DEOMP_CHECK): Use enum.
478         (DECL_DECOMPOSITION_P): Use selector value.
479         (SET_DECL_DECOMPOSITION_P): Delete.
480         (retrofit_lang_decl): Lose SEL parm.
481         (fit_decomposition_lang_decl): Declare.
482         * decl.c (cp_finish_decomp, grokdeclarator): Use
483         fit_decomposition_lang_decl.
484         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
485         retrofit_lang_decl.
486         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
487         (fit_decomposition_lang_decl): Likewise.
488         (retrofit_lang_decl): Use worker functions.
489         (cxx_dup_lang_specific_decl): Use selector enum.
490         (maybe_add_lang_type_raw): New.  Broken out of ...
491         (cxx_make_type_name): ... here.  Call it.
493 2017-05-30  Jason Merrill  <jason@redhat.com>
495         PR c++/80856 - ICE with local extern in template
496         * semantics.c (finish_call_expr): Replace a local extern overload
497         set in a template with the IDENTIFIER_NODE.
499 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
501         * call.c (perform_implicit_conversion_flags): Convert
502         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
503         (print_conversion_rejection): Replace pairs of %qT with
504         %qH and %qI in various places.
505         (build_user_type_conversion_1): Likewise.
506         (build_integral_nontype_arg_conv): Likewise.
507         (build_conditional_expr_1): Likewise.
508         (convert_like_real): Likewise.
509         (convert_arg_to_ellipsis): Likewise.
510         (joust): Likewise.
511         (initialize_reference): Likewise.
512         * cvt.c (cp_convert_to_pointer): Likewise.
513         (cp_convert_to_pointer): Likewise.
514         (convert_to_reference): Likewise.
515         (ocp_convert): Likewise.
516         * error.c (cp_printer): Gain bool and const char ** parameters.
517         (struct deferred_printed_type): New struct.
518         (class cxx_format_postprocessor): New class.
519         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
520         to pp->m_format_postprocessor.
521         (comparable_template_types_p): New function.
522         (newline_and_indent): New function.
523         (arg_to_string): New function.
524         (print_nonequal_arg): New function.
525         (print_template_differences): New function.
526         (type_to_string_with_compare): New function.
527         (print_template_tree_comparison): New function.
528         (append_formatted_chunk): New function.
529         (add_quotes): New function.
530         (cxx_format_postprocessor::handle): New function.
531         (defer_phase_2_of_type_diff): New function.
532         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
533         %H and %I.
534         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
535         %qH and %qI in various places.
536         (convert_member_func_to_ptr): Likewise.
537         (build_reinterpret_cast_1): Likewise.
538         (convert_for_assignment): Likewise.
539         * typeck2.c (check_narrowing): Likewise.
541 2017-05-30  Nathan Sidwell  <nathan@acm.org>
543         Kill IDENTIFIER_NAMESPACE_BINDINGS
544         * cp-tree.h (lang_identifier): Delete namespace_bindings.
545         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
546         (lang_decl_ns): Add bindings.
547         (DECL_NAMESPACE_BINDINGS): New.
548         * lex.c (retrofit_lang_decl): Create namespace hash table.
549         * name-lookup.c (find_namespace_slot): Change to use hash-map.
550         * ptree.c (cxx_print_binding): Delete.
551         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
553         * cp-tree.def (OVERLOAD): Fix comment.
554         * cp-tree.h: Fix comments and whitespace.
555         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
556         * name-lookup.c (add_decl_to_level): Assert not class.
557         (check_local_shadow): Use OVL_P.
558         (pushdecl_with_scope_1): Rename to ...
559         (do_pushdecl_with_Scope): ... here.
560         (do_nonmember_using_decl): Use qualified_namespace_lookup return
561         value.
562         (push_class_level_binding_1): Use OVL_P.
563         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
564         (pushtag_1): Rename to ...
565         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
566         (pushtag): Adjust.
567         (store_class_bindings): Do not time here.
568         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
569         * pt.c (listify): Declare argvec at point of initialization.
571         PR c++/80913
572         * name-lookup.c (add_decl_to_level): Assert not making a circular
573         chain.
574         (update_binding): Don't prematurely slide artificial decl.
576 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
578         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
580 2017-05-29  Nathan Sidwell  <nathan@acm.org>
582         PR c++/80891 (#1,#5)
583         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
584         * name-lookup.c (name_lookup): Add deduping field.
585         (name_lookup::preserve_state, name_lookup::restore_state): Deal
586         with deduping.
587         (name_lookup::add_overload): New.
588         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
589         (name_lookup::search_adl): Set deduping.  Don't unmark here.
590         * pt.c (most_specialized_instantiation): Revert previous change,
591         Assert not given duplicates.
592         * tree.c (lookup_mark): Just mark the underlying decls.
593         (lookup_maybe_add): Dedup using marked decls.
595         PR c++/80891 (#4)
596         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
597         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
599         Stat hack representation
600         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
601         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
602         (stat_hack): New.
603         (find_namespace_binding): Replace with ...
604         (find_namespace_slot): ... this.
605         (find_namespace_value): New.
606         (name_lookup::search_namespace_only,
607         name_lookup::adl_namespace_only): Adjust.
608         (update_binding): Add SLOT parameter, adjust.
609         (check_local_shadow): Use find_namespace_value.
610         (set_local_extern_decl_linkage): Likewise.
611         (do_pushdecl): Adjust for namespace slot.
612         (push_local_binding): Assert not a namespace binding.
613         (check_for_out_of_scope_variable): Use find_namespace_value.
614         (set_identifier_type_value_with_scope): Likewise.
615         (get_namespace_binding): Likewise.
616         (set_namespace_binding): Delete.
617         (set_global_binding): Directly update the binding.
618         (finish_namespace_using_decl): Likewise.
619         (lookup_type_scope_1): Use find_namespace_slot and update.
620         (do_push_nested_namespace): Use find_namespace_value.
622         PR c++/80891 (#1)
623         * pt.c (most_specialized_instantiation): Cope with duplicate
624         instantiations.
626         PR c++/80891 (#3)
627         * cp-tree.h (build_min_nt_call_vec): Declare.
628         * decl.c (build_offset_ref_call_from_tree): Call it.
629         * parser.c (cp_parser_postfix_expression): Likewise.
630         * pt.c (tsubst_copy_and_build): Likewise.
631         * semantics.c (finish_call_expr): Likewise.
632         * tree.c (build_min_nt_loc): Keep unresolved lookups.
633         (build_min): Likewise.
634         (build_min_non_dep): Likewise.
635         (build_min_non_dep_call_vec): Likewise.
636         (build_min_nt_call_vec): New.
638         PR c++/80891 (#2)
639         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
640         (ovl_used): New.
641         (lookup_keep): Call it.
643 2017-05-26  Nathan Sidwell  <nathan@acm.org>
645         Implement DR2061
646         * name-lookup.c (push_inline_namespaces): New.
647         (push_namespace): Look inside inline namespaces.
649         Inline and using namespace representation change.
650         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
651         inlinees as vector.
652         (DECL_NAMESPACE_USING): Adjust.
653         (DECL_NAMESPACE_INLINEES): New.
654         * name-lookup.h (struct cp_binding_level): Change usings
655         representation.
656         * name-lookup.c (name_lookup::do_queue_usings,
657         name_lookup::queue_usings): Adjust.
658         (name_lookup::search_namespace, name_lookup::search_usings,
659         name_lookup::queue_namespace): Adjust.
660         (name_lookup::adl_namespace_only): Adjust.
661         (add_using_namespace, push_namespace): Push onto vector.
662         (pop_namespace): Add timing logic.
664         * call.c (build_operator_new_call): Do namelookup and ADL here.
665         (build_new_op_1): Likewise.
666         * name-lookup.h (lookup_function_nonclass): Delete declaration.
667         (do_using_directive): Likewise.
668         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
669         declare early.
670         (struct scope_binding): Delete.
671         (EMPTY_SCOPE_BINDING): Delete.
672         (set_decl_namespace): Use OVL_P.
673         (finish_local_using_decl): Lose unnecesary checks.
674         (lookup_function_nonclass): Delete.
675         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
677         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
678         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
679         unduplicatable.
680         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
681         (lkp_iterator): Add outer field.  Adjust ctor.
682         (lkp_iterator::operator++): New.
683         (lookup_mark, lookup_maybe_add): Declare.
684         * name-lookup.c (name_lookup): Delete fn_set member.
685         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
686         and mark lookup.
687         (name_lookup::add_value): Use lookup_add directly.
688         (name_lookup::add_fns: Use lookup_maybe_add.
689         (name_lookup::search_adl): Mark and unmark fns.
690         (pushdecl): Adjust.
691         * pt.c (check_explicit_specialization): Use lookup_add directly.
692         * ptree.c (cxx_print_xnode): Show complete overload structure.
693         * tree.c (lookup_mark, lookup_maybe_add): New.
695         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
697 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
699         * cp-tree.h (struct lang_decl_decomp): New type.
700         (struct lang_decl): Add u.decomp.
701         (LANG_DECL_DECOMP_CHECK): Define.
702         (DECL_DECOMPOSITION_P): Note it is set also on the vars
703         for user identifiers.
704         (DECL_DECOMP_BASE): Define.
705         (retrofit_lang_decl): Add extra int = 0 argument.
706         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
707         use it to influence the selector choices and for selector
708         0 to non-zero transition copy old content.
709         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
710         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
711         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
712         wording if decl is a structured binding.
713         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
714         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
715         of individual variables for tuple structured bindings.
716         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
717         Clear DECL_DECOMP_BASE.
718         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
719         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
720         is expected.
721         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
722         DECL_VALUE_EXPR.
724 2017-05-25  Jason Merrill  <jason@redhat.com>
726         PR c++/80605 - __is_standard_layout and zero-length array
727         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
729 2017-05-25  Nathan Sidwell  <nathan@acm.org>
731         Kill OVL_CURRENT, OVL_NEXT.
732         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
733         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
734         (consider_binding_level): Use OVL_FIRST.
735         (cp_emit_debug_info_for_using): Use lkp_iterator.
736         * pt.c (check_explicit_specialization): Use ovl_iterator.       
738         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
739         * cp-tree.h (lang_decl_ns): Remove ns_users field.
740         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
741         (TREE_INDIRECT_USING): Delete.
742         * name-lookup.h (is_associated_namespace): Delete.
743         * name-lookup.c (name_lookup::search_usings,
744         name_lookup::do_queue_usings): Usings are always direct.
745         (is_associated_namespace): Delete.
746         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
747         (namespace_ancestor_1, namespace_ancestor): Delete.
748         (push_using_directive_1, push_using_directive): Delete.
749         (add_using_namespace_1): Delete.
750         (add_using_namespace): Reimplement.
751         (emit_debug_info_using_namespace): New.
752         (finish_namespace_using_directive, finish_local_using_directive,
753         push_namespace): Adjust.
754         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
756 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
758         * semantics.c (finish_handler_parms): Warn about non-reference type
759         catch handlers.
761 2017-05-25  Nathan Sidwell  <nathan@acm.org>
763         Reimplement unqualified namespace lookup.
764         * name-lookup.c (name_lookup::using_pair,
765         name_lookup::using_queue): New typedefs.
766         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
767         name_lookup::queue_usings): New.
768         (name_lookup::search_unqualified): New.
769         (merge_functions, same_entity_p, ambiguous_decl,
770         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
771         lookup_using_namespace): Delete.
772         (lookup_name_real_1): Adjust.
774         Reimplement qualified namespace lookup.
775         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
776         (name_lookup::ambiguous, name_lookup::add_value,
777         name_lookup::add_type, name_lookup::process_binding): New.
778         (name_lookup::search_namespace_only,
779         name_lookup::search_namespace, name_lookup::search_usings): New.
780         (name_lookup::search_qualified): New.
781         (do_nonmember_using_decl, suggest_alternatives_for,
782         lookup_qualified_name): Adjust.
783         (tree_vec_contains): Delete.
784         (qualified_lookup_using_namespace): Rename to ...
785         (qualified_namespace_lookup): ... here.  Reimplement.
787         Reimplement ADL.
788         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
789         * name-lookup.h (lookup_arg_dependent): Return plain tree.
790         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
791         arg_assoc_args_vec, arg_assoc_type, add_function,
792         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
793         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
794         lookup_arg_dependent_1): Delete.
795         (name_lookup): New lookup object.
796         (name_lookup::preserve_state, name_lookup::restore_state,
797         name_lookup::mark_seen, name_lookup::find_and_mark,
798         name_lookup::add_fns, name_lookup::adl_namespace_only,
799         name_lookup::adl_namespace, name_lookup::adl_class_only,
800         name_lookup::adl_bases, name_lookup::adl_class,
801         name_lookup::adl_expr, name_lookup::adl_type,
802         name_lookup::adl_template_arg, name_lookup::search_adl): New.
803         (lookup_arg_dependent): Return a plain tree.  Adjust.
804         (is_associated_namespace): Move later.
805         
806 2017-05-24  Nathan Sidwell  <nathan@acm.org>
808         * friend.c (do_friend): Remove check for existing decl.
809         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
810         * name-lookup.c (push_local_binding): Directly look for binding.
811         (lookup_name_innermost_nonclass_level_1): Delete.
812         (lookup_name_innermost_nonclass_level): Delete.
814         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
816         * cp-tree.h (cp_free_lang_data): Add extern.
817         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
818         ATTRIBUTE_PURE.
819         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
820         * typeck.c (type_unknown_p): Delete.
821         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
822         overload management.
823         (dependent_name): Likewise.
824         (decl_anon_ns_mem_p): Simplify.
826 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
828         PR c++/80544
829         * tree.c (reshape_init): Use unqualified type for direct enum init.
830         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
831         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
832         non-class destination types.
833         (build_const_cast_1): Strip cv-quals from destination types.
834         (build_static_cast, build_reinterpret_cast, build_const_cast)
835         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
837 2017-05-24  Martin Sebor  <msebor@redhat.com>
839         PR c/80731
840         * call.c (fully_fold_internal): Adjust.
842 2017-05-24  Nathan Sidwell  <nathan@acm.org>
844         * cp-tree.h (ovl_skip_hidden): Declare.
845         * tree.c (ovl_skip_hidden): New.
846         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
847         (lookup_arg_dependent_1): Likewise.
848         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
849         (hidden_name_p, remove_hidden_names): Delete.
850         (lookup_name_real_1): Do not strip hidden names.
851         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
853         * cp-tree.h (OVL_HIDDEN_P): New.
854         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
855         (ovl_iterator::reveal_node): Declare.
856         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
857         (ovl_insert): Order on hiddenness.
858         (ovl_iterator::reveal_node): New.
859         * name-lookup.c (anticipated_builtin_p): New.
860         (supplement_binding_1): Use it.
861         (set_local_extern_decl_linkage): Use hidden_p.
862         (do_pushdecl): Deal with unhiding a hidden decl, use
863         anticipated_builtin_p.
864         (do_nonmember_using_decl): Use anticipated_decl_p.
865         (lookup_name_real_1): Use DECL_HIDDEN_P.
867 2017-05-23  Jason Merrill  <jason@redhat.com>
869         -Wunused and C++17 structured bindings
870         * decl.c (poplevel): Don't warn about unused structured bindings,
871         only real variables.
872         * error.c (dump_simple_decl): Handle structured bindings.
873         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
875 2017-05-23  Nathan Sidwell  <nathan@acm.org>
877         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
878         * name-lookup.c (create_local_binding): New.
879         (update_binding): New.
880         (pushdecl_maybe_friend_1): Rename to ...
881         (do_pushdecl): ... this.  Reimplement.
882         (pushdecl): Adjust.
883         (push_overloaded_decl_1, push_overloaded_decl): Delete.
885 2017-05-23  Jason Merrill  <jason@redhat.com>
887         PR c++/80396 - built-in for make_integer_sequence.
888         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
889         (expand_integer_pack, expand_builtin_pack_call): New.
890         (find_parameter_packs_r): Check builtin_pack_call_p.
891         (check_for_bare_parameter_packs): Handle it.
892         (tsubst_pack_expansion): Call expand_builtin_pack_call.
893         (declare_integer_pack): New.
894         (init_template_processing): Call it.
895         * decl2.c (mark_used): Check builtin_pack_fn_p.
897 2017-05-23  Nathan Sidwell  <nathan@acm.org>
899         * name-lookup.c (find_namespace_binding): New.
900         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
901         (set_identifier_type_value_with_scope): Use find_namespace_binding.
902         (find_binding, cp_binding_level_find_binding_for_name,
903         binding_for_name, namespace_binding_1): Delete.
904         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
905         (get_namespace_binding, set_namespace_binding,
906         finish_namespace_using_decl, unqualified_namespace_lookup_1,
907         qualified_lookup_using_namespace, lookup_type_scope_1,
908         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
910         PR c++/80866
911         * parser.c (cp_parser_template_id): Keep the lookup when stashing
912         the template_id.
914         * cp-tree.h (DECL_HIDDEN_P): New.
915         * name-lookup.c (set_decl_context,
916         set_local_extern_decl_linkage): New, broken out of ...
917         (pushdecl_maybe_friend_1): ... here.  Call them.
919 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
921         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
922         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
923         "VECTOR_LENGTH".
925 2017-05-23  Nathan Sidwell  <nathan@acm.org>
927         * cp-tree.h (OVL_P): New.
928         * name-lookup.h (push_local_binding): Delete.
929         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
930         (finish_namespace_using_decl, finish_local_using_decl): ... here
931         * name-lookup.c (add_decl_to_level): Swap args.
932         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
933         (diagnose_name_conflict): Check contexts are same for redecl.
934         (update_local_overload): New.
935         (compparms_for_decl_and_using): Rename to ...
936         (matching_fn_p): ... here.
937         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
938         push_local_bindings call.
939         (push_local_binding): Make static, replace FLAGS arg with
940         IS_USING.
941         (validate_nonmember_using_decl): Use OVL_FIRST.
942         (do_nonmember_using_decl): Use in/out parameters.  Use
943         lkp_iterator and simplify.
944         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
945         (finish_namespace_using_decl, finish_local_using_decl): ... here.
946         Adjust.
947         (lookup_type_current_level): Delete.
948         * parser.c (cp_parser_using_declaration): Adjust.
949         * pt.c (tsubst_expr): Adjust.
951 2017-05-22  Nathan Sidwell  <nathan@acm.org>
953         * name-lookup.h (parse_using_directive): Replace with ...
954         (finish_namespace_using_directive): ... this and ...
955         (finish_local_using_directive): ... this.
956         * name-lookup.c (add_using_namespace_1): Move later.
957         (add_using_namespace): Move later, add namespace_p arg, remove
958         indirect arg.
959         (push_using_directive_1): Directly recurse.
960         (do_using_directive, parse_using_directive): Delete, split into ...
961         (finish_namespace_using_directive): ... this and ...
962         (finish_local_using_directive): ... this.
963         (push_namespace): Use add_using_namespace.
964         * parser.c (cp_parser_using_directive): Call
965         finish_namespace_using_directive or finish_local_using_directive.
966         * pt.c (tsubst_expr): Call finish_local_using_directive.
968         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
969         * cp-tree.h (raw_dump_id): Declare.
970         * decl2.c (raw_dump_id): Define.
971         (dump_tu): Use raw_dump_id.
973         * config-lang.in (gtfiles): Sort list, break lines.
975         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
976         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
977         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
978         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
979         CPTI_RETHROW_FN): New.
980         (noexcept_deferred_spec): New.
981         (terminate_node, call_unexpected_node): Rename to ...
982         (terminate_fn, call_unexpected_fn): ... here.
983         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
984         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
985         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
986         (init_exception_processing): Adjust.
987         (declare_library_fn): Create and push the fns here.
988         (do_get_exception_ptr, do_begin_catch, do_end_catch,
989         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
990         declare_library_fn use.
991         (unevaluated_noexcept_spec): Adjust.
992         * cp-gimplify.c (genericize_eh_spec_block,
993         gimplify_most_not_throw_expr): Adjust.
995         * name-lookup.c (pushdecl_top_level,
996         pushdecl_top_level_and_finish): Move after namespace pushing and
997         popping functions.
998         (push_to_top_level): Rename to ...
999         (do_push_to_top_level): ... here.  Remove timing code.
1000         (pop_from_top_level_1): Rename to ...
1001         (do_pop_from_top_level): ... here.
1002         (do_push_nested_namespace, do_pop_nested_namespace)
1003         (push_to_top_level): New wrapper for do_push_to_top_level.
1004         (pop_from_top_level): Adjust.
1005         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1007 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1009         * config-lang.in (gtfiles): Add c-family/c-format.c,
1010         except.c, init.c, lambda.c and friend.c.
1011         * class.c (dvirt_fn): Move out of function scope,
1012         add GTY attribute.
1013         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1014         * init.c (fn): Likewise.
1015         * lambda.c (ptr_id, max_id): Likewise.
1016         * friend.c (global_friend): Add GTY attribute.
1018 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1020         * call.c (add_list_candidates): Use OVL_FIRST.
1021         (build_new_method_call_1): Likewise.
1022         * cp-tree.h (OVL_SINGLE_P): New.
1023         (TYPE_HIDDEN_P): New.
1024         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1025         * dump.c (cp_tump_tree): Adjust overload dumping.
1026         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1027         printing.
1028         * method.c (lazily_declare_fn): Assert we added it.
1029         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1030         OVL_FIRST.
1031         (cp_parser_template_name): Use lkp_iterator.
1032         * pt.c (begin_template_parm_list): Fixup comment.
1033         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1034         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1035         (ovl_scope): Use lkp_iterator.
1037 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
1039         * parser.c (cp_parser_omp_clause_default): Handle
1040         "OMP_CLAUSE_DEFAULT_PRESENT".
1042         * parser.c (cp_parser_omp_clause_default): Avoid printing more
1043         than one syntax error message.
1045 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1047         * class.c (class_dump_id): Define.
1048         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1049         * cp-objcp-common.c (cp_register_dumps): New.
1050         * cp-objcp-common.h (cp_register_dumps): Declare.
1051         (LANG_HOOKS_REGISTER_DUMPS): Override.
1052         * cp-tree.h (class_dump_id): Declare.
1054 2017-05-18  Nathan Sidwell  <nathan@acm.org>
1056         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1057         (OVL_USED_P): New.
1058         (lookup_keep): Declare.
1059         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1060         * pt.c (tsubst_copy): Assert lookup is persistent.
1061         * semantics.c (finish_call_expr): Use lkp_iterator, call
1062         lookup_keep.
1063         * tree.c (ovl_copy): New.
1064         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1065         (lookup_keep): New.
1067         * cp-tree.h (OVL_USED): Replace with ...
1068         (OVL_USING_P): ... this.
1069         (ovl_iterator::using_p): Adjust.
1070         * name-lookup.c (push_overloaded_decl_1,
1071         do_nonmember_using_decl): Adjust.
1072         * search.c (lookup_field_r): Adjust.
1073         * tree.c (ovl_insert, ovl_scope): Adjust.
1075         * cp-tree.h (lookup_add): Swap args.
1076         (ovl_cons, build_overload): Delete.
1077         * name-lookup.c (add_function, push_overloaded_decl_1,
1078         do_nonmember_using_decl, merge_functions, remove_hidden_names):
1079         Use lookup_add, ovl_insert.
1080         * pt.c (check_explicit_specialization): Use lookup_add.
1081         (do_class_deduction): Likewise. Refactor if.
1082         * tree.c (lookup_add): Swap args.
1083         (ovl_cons, build_overload): Delete.
1085         * name-lookup.c (find_local_binding): New, broken out of ...
1086         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
1087         (set_namespace_binding): Swap scope & name args.
1088         (namespace_binding_1): Likewise.
1089         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1090         (push_overloaded_decl_1): Likewise.
1091         (set_global_binding): Likewise.
1092         (get_namespace_binding): Adjust namespace_binding_1 call.
1094 2017-05-17  Nathan Sidwell  <nathan@acm.org>
1096         * cp-tree.h (default_hash_traits <lang_identifier *>): New
1097         specialization.
1098         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1099         (extern_c_fns): New hash table.
1100         (check_extern_c_conflict): New, broken out of ...
1101         (pushdecl_maybe_friend_1): ... here.  Call it.
1102         (c_linkage_bindings): Just look in hash table.
1104 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
1106         PR c++/80654
1107         PR c++/80682
1108         Implement new C++ intrinsics __is_assignable and __is_constructible.
1109         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1110         (is_xible): New.
1111         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1112         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1113         * method.c (constructible_expr): Set cp_unevaluated.
1114         (is_xible_helper): New.
1115         (is_trivially_xible): Adjust.
1116         (is_xible): New.
1117         * parser.c (cp_parser_primary_expression): Handle
1118         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1119         (cp_parser_trait_expr): Likewise.
1120         * semantics.c (trait_expr_value): Handle
1121         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1123 2017-05-17  Nathan Sidwell  <nathan@acm.org>
1125         * cp-tree.h (ovl_iterator::using_p): New predicate.
1126         (ovl_iterator::remove_node): New worker.
1127         (ovl_insert): Declare.
1128         * tree.c (ovl_insert): New.
1129         (ovl_iterator::remove_node): New.
1130         * class.c (add_method): Use ovl_iterator, ovl_insert.
1131         (clone_function_decl): Fix description.
1132         (clone_constructors_and_destructors): Use ovl_iterator.
1134         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1135         (maybe_warn_about_overly_private_class): Use ovl_iterator.
1136         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1137         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1138         (get_base_fndecls): Use ovl_iterator.
1139         (warn_hidden): Use OVL_NAME, ovl_iterator.
1140         (add_implicitly_declared_members): Use ovl_iterator.
1141         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1142         flatten nested if.
1143         (finish_shorthand_constraint): Simplify, use ovl_make.
1144         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
1145         * search.c (shared_member_p): Use ovl_iterator.
1146         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1147         (lookup_conversion_operator): Use OVL_FIRST.
1148         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1149         (look_for_overrides_here): Use ovl_iterator.
1150         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1151         * typeck.c (build_x_unary_op): Use ovl_make.
1153 2017-05-17  Martin Liska  <mliska@suse.cz>
1155         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1156         use it instead of int type.
1157         (dump_vtable): Likewise.
1158         (dump_vtt): Likewise.
1159         * decl2.c (dump_tu): Likewise.
1161 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
1163         * call.c (enforce_access): Add access_failure_info * param and use
1164         it to record access failures.
1165         * cp-tree.h (class access_failure_info): New class.
1166         (enforce_access): Add access_failure_info * param, defaulting to
1167         NULL.
1168         (lookup_member): Likewise.
1169         (locate_field_accessor): New function decl.
1170         (perform_or_defer_access_check): Add access_failure_info * param,
1171         defaulting to NULL.
1172         * search.c (lookup_member): Add access_failure_info * param and
1173         pass it on to call to perform_or_defer_access_check.
1174         (matches_code_and_type_p): New function.
1175         (field_access_p): New function.
1176         (direct_accessor_p): New function.
1177         (reference_accessor_p): New function.
1178         (field_accessor_p): New function.
1179         (struct locate_field_data): New struct.
1180         (dfs_locate_field_accessor_pre): New function.
1181         (locate_field_accessor): New function.
1182         * semantics.c (perform_or_defer_access_check): Add
1183         access_failure_info * param, and pass it on to call to
1184         enforce_access.
1185         * typeck.c (access_failure_info::record_access_failure): New method.
1186         (access_failure_info::maybe_suggest_accessor): New method.
1187         (finish_class_member_access_expr): Pass an access_failure_info
1188         instance to the lookup_member call, and call its
1189         maybe_suggest_accessor method afterwards.
1191 2017-05-16  Marek Polacek  <polacek@redhat.com>
1193         PR sanitizer/80536
1194         PR sanitizer/80386
1195         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1197 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1199         * name-lookup.c (check_local_shadow): New, broke out of ...
1200         (pushdecl_maybe_friend_1): ... here.  Call it.
1202         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1203         (ovl_first): Move inline definition to end of file.
1204         (ovl_make, lookup_add): Declare.
1205         (get_fns, get_first_fn): Make pure.
1206         * tree.c (ovl_cache): New.
1207         (ovl_make, lookup_add): New.
1208         * pt.c (do_class_deduction): Don't add candidates that will be
1209         elided.
1211         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1212         (print_error_for_call_failure): Use OVL_NAME.
1213         (build_op_call_1): Use ovl_iterator.
1214         (add_candidates): Use OVL_FIRST & lkp_iterator.
1215         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1216         lkp_iterator.
1217         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1218         (type_has_user_nondefault_constructor,
1219         in_class_defaulted_default_constructor,
1220         type_has_user_provided_constructor,
1221         type_has_user_provided_or_explicit_constructor,
1222         type_has_non_user_provided_default_constructor,
1223         vbase_has_user_provided_move_assign,
1224         type_has_move_constructor, type_has_move_assign,
1225         type_has_user_declared_move_constructor,
1226         type_has_user_declared_move_assign,
1227         type_build_ctor_call, type_build_dtor_call,
1228         type_requires_array_cookie, explain_non_literal_class): Likewise.
1229         (finish_struct): Use lkp_iterator.
1230         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1231         (note_name_declared_in_class): Use OVL_NAME.
1232         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1233         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1234         cxx_pretty_printer::expression): Likewise.
1235         * decl2.c (check_classfn): Use ovl_iterator.
1236         * pt.c (retrieve_specialization): Use ovl_iterator.
1237         * tree.c (cp_tree_equal): Use lkp_iterator.
1238         (type_has_nontrivial_copy_init): Use ovl_iterator.
1240         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1241         check is_overloaded_fn.
1243 2017-05-16  Martin Liska  <mliska@suse.cz>
1245         * parser.c (cp_lexer_print_token): Add default value for flags
1246         argument of print_gimple_stmt, print_gimple_expr,
1247         print_generic_stmt and print_generic_expr.
1249 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1251         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1252         iterators.
1253         (MAYBE_BASELINK_FUNCTIONS): New.
1254         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1255         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1256         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1257         * method.c (inherited_ctor_binfo): Use ovl_iterator.
1258         (binfo_inherited_from): Likewise.
1259         * parser.c (lookup_literal_operator): Use lkp_iterator.
1260         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1261         (print_candidates_1): Likewise.
1262         (determine_specialization): Likewise.
1263         (resolve_overloaded_unification): Likewise.
1264         (resolve_nondeduced_context): Likewise.
1265         (type_dependent_expression_p): Likewise.
1266         (dependent_template_p): Likewise.
1267         * ptree.c (cxx_print_xnode): Likewise.
1268         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1269         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1270         * typeck.c (check_template_keyword): Use lkp_iterator.
1272         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1273         (ovl_first): New.
1274         * constexpr.c (function_concept_check): Use OVL_FIRST.
1275         * cvt.c (build_expr_type_conversion): Likewise.
1276         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1277         * decl2.c (mark_used): Use OVL_FIRST.
1278         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1279         (dump_expr, location_of): Use OVL_FIRST.
1280         * friend.c (do_friend): Use OVL_NAME.
1281         * init.c (build_offset_ref): Use OVL_FIRST.
1282         * mangle.c (write_member_name): Likewise.
1283         (write_expression): Use OVL_NAME.
1284         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1285         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1286         * pt.c (check_explicit_specialization): Use OVL_FIRST.
1287         (check_template_shadow): Likewise.
1288         (tsubst_template_args): Use OVL_NAME.
1289         (tsubst_baselink): Use OVL_FIRST.
1290         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1291         * tree.c (get_first_fn): Use OVL_FIRST.
1292         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1293         (cp_build_addr_expr_1): Use OVL_FIRST.
1295         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1296         peeking.
1297         * semantics.c (finish_id_expression): Directly init local var.
1298         (finish_omp_reduction_clause): Use really_overloaded_fn.
1299         * tree.c (get_fns): Document.  Assert we got an overload.
1300         (get_first_fn) Document.
1301         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1302         really_overloaded_fn.
1303         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1305         * cp-tree.h (SCOPE_DEPTH): New.
1306         * name-lookup.h (is_nested_namespace): Declare.
1307         * name-lookup.c (is_nested_namespace): New.
1308         (is_ancestor): Use it.
1309         (set_decl_namespace): Likewise.
1310         (push_namespace): Set SCOPE_DEPTH.
1311         * pt.c (check_specialization_namespace): Use is_nested_namespace.
1312         (check_unqualigied_spec_or_inst): Likewise.
1314 2017-05-15  Nathan Sidwell  <nathan@acm.org>
1316         PR c++/79369
1317         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1318         * name-lookup.h (push_namespace): Return int, add make_inline arg.
1319         * name-lookup.c (push_namespace): Deal with inline directly.
1320         Return pushed count.
1321         * parser.c (cp_parser_namespace_definition): Adjust for
1322         push_namespace change.
1324 2017-05-11  Nathan Sidwell  <nathan@acm.org>
1326         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1327         LANG_HOOKS_PUSHDECL): Move to ...
1328         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1329         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1330         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1332         * name-lookup.h (pushdecl): Add default friend parm.
1333         (pushdecl_maybe_friend): Delete.
1334         (pushdecl_top_level): Add default friend parm.
1335         (pushdecl_top_level_maybe_friend): Delete.
1336         * name-lookup.c (pushdecl_maybe_friend): Delete.
1337         (pushdecl): Add is_friend parm.
1338         (pushdecl_top_level): Add is friend_parm.
1339         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1340         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1341         * friend.c (do_friend): Adjust.
1342         * pt.c (tsubst_friend_class): Adjust.
1344         Revert pushdecl_top_level_and_finish name change.
1345         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1346         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1347         * decl.c (cp_make_fname_decl): Adjust.
1348         * decl2.c (get_guard, handle_tls_init):  Adjust.
1349         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
1351         * name-lookup.c (pushdecl_outermost_localscope): Always
1352         conditionally stop timer.
1354         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1355         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1357         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1358         pushtag_top_level_maybe_friend,
1359         pushdecl_top_level_and_finish): Move declarations to ...
1360         * name-lookup.h: ... here.  Group pushdecl variants.
1361         (pushdecl_top_level_and_finish): Rename to ...
1362         (pushdecl_top_level_with_init): ... here.
1363         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1364         * decl2.c (get_guard, handle_tls_init): Likewise.
1365         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1366         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1367         * method.c (implicitly_declare_fn): Likewise.
1368         * searchc (node_debug_info_needed): Likewise.
1369         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1370         (pushdecl_top_level_with_init): ... here.
1371         (pop_everything): Use namespace_bindings_p.
1373         * name-lookup.h (pop_binding): Rename to pop_local_binding.
1374         (getdecls): Rename to get_local_decls.
1375         * name-lookup.c (pop_binding): Rename to ...
1376         (pop_local_binding): ... here.
1377         (pop_bindings_and_leave_scope): Adjust.
1378         (getdecls): Rename to ...
1379         (get_local_decls): ... here.  Assert local scope.
1380         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
1381         logic.
1382         (store_parm_decls): Adjust get_local_decls call.
1383         (parser.c (synthesize_implicit_template_parm): Likewise.
1385 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
1387         PR c++/80682
1388         * method.c (is_trivially_xible): Reject void types.
1390 2017-05-10  Nathan Sidwell  <nathan@acm.org>
1392         * class.c (handle_using_decl): Always use OVL_CURRENT.
1393         (resolve_address_of_overloaded_function): Move iterator decl into
1394         for scope.  Don't strip anticipated decls here.
1396         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1397         printing.
1398         (print_candidates): Adjust.
1400         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
1401         line breaking.
1402         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
1403         koenig_p handling here.
1404         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1405         (tsubst_omp_clauses): Likewise.
1406         (do_class_deduction): Adjust buld_new_function_call calls.
1407         * semantics.c (finish_call_expr): Likewise.
1409 2017-05-10  Jason Merrill  <jason@redhat.com>
1411         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1412         (unify_type_mismatch, unify_parameter_pack_mismatch)
1413         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1414         (unify_parameter_pack_inconsistent, unify_inconsistency)
1415         (unify_vla_arg, unify_method_type_error, unify_arity)
1416         (unify_arg_conversion, unify_no_common_base)
1417         (unify_inconsistent_template_template_parameters)
1418         (unify_template_deduction_failure)
1419         (unify_template_argument_mismatch)
1420         (unify_overload_resolution_failure): Call unify_invalid.
1422         CWG 1847 - Clarifying compatibility during partial ordering
1423         * pt.c (more_specialized_fn): No order between two non-deducible
1424         parameters.
1426         * pt.c (dependent_type_p): Make sure we aren't called with
1427         global_type_node.
1429         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1430         * pt.c (convert_template_argument): Just return an argument pack.
1431         (coerce_template_parameter_pack, template_parm_to_arg)
1432         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1433         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1434         Don't set the type of a NONTYPE_ARGUMENT_PACK.
1435         * parser.c (make_char_string_pack, make_string_pack): Likewise.
1437 2017-05-10  Nathan Sidwell  <nathan@acm.org>
1439         * cp-tree.h (add_method, clone_function_decl): Change last arg to
1440         bool.
1441         * class.c (add_method): Change third arg to bool.  Adjust.
1442         (one_inheriting_sig, one_inherited_ctor): Adjust.
1443         (clone_function_decl): Change 2nd arg to bool.  Adjust.
1444         (clone_constructors_and_destructors): Adjust.
1445         * lambda.c (maybe_add_lambda_conv_op): Adjust.
1446         * method.c (lazily_declare_fn): Adjust.
1447         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1448         * semantics.c (finish_member_declaration): Adjust.
1450 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1452         PR c++/80145
1453         * decl.c (finish_function): To improve error recovery, change the
1454         logic for calling apply_deduced_return_type.
1456 2017-05-09  Jason Merrill  <jason@redhat.com>
1458         PR c++/80605 - __is_standard_layout and empty base
1459         * class.c (check_bases): Ignore empty bases.
1461         PR c++/70979 - literal class and closure types
1462         * class.c (finalize_literal_type_property): Handle closures
1463         specifically.
1464         (explain_non_literal_class): Likewise.
1466         PR c++/66297, DR 1684 - literal class and constexpr member fns
1467         * constexpr.c (is_valid_constexpr_fn): Only complain about
1468         non-literal enclosing class in C++11.
1469         * class.c (finalize_literal_type_property): Likewise.
1471 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
1473         PR c++/80186
1474         * pt.c (tsubst_decl): Early return error_mark_node if
1475         grok_ctor_properties returns false.
1477 2017-05-09  Jason Merrill  <jason@redhat.com>
1479         PR c++/70167 - array prvalue treated as lvalue
1480         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1481         (enum fcl_t): New.
1482         * semantics.c (finish_compound_literal): Add fcl_context parameter.
1483         Only make a static variable for C99 syntax.
1484         * parser.c (cp_parser_postfix_expression): Pass it.
1485         * pt.c (tsubst_copy_and_build): Likewise.
1486         * call.c (extend_ref_init_temps): Set
1487         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1489 2017-05-09  Nathan Sidwell  <nathan@acm.org>
1491         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1492         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1493         * name-lookup.h (pushdecl_top_level): Declare.
1495 2017-05-08  Jason Merrill  <jason@redhat.com>
1497         PR c++/80178 - parameter passing for uncopyable classes
1498         * tree.c (type_has_nontrivial_copy_init): True for classes with only
1499         deleted copy/move ctors.
1500         (remember_deleted_copy, maybe_warn_parm_abi): New.
1501         * decl.c (require_complete_types_for_parms, check_function_type):
1502         Call maybe_warn_parm_abi.
1503         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1505 2017-05-08  Nathan Sidwell  <nathan@acm.org>
1507         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1508         (start_preparsed_function): Do decl pushing before setting
1509         current_funciton_decl and announcing it.
1511         * name-lookup.h (pushdecl_with_scope): Replace with ...
1512         (pushdecl_outermost_localscope): ... this.
1513         * name-lookup.c (pushdecl_with_scope): Replace with ...
1514         (pushdecl_outermost_localscope): ... this.
1515         (pushdecl_namespace_level): Adjust.
1516         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1517         * lambda.c (insert_capture_proxy): Likewise.
1519         * class.c (build_vtbl_initializer): Don't shadow outer variable
1520         with static var.
1522         Revert _binding -> _value change.
1523         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1524         (get_namespace_binding, set_global_binding): ... these.
1525         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1526         (get_namespace_binding, set_global_binding): ... these.
1527         (arg_assoc_namespace, pushdecl_maybe_friend_1,
1528         check_for_out_of_scope_variable, push_overloaded_decl_1,
1529         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1530         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1531         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1532         * decl.c (poplevel): Adjust.
1533         * pt.c (make_constrained_auto): Likewise.
1535 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
1537         PR translation/80280
1538         * call.c (print_z_candidate): Fix quoting.
1540 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
1542         * error.c (pedwarn_cxx98): Replace report_diagnostic
1543         with diagnostic_report_diagnostic.
1545 2017-05-05  Nathan Sidwell  <nathan@acm.org>
1547         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1548         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1549         (IDENTIFIER_NAMESPACE_VALUE): Delete.
1550         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1551         with ...
1552         (get_namespace_value, set_global_value): ... these.
1553         (get_global_value_if_present, is_typename_at_global_scope): Delete.
1554         * decl.c (poplevel): Use get_namespace_value.
1555         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1556         * class.c (build_vtbl_initializer): Stash library decl in
1557         static var. Use IDENTIFIER_GLOBAL_VALUE.
1558         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1559         do_allocate_exception, do_free_exception, build_throw): Likewise.
1560         * init.c (throw_bad_array_new_length): Likewise.
1561         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1562         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1563         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1564         get_namespace_value.
1565         (set_namespace_binding_1): Rename to
1566         (set_namespace_binding): ... here.
1567         (set_global_value): New.
1568         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1569         get_namespace_value.
1570         * pt.c (listify): Use get_namespace_value.
1572         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1573         current scope.
1574         * lex.c (unqualified_name_lookup_error): Likewise.
1576         * class.c (alter_class): Use retrofit_lang_decl directly.
1577         * decl.c (push_local_name, dupliate_decls): Likewise.
1578         * semantics.c (omp_privatize_field): Likewise.
1580         Kill walk_namespaces.
1581         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1582         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1584         Kill per-namespace static_decls.
1585         * cp-tree.h (static_decls): Declare.
1586         (wrapup_globals_for_namespace,
1587         diagnose_inline_vars_for_namespace): Replace with ...
1588         (wrapup_namespace_globals): ... this.
1589         * decl.c (static_decls): Define.
1590         (wrapup_globals_for_namespace,
1591         diagnose_inline_vars_for_namespace): Replace with ...
1592         (wrapup_namespace_globals): ... this.
1593         (cxx_init_decl_processing): Initialize static_decls.
1594         * decl2.c (c_parse_final_cleanups): Adjust.
1595         * name-lookup.h (cp_binding_level): Remove static_decls member.
1596         * name-lookup.c (add_decl_to_level): Adjust.
1597         (begin_scope): Adjust.
1599 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
1601         PR c++/71577
1602         * decl.c (reshape_init): Unconditionally return error_mark_node
1603         upon error about too many initializers.
1605 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1607         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1609 2017-05-04  Martin Sebor  <msebor@redhat.com>
1611         PR translation/80280
1612         * call.c (print_z_candidate): Add missing quoting to %D and other
1613         like directives.
1614         (build_op_call_1): Same.
1615         * constraint.cc (diagnose_check_constraint): Same.
1616         * mangle.c (mangle_decl): Same.
1617         * name-lookup.c (cp_binding_level_debug): Same.
1618         (set_decl_namespace): Same.
1619         * parser.c (cp_parser_tx_qualifier_opt): Same.
1620         * pt.c (print_candidates_1): Same.
1621         (check_template_variable): Same.
1622         (tsubst_default_argument): Same.
1623         (most_specialized_partial_spec): Same.
1624         * semantics.c (omp_reduction_lookup): Same.
1625         * tree.c (check_abi_tag_redeclaration): Same.
1626         * typeck.c (comptypes): Same.
1627         * typeck2.c (abstract_virtuals_error_sfinae): Same.
1629 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1631         More global trees.
1632         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1633         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1634         CPTI_INIT_LIST_IDENTIFIER.
1635         (global_namespace, global_type_node, global_identifier,
1636         anon_identifier, init_list_identifier): New.
1637         * decl.c (global_type_node, global_scope_name): Delete.
1638         (initialize_predefined_identifiers): Add new identifiers.
1639         (cxx_init_decl_processing): Adjust.
1640         * name-lookup.h (global_namespace, global_type_node): Delete.
1641         * name-lookup.c (global_namespace, anonymous_namespace_name,
1642         get_anonymous_namespace_name): Delete.
1643         (namespace_scope_ht_size, begin_scope, pushtag_1,
1644         push_namespace): Adjust,
1645         * call.c (type_has_extended_temps): Use init_list_identifier.
1646         * pt.c (listify): Likewise.
1648         * name-lookup.c: Reorder functions to make merging from modules
1649         branch simpler.
1651 2017-05-03  Jason Merrill  <jason@redhat.com>
1653         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1655 2017-05-03  Nathan Sidwell  <nathan@acm.org>
1657         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1658         along with #defines, to before name-lookup include.
1660 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
1662         * pt.c (is_auto_or_concept): Remove.
1663         (type_uses_auto_or_concept): Remove, unused.
1664         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1665         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1666         * cp-tree.h (is_auto_or_concept): Remove.
1668 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
1670         PR c++/80038
1671         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1672         add pedigree operation and detach call here.
1673         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1674         cilk_cp_gimplify_call_params_in_spawned_fn.
1675         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1676         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1678 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
1680         * parser.c (cp_parser_member_declaration): Add fix-it hints for
1681         stray comma and missing semicolon at end of member declaration.
1683 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
1685         * parser.c (cp_parser_cast_expression): Add target type of cast to
1686         diagnostic.
1687         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1689 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1691         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1692         return type to bool.
1693         * cp-tree.h (grok_ctor_properties): Update.
1695 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
1697         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1698         information to diagnostic of invalid colon in nested-name-specifier.
1700 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
1702         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1703         diagnostic of invalid class/struct keyword after enum.
1705 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1707         * parser.c (cp_parser_member_declaration): Add fix-it hint
1708         for removing stray semicolons.
1710 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1712         * name-lookup.c (get_std_name_hint): New function.
1713         (maybe_suggest_missing_header): New function.
1714         (suggest_alternative_in_explicit_scope): Call
1715         maybe_suggest_missing_header.
1717 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
1719         PR c++/80177
1720         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1721         candidate type of bm from tree to const char *.
1722         (consider_binding_level): Likewise.
1723         (lookup_name_fuzzy): Likewise, using this to merge the best
1724         result from the preprocessor into bm, rather than immediately
1725         returning, so that better matches from reserved words can "win".
1726         Guard the rejection of keywords that don't start decl-specifiers
1727         so it only happens for FUZZY_LOOKUP_TYPENAME.
1729 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
1731         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1732         (start_enum): Likewise.
1733         (build_enumerator): Likewise. Use %qE instead of plain %E.
1734         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1735         %<%D%> in diagnostics.
1736         (cp_parser_elaborated_type_specifier): Likewise.
1737         * pt.c (make_pack_expansion): Use %qT and %qE instead of
1738         %<%T%> and %<%E%> in diagnostics.
1739         (tsubst_pack_expansion): Likewise.
1741 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
1743         PR c++/80016
1744         * parser.c (cp_parser_unary_expression):  Generate a location
1745         range for alignof and sizeof expressions.
1747 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
1749         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1750         error message.
1751         (cp_parser_virt_specifier_seq_opt): Likewise.
1752         (set_and_check_decl_spec_loc): Likewise twice.
1754 2017-04-21  Jason Merrill  <jason@redhat.com>
1756         PR c++/80179 - ICE with initialized flexible array member.
1757         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1759 2017-04-21  Richard Biener  <rguenther@suse.de>
1761         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1762         (copy_type): Likewise.
1763         * lex.c (copy_decl): Pass down mem-stat info.
1764         (copy_type): Likewise.
1766 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
1768         PR c++/80473
1769         * init.c (build_new_1): Suppress notes about over-aligned new when
1770         the warning is suppressed.
1772 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
1774         * parser.c (cp_parser_member_declaration): Add warning with fixit
1775         information for extra semicolon after in-class function definition.
1777 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
1779         PR middle-end/80423
1780         * tree.c (build_cplus_array_type): Call build_array_type
1781         with the intended TYPE_TYPELESS_STORAGE flag value, instead
1782         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1783         on the shared type.
1785 2017-04-18  Marek Polacek  <polacek@redhat.com>
1787         PR c++/80244 - ICE with attribute in template alias.
1788         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1790         PR c++/80241 - ICE with alignas pack expansion.
1791         * error.c (dump_expr): Handle TREE_LIST.
1792         * parser.c (cp_parser_std_attribute_list): Return error_mark if
1793         make_pack_expansion returns an error.
1795 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1797         PR c++/80287
1798         * class.c (fixup_may_alias): Fix all type variants.
1800 2017-04-17  Jason Merrill  <jason@redhat.com>
1802         PR c++/80415 - wrong error with default arg and array reference.
1803         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1805         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1807 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
1809         * decl.c (name_unnamed_type): Split out of...
1810         (grokdeclarator): ... this.
1811         * decl.h (name_unnamed_type): Declare.
1813 2017-04-12  Richard Biener  <rguenther@suse.de>
1814         Bernd Edlinger  <bernd.edlinger@hotmail.de>
1816         PR middle-end/79671
1817         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1818         for arrays of character or std::byte type.
1820 2017-04-11  Jason Merrill  <jason@redhat.com>
1822         PR c++/80294 - ICE with constexpr and inheritance.
1823         * constexpr.c (reduced_constant_expression_p):
1824         A null constructor element is non-constant.
1825         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1826         returning an empty base.
1828 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
1830         PR c++/80370
1831         * decl.c (cp_finish_decomp): If processing_template_decl on
1832         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1833         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
1834         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1835         processing.
1836         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1837         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1838         dependent.
1840 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
1842         PR c++/80363
1843         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1845 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
1847         PR c++/80176
1848         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1849         operand, if it is a static member function, recurse on the
1850         BASELINK.
1852 2017-04-10  Marek Polacek  <polacek@redhat.com>
1854         PR sanitizer/80348
1855         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
1856         ORIG_TYPE earlier and not only when shortening.
1858 2017-04-07  Jason Merrill  <jason@redhat.com>
1860         PR c++/80356 - ICE with reference to function template argument.
1861         PR c++/79294
1862         * pt.c (convert_nontype_argument_function): Adjust type even with a
1863         value-dependent argument.
1865         PR c++/80267 - ICE with nested capture of reference
1866         PR c++/60992
1867         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1869 2017-04-07  Marek Polacek  <polacek@redhat.com>
1871         PR sanitizer/80348
1872         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1874         PR c++/80095
1875         * call.c (build_over_call): Don't check cxx_dialect.
1876         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1877         whether SUB is a CONSTRUCTOR.
1878         * init.c (build_new_1): Don't check cxx_dialect.
1879         * tree.c (replace_placeholders): Add a function comment.  Return if
1880         not in C++14, or if the object isn't a (member of a) class.
1881         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1882         TYPE is CLASS_TYPE_P.
1884 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
1886         PR c++/80309
1887         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1888         of a loop doing vec_safe_push of NULL.  Formatting fixes.
1889         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1890         to newidx before calling canonical_type_parameter on newtype.
1892 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
1894         PR c++/80296
1895         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1896         UNARY_PLUS_EXPR case.
1898 2017-04-03  Jason Merrill  <jason@redhat.com>
1900         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1902 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
1904         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1905         * decl2.c (one_static_initialization_or_destruction): Likewise.
1906         * name-lookup.c (store_bindings): Likewise.
1907         * parser.c (make_call_declarator): Likewise.
1908         * pt.c (check_explicit_specialization): Likewise.
1910 2017-04-03  Jason Merrill  <jason@redhat.com>
1912         PR sanitizer/79993 - ICE with VLA initialization from string
1913         PR c++/69487 - wrong VLA initialization from string
1914         * init.c (finish_length_check): Split out from build_vec_init.
1915         (build_vec_init): Handle STRING_CST.
1916         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1917         (digest_init_r): Don't give a STRING_CST VLA type.
1919 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
1921         PR c++/79572
1922         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1923         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
1924         for NOP_EXPR to REFERENCE_TYPE.
1926         PR libstdc++/80251
1927         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1928         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1929         CPTK_IS_AGGREGATE.
1930         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1931         Remove extraneous parens.
1932         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1933         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1934         (cp_parser_trait_expr): Likewise.
1936 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
1938         PR middle-end/80162
1939         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1940         * typeck.c (cxx_mark_addressable): Likewise.  Look through
1941         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1942         to ARRAY_TYPE.
1943         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1945 2017-03-24  Jason Merrill  <jason@redhat.com>
1947         PR c++/77339 - ICE with invalid use of alias template.
1948         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1949         alias template.
1951 2017-03-24  Marek Polacek  <polacek@redhat.com>
1953         PR c++/80119
1954         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1955         doesn't have side effects.
1957 2017-03-23  Jason Merrill  <jason@redhat.com>
1959         PR c++/80150 - ICE with overloaded variadic deduction.
1960         * pt.c (try_one_overload): Remove asserts.
1962         PR c++/77563 - missing ambiguous conversion error.
1963         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1965 2017-03-23  Marek Polacek  <polacek@redhat.com>
1967         * cp-tree.h: Remove a C_RID_YYCODE reference.
1969 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
1971         PR c++/80141
1972         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1973         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1974         processing_template_decl.
1976 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
1978         PR c++/77752
1979         * name-lookup.c (pushtag_1): Add check for bogus, non template,
1980         std::initializer_list.
1982 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
1984         PR c++/35878
1985         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1987 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
1989         PR c++/35878
1990         * init.c (std_placement_new_fn_p): New.
1991         (build_new_1): Call it.
1993 2017-03-20  Jason Merrill  <jason@redhat.com>
1995         PR c++/80096 - ICE with C++17 non-type auto.
1996         * pt.c (tsubst): Delay tsubst of type of template non-type
1997         parameter.
1999         PR c++/79519 - ICE with deleted template friend.
2000         * decl.c (grokdeclarator): Complain about misplaced function
2001         definition using =, as well.
2003         PR c++/79640 - infinite recursion with generic lambda.
2004         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2005         before substituting its initializer.
2007 2017-03-20  Marek Polacek  <polacek@redhat.com>
2008             Paolo Carlini  <paolo.carlini@oracle.com>
2010         PR c++/80059 - ICE with noexcept and __transaction_atomic
2011         * except.c (build_must_not_throw_expr): Call
2012         instantiate_non_dependent_expr.
2014 2017-03-19  Jason Merrill  <jason@redhat.com>
2016         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2017         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2018         reference decomposition.
2020         PR c++/80077 - error with constexpr and -fno-elide-constructors.
2021         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2022         expanding trivial constructor.
2024 2017-03-17  Jason Merrill  <jason@redhat.com>
2026         PR c++/78345 - ICE initializing array from lambda.
2027         * init.c (build_aggr_init): Check array initializer.
2028         (build_vec_init): Check the type of a CONSTRUCTOR.
2030         PR c++/80073 - C++17 ICE with virtual base.
2031         * decl.c (xref_basetypes): Also check for indirect vbases.
2033 2017-03-16  Jason Merrill  <jason@redhat.com>
2035         * decl.c (start_enum): std::byte aliases anything.
2037         PR c++/79797
2038         * constexpr.c (lookup_placeholder): Tweak.
2040 2017-03-15  Jason Merrill  <jason@redhat.com>
2042         PR c++/80043 - ICE with -fpermissive
2043         * typeck.c (convert_for_assignment): Handle instantiate_type
2044         not giving an error.
2046 2017-03-14  Nathan Sidwell  <nathan@acm.org>
2048         PR c++/79393 DR 1658 workaround
2049         * method.c (synthesized_method_base_walk): Inihibit abstract class
2050         virtual base access check here.
2051         (synthesized_method_walk): Not here.
2053 2017-03-13  Nathan Sidwell  <nathan@acm.org>
2055         PR c++/79393 DR 1658 workaround
2056         * method.c (synthesized_method_walk): Check vbases of abstract
2057         classes for dtor walk.
2059 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
2061         PR translation/79848
2062         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2064 2017-03-10  Jason Merrill  <jason@redhat.com>
2066         PR c++/79960 - alias templates and partial ordering
2067         * pt.c (comp_template_args): Add partial_order parm.
2068         (template_args_equal): Likewise.
2069         (comp_template_args_porder): New.
2070         (get_partial_spec_bindings): Use it.
2072 2017-03-10  Marek Polacek  <polacek@redhat.com>
2074         PR c++/79967
2075         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2077 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
2079         PR c++/79899
2080         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2081         Use XALLOCAVEC macro.
2083         PR c++/79896
2084         * decl.c (finish_enum_value_list): If value is error_mark_node,
2085         don't copy it and change its type.
2086         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2087         of CONST_DECL is error_mark_node.
2089 2017-03-09  Marek Polacek  <polacek@redhat.com>
2091         PR c++/79900 - ICE in strip_typedefs
2092         * tree.c (strip_typedefs): Skip the attribute handling if T is
2093         a variant type which hasn't been updated yet.
2095         PR c++/79687 - wrong code with pointer-to-member
2096         * init.c (constant_value_1): Break if the variable has a dynamic
2097         initializer.
2099 2017-03-08  Jason Merrill  <jason@redhat.com>
2101         PR c++/79797 - ICE with self-reference in array DMI.
2102         * constexpr.c (lookup_placeholder): Split out...
2103         (cxx_eval_constant_expression): ...from here.
2105 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
2107         PR c/79834
2108         * parser.c (cp_parser_omp_cancellation_point,
2109         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2110         cp_parser_omp_target_update): Change "may only be used in compound
2111         statements" diagnostics, such that the same translatable string is
2112         used for all pragmas.
2113         (cp_parser_pragma): Likewise.  Use error_at instead of
2114         cp_parser_error for that diagnostics.
2116 2017-03-06  Marek Polacek  <polacek@redhat.com>
2118         PR c++/79796 - ICE with NSDMI and this pointer
2119         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2120         replace_placeholders.
2122 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
2124         PR c++/79822
2125         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2126         ({ (void) 0; }).
2128 2017-03-06  Jason Merrill  <jason@redhat.com>
2130         Revert "Allow deduction guides to look into primary template."
2131         * cp-tree.h, parser.c, pt.c, search.c: Revert.
2133 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
2135         PR c++/70266
2136         * except.c (build_must_not_throw_expr): Perform the implicit
2137         conversions on the condition.
2139 2017-03-03  Jason Merrill  <jason@redhat.com>
2141         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2142         -Wc++1z-compat.
2144         Core issues 2273 and 2277
2145         * call.c (joust): Adjust using-declaration tiebreaker to handle
2146         the intermediate base case.
2147         * method.c (strip_inheriting_ctors): Just return the argument if
2148         !flag_new_inheriting_ctors.
2150 2017-03-03  Richard Biener  <rguenther@suse.de>
2152         PR c++/79825
2153         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2155 2017-03-03  Marek Polacek  <polacek@redhat.com>
2157         PR c++/79791
2158         * typeck.c (string_conv_p): In C++11, always call pedwarn with
2159         OPT_Wwrite_strings.
2161 2017-03-02  Jason Merrill  <jason@redhat.com>
2163         Update overload resolution with deduction guides.
2164         * pt.c (do_class_deduction): Always build the copy guide.
2165         (copy_guide_p, template_guide_p): New.
2166         (build_deduction_guide): Remember the original constructor.
2167         * call.c (joust): Prefer the copy guide and non-template guides.
2169         Allow deduction guides to look into primary template.
2170         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2171         (struct cp_decl_specifier_seq): Add constructor_p.
2172         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2173         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
2174         Clear deduction_guide_type.  Don't handle deduction guide names.
2175         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2176         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
2177         (cp_parser_member_declaration, cp_parser_cache_defarg)
2178         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2179         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2180         (build_deduction_guide): Set deduction_guide_type.
2181         (dependent_scope_p): Check deduction_guide_type.
2182         * search.c (lookup_member): Likewise.
2184 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
2186         PR c++/79782
2187         * init.c (mark_exp_read_r): New function.
2188         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2189         whole arguments instead of plain mark_exp_read on TREE_LIST values.
2191 2017-03-01  Jason Merrill  <jason@redhat.com>
2193         Class template argument deduction in new-expression
2194         * init.c (build_new): Handle deduction from no initializer.
2195         * parser.c (cp_parser_new_expression): Don't require a single
2196         expression for class template deduction.
2197         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2198         class template placeholder.
2199         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2200         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2201         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2203 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
2205         PR c++/79746
2206         * init.c (emit_mem_initializers): When not constructing vbases of
2207         abstract classes, mark arguments as read for
2208         -Wunused-but-set-parameter.
2210 2017-02-28  Jason Merrill  <jason@redhat.com>
2212         Class template argument deduction refinements
2213         * call.c (joust): Move deduction guide tiebreaker down.
2214         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2215         deduction with no initializer.
2216         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2217         (do_class_deduction): Use that rather than special case.
2218         (do_auto_deduction): Handle null initializer.
2220 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
2222         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2223         instead of just cond ? "..." : "...".
2224         (grokdeclarator): Likewise.
2225         (build_enumerator): Likewise.
2226         * init.c (build_new_1): Likewise.
2227         * call.c (build_new_method_call_1): Likewise.
2228         * parser.c: Include intl.h.
2229         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2230         "enter"/"exit" keyword.
2231         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2232         message.
2234 2017-02-27  Jason Merrill  <jason@redhat.com>
2236         PR c++/71568 - SFINAE forming pointer to member function
2237         * init.c (build_offset_ref): Check the return value of
2238         perform_or_defer_access_check.
2240 2017-02-27  Marek Polacek  <polacek@redhat.com>
2242         * decl.c (expand_static_init): Add missing } in a comment.
2244 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
2246         * init.c: Include intl.h.
2247         (build_new_1): Move message strings into pedwarn to make them
2248         -Wformat-security friendly. Mark string for translation.
2249         * pt.c (tsubst_copy_and_build): Mark string for translation.
2250         Make the pointer const.
2251         * semantics.c (finish_id_expression): Mark strings for translation.
2253 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
2255         * call.c (build_op_delete_call): Make msg1 and msg2 const.
2257 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
2259         PR c++/79588
2260         * call.c (build_over_call): Call check_function_arguments even for
2261         -Wrestrict, adjust check_function_arguments caller.
2262         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2263         here.
2264         * typeck.c (cp_build_function_call_vec): Adjust
2265         check_function_arguments caller.
2267 2017-02-24  Marek Polacek  <polacek@redhat.com>
2269         PR translation/79705
2270         * decl.c (check_redeclaration_exception_specification): Mark a string
2271         for translation.  Make the pointer const.
2273 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
2275         PR c++/79361
2276         * pt.c (register_specialization): Check duplicate_decls return value
2277         for error_mark_node and pass it back.
2279 2017-02-22  Jason Merrill  <jason@redhat.com>
2281         PR c++/79679 - missing destructor for argument
2282         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2283         conversions.
2285         * pt.c (do_class_deduction): Handle 0 argument case.
2287 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
2289         PR c++/79664
2290         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2291         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2292         * constexpr.c (potential_constant_expression_1): Handle
2293         OMP_*, OACC_* and CILK_* trees.  Use error_at with
2294         EXPR_LOC_OR_LOC (t, input_location) computed early
2295         instead of error, or error_at with location_of (t).
2297 2017-02-22  Marek Polacek  <polacek@redhat.com>
2299         PR c++/79653
2300         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2301         if the alignas expression is erroneous.
2302         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2303         error_mark_node.
2305         PR c++/79657
2306         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2308 2017-02-21  Jason Merrill  <jason@redhat.com>
2310         PR c++/50308 - wrong deprecated warning with ADL
2311         PR c++/17729 - duplicate deprecated warning
2312         * semantics.c (finish_id_expression): Only call mark_used on a
2313         function if we aren't building a call.
2315         PR c++/41727 - ICE with partial spec of partial instantiation
2316         * pt.c (process_partial_specialization): For now, don't check more
2317         specialized if there is more than one level of args.
2319 2017-02-21  Marek Polacek  <polacek@redhat.com>
2321         PR c++/79535
2322         * cp-tree.h (maybe_reject_flexarray_init): Declare.
2323         * init.c (maybe_reject_flexarray_init): No longer static.
2324         Add check for current_function_decl.
2325         * parser.c (cp_parser_late_parse_one_default_arg): Reject
2326         a default mem-initializer for a flexible array.
2328 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
2329             Paolo Carlini  <paolo.carlini@oracle.com>
2331         PR c++/79654
2332         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2333         on error.
2334         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2335         decl after the decomposition artificial decl has error_mark_node.
2336         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2337         instead of just == error_mark_node comparison.
2339 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
2341         PR sanitizer/79589
2342         * decl.c: Include gimplify.h.
2343         (cp_finish_decomp): Make sure there is no sharing of trees
2344         in between DECL_VALUE_EXPR of decomposition decls.
2346         PR c++/79655
2347         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2349         PR c++/79639
2350         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2351         call cplus_expand_constant on it first.
2353 2017-02-19  Jason Merrill  <jason@redhat.com>
2355         PR c++/78139 - destructor needed by new-expression
2356         * call.c (build_special_member_call): Use tf_no_cleanup.
2358         PR c++/78282 - auto template and pack expansion
2359         * pt.c (find_parameter_packs_r): Don't walk into the type of
2360         templates other than template template-parameters.
2362         PR c++/79606 - ICE with this->base_member in NSDMI
2363         * class.c (build_base_path): Check processing_template_decl.
2365         PR c++/79607 - ICE with T{} initializer
2366         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2368         PR c++/79566 - elaborated-type-specifier in range for
2369         * parser.c (cp_parser_simple_declaration): Fix check for type
2370         definition.
2372         PR c++/79400 - confusing suggestion of 'noexcept'
2373         * parser.c (cp_parser_exception_specification_opt): Remove
2374         suggestion for deprecated dynamic exception-specification.
2376         PR c++/79470 - partial ordering with reference parameters
2377         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2379         PR c++/79500 - ICE with non-template deduction guide
2380         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2381         DECL_TEMPLATE_RESULT.
2383         PR c++/79580 - ICE with compound literal
2384         * parser.c (cp_parser_class_head): If we're in the middle of an
2385         expression, use ts_within_enclosing_non_class.
2387         PR c++/79503 - inherited ctor taking base class
2388         * call.c (add_function_candidate): Also check that
2389         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2391 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
2393         PR c++/79380
2394         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2395         argument.
2397 2017-02-19  Eric Fiselier  <eric@efcs.ca>
2398             Jonathan Wakely  <jwakely@redhat.com>
2400         PR c++/69523
2401         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2402         control warning about literal suffix identifiers without a leading
2403         underscore.
2405 2017-02-17  Jason Merrill  <jason@redhat.com>
2407         PR c++/79508 - lookup error with member template
2408         * parser.c (cp_parser_template_name): Clear
2409         parser->context->object_type if we aren't doing lookup.
2411         PR c++/78690 - ICE with using and global type with same name
2412         * pt.c (type_dependent_object_expression_p): True for
2413         IDENTIFIER_NODE.
2415         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2416         * pt.c (convert_template_argument): Just return an auto arg pack.
2417         (tsubst_template_args): Don't tsubst an auto pack type.
2419         PR c++/79556 - C++17 ICE with non-type auto
2420         * pt.c (do_auto_deduction): Don't try to deduce from null type.
2422         PR c++/79533 - C++17 ICE with temporary cast to reference
2423         * call.c (build_over_call): Conversion to a reference prevents copy
2424         elision.
2426 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
2427             Jason Merrill  <jason@redhat.com>
2429         PR c++/79502 - lost nodiscard attribute
2430         * pt.c (apply_late_template_attributes): Do apply non-dependent
2431         attributes to types.
2433 2017-02-16  Jason Merrill  <jason@redhat.com>
2435         PR c++/78572 - ICE with self-modifying array initializer
2436         * constexpr.c (cxx_eval_store_expression): The object we're
2437         initializing is outside the constant-expression.
2438         (cxx_eval_call_expression): Set ctx->call.
2440         PR c++/79050 - ICE with undeduced auto and LTO
2441         * decl.c (poplevel): Remove undeduced auto decls.
2443 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
2445         PR c++/79512
2446         * parser.c (cp_parser_omp_target): For -fopenmp-simd
2447         ignore #pragma omp target even when not followed by identifier.
2449 2017-02-15  Jason Merrill  <jason@redhat.com>
2450             Jakub Jelinek  <jakub@redhat.com>
2452         PR c++/79464 - ICE in IPA with omitted constructor parms
2453         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2454         (adjust_clone_args): Adjust.
2455         (add_method): Remember omitted parms.
2456         * call.c (add_function_candidate): Likewise.
2457         * mangle.c (write_method_parms): Likewise.
2458         * method.c (ctor_omit_inherited_parms): Return false if there are no
2459         parms to omit.
2461 2017-02-15  Martin Sebor  <msebor@redhat.com>
2463         PR c++/79363
2464         * init.c (maybe_reject_flexarray_init): New function.
2465         (perform_member_init): Call it.
2467 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
2469         PR c++/79301
2470         * parser.c (cp_parser_std_attribute): Don't pedwarn about
2471         [[deprecated]] with -std=c++11 and [[fallthrough]] with
2472         -std=c++11 and -std=c++14.
2474         PR c++/79288
2475         * decl.c (grokdeclarator): For static data members, handle thread_p
2476         only after handling inline.
2478 2017-02-14  Marek Polacek  <polacek@redhat.com>
2480         PR c++/79420
2481         PR c++/79463
2482         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2483         clobbering if the postfix expression isn't an EXPR_P.
2485 2017-02-13  Jason Merrill  <jason@redhat.com>
2487         PR c++/79461 - ICE with lambda in constexpr constructor
2488         * constexpr.c (build_data_member_initialization): Ignore
2489         initialization of a local variable.
2491 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
2493         * init.c (warn_placement_new_too_small): Add missing space in
2494         diagnostics.
2495         * parser.c (cp_parser_oacc_declare): Likewise.
2496         * mangle.c (maybe_check_abi_tags): Likewise.
2498         PR c++/79232
2499         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2500         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2501         in the rightmost operand.
2503 2017-02-13  Nathan Sidwell  <nathan@acm.org>
2505         PR c++/79296 - ICE mangling localized template instantiation
2506         * decl2.c (determine_visibility): Use template fn context for
2507         local class instantiations.
2509 2017-02-11  Jason Merrill  <jason@redhat.com>
2511         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2512         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2513         (build_new_1): Use replace_placeholders.
2514         * tree.c (replace_placeholders_t): Also track whether we've seen a
2515         placeholder.
2516         (replace_placeholders, replace_placeholders_r): Adjust.
2517         * cp-tree.h: Adjust.
2519         PR c++/77790 - ICE with auto function in C++11 mode
2520         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2521         (require_deduced_type): Add complain parm, return bool.
2522         * cp-tree.h: Adjust.
2523         * decl2.c (mark_used): Use require_deduced_type.
2525 2017-02-10  Jason Merrill  <jason@redhat.com>
2527         PR c++/78908 - template ops and bitfields
2528         * tree.c (build_min_non_dep): Use unlowered_expr_type.
2530         PR c++/78897 - constexpr union
2531         * constexpr.c (cxx_eval_store_expression): A store to a union member
2532         erases a previous store to another member.
2534         PR c++/71285 - member of fold-expression
2535         * semantics.c (finish_unary_fold_expr)
2536         (finish_binary_fold_expr): Use null type for fold-expressions.
2538         PR c++/79401 - protected inherited constructor
2539         * call.c (enforce_access): For inheriting constructor, find a base
2540         binfo in the path we already have.
2542 2017-02-10  Marek Polacek  <polacek@redhat.com>
2544         PR c++/79435
2545         * pt.c (type_dependent_expression_p): Check if the expression type
2546         is null.
2548         PR c++/79184
2549         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2550         if warnings shouldn't be given.
2552 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
2554         PR c++/71737
2555         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2556         an error_mark_node as type.
2558 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2559             Jason Merrill  <jason@redhat.com>
2561         PR c++/79143
2562         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2563         from pattern to type.
2565 2017-02-09  Jason Merrill  <jason@redhat.com>
2567         PR c++/79316 - default argument in deduction guide
2568         PR c++/79350 - explicit deduction guide
2569         * parser.c (cp_parser_constructor_declarator_p)
2570         (cp_parser_direct_declarator): Parse deduction guides more like
2571         constructors.
2572         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2573         * tree.c (special_function_p): Return it.
2574         * decl.c (check_special_function_return_type): Handle it.
2575         (grokdeclarator, grokfndecl): Adjust.
2576         (cp_finish_decl): Pass flags to do_auto_deduction.
2577         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2578         * pt.c (dguide_name_p): Take a const_tree.
2579         (do_class_deduction): Handle explicit.
2580         (do_auto_deduction): Pass flags through.
2581         (build_deduction_guide): Copy explicit flag.
2583 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2585         PR c++/79429
2586         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2587         non-pragma_compound context here.
2588         (cp_parser_omp_target): Likewise.
2589         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2590         parsing for ordered and target omp pragmas in non-pragma_stmt
2591         non-pragma_compound contexts.
2593         PR c/79431
2594         * parser.c (cp_parser_oacc_declare): Formatting fix.
2595         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2596         automatic variables.
2598 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
2599             Chung-Lin Tang  <cltang@codesourcery.com>
2601         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
2602         parsing.  Parse constant expression. Remove semantic checking.
2603         (cp_parser_omp_clause_collapse): Disallow tile.
2604         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
2605         error about missing for after already emitting one.  Use more
2606         conventional for idiom for unbounded loop.
2607         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2608         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2609         (finish_omp_for): Deal with tile clause.
2611 2017-02-07  Nathan Sidwell  <nathan@acm.org>
2613         * method.c (synthesized_method_base_walk): New.  Broken out of ...
2614         (synthesized_method_walk): ... here.  Call it.  Cleanup
2615         initializations.
2617 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
2619         PR c++/79360
2620         * typeck2.c (process_init_constructor_union): Consider only
2621         FIELD_DECLs when looking for an NSDMI.
2623 2017-02-06  Jason Merrill  <jason@redhat.com>
2625         PR c++/71193 - incomplete types in templates
2626         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2627         handle incomplete type by pedwarning and then treating as dependent.
2629 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
2631         PR c++/79379
2632         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2633         (potential_constant_expression_1): Likewise.
2635         PR c++/79377
2636         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2637         allow one fewer than expected arguments if flag_permissive.
2639         PR c++/79372
2640         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2641         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2642         with error_mark_node type.
2644 2017-02-03  Jason Merrill  <jason@redhat.com>
2646         PR c++/78689 - ICE on constructor with label
2647         * optimize.c (maybe_clone_body): Replace omitted parameters with
2648         null lvalues.
2649         * class.c (build_clone): Fix logic for omitting inherited parms.
2651         PR c++/12245 - excessive memory use
2652         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2653         back in.  Don't cache constants.
2654         (maybe_constant_init): Don't cache constants.
2656         PR c++/79294 - ICE with invalid template argument
2657         * pt.c (convert_nontype_argument_function): Check value-dependence.
2658         (convert_nontype_argument): Don't check it here for function ptrs.
2660 2017-02-02  Richard Biener  <rguenther@suse.de>
2662         PR cp/14179
2663         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2664         it lazily on the first changed element only and copy it
2665         fully upfront, only storing changed elements.
2667 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
2669         PR c++/69637
2670         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2671         to the width.
2673 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
2675         PR c++/79304
2676         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2677         after ARROW_EXPR.
2679 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
2681         PR c++/79298
2682         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2683         any namespace aliases.
2685 2017-01-31  Nathan Sidwell  <nathan@acm.org>
2687         PR c++/79290
2688         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2690         PR c++/67273
2691         PR c++/79253
2692         * pt.c: (instantiate_decl): Push to top level when current
2693         function scope doesn't match.  Only push lmabda scope stack when
2694         pushing to top.
2696         * cp-tree.h (instantiate_decl): Make defer_ok bool.
2697         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2698         (instantiate_decl): Simplify and reorder state saving and restoration.
2700         PR c++/79264
2701         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2702         * semantics.c (finish_member_declaration): Assert class is being
2703         defined.
2705 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
2707         Introduce C++ support in libcc1.
2708         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2709         (ansi_opname): Rename to...
2710         (cp_operator_id): ... this.  Adjust all callers.
2711         (ansi_assopname): Rename to...
2712         (cp_assignment_operator_id): ... this.  Adjust all callers.
2713         (cp_literal_operator_id): Declare.
2714         (set_global_friend): Declare.
2715         (is_global_friend): Declare.
2716         (enum cp_oracle_request): New type.
2717         (cp_binding_oracle_function): New type.
2718         (cp_binding_oracle): Declare.
2719         (cp_finish_injected_record_type): Declare.
2720         * friend.c (global_friend): New var.
2721         (set_global_friend): New fn.
2722         (is_global_friend): New fn.
2723         (is_friend): Call is_global_friend.
2724         * name-lookup.c (cp_binding_oracle): New var.
2725         (query_oracle): New fn.
2726         (qualified_lookup_using_namespace): Call query_oracle.
2727         (lookup_name_real_1): Likewise.
2728         * parser.c (cp_literal_operator_id): Drop static.
2729         * search.c (friend_accessible_p): Call is_global_friend.
2730         * semantics.c (is_this_parameter): Accept a variable if the
2731         binding oracle is enabled.
2733 2017-01-27  Jason Merrill  <jason@redhat.com>
2735         PR c++/78771 - ICE with inherited constructor.
2736         * call.c (build_over_call): Call deduce_inheriting_ctor here.
2737         * pt.c (tsubst_decl): Not here.
2738         * class.c (add_method): Or here.
2739         * method.c (deduce_inheriting_ctor): Handle clones.
2740         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2742 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
2744         PR c++/64382
2745         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2746         New function.
2747         * cp/cp-tree.h: Declare it.
2748         * cp/semantics.c (finish_id_expression): Resolve names within a default
2749         capturing generic lambda defined within a template prior to
2750         instantiation to allow for captures to be added to the closure type.
2752 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
2754         PR c++/68727
2755         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2756         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2757         * parser.c (cp_parser_builtin_offsetof): Pass result of
2758         build_static_cast of null_pointer_node to finish_offsetof.
2759         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2760         it for -Winvalid-offsetof pedwarn instead of trying to guess
2761         original offsetof type from EXPR.  Save OBJECT_PTR as a new
2762         second operand to OFFSETOF_EXPR.
2763         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2764         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2765         as OBJECT_PTR.
2767 2017-01-26  Jason Merrill  <jason@redhat.com>
2769         * name-lookup.c (parse_using_directive): Deprecate strong using.
2771         PR c++/79176 - lambda ICE with -flto -Os
2772         * decl2.c (vague_linkage_p): Handle decloned 'tors.
2773         * tree.c (decl_linkage): Likewise.
2775 2017-01-25  Martin Sebor  <msebor@redhat.com>
2777         * decl.c (grokdeclarator): Fix a typo in a comment.
2779 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
2781         PR c++/78896
2782         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2783         lambda expressions.
2785         PR c++/77914
2786         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2787         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2789 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
2791         PR lto/79061
2792         * decl.c (cxx_init_decl_processing): Pass main_input_filename
2793         to build_translation_unit_decl.
2795 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
2797         PR c++/79205
2798         * cp-gimplify.c (cp_genericize_r): Add result of
2799         convert_from_reference on invisiref parm to p_set.
2801 2017-01-24  Nathan Sidwell  <nathan@acm.org>
2803         PR c++/78469 - defaulted ctor and inaccessible dtor
2804         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2805         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2806         * tree.c (build_target_expr): Check tf_no_cleanup.
2808         PR c++/79118 - anon-members and constexpr
2809         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2810         ctor decl.  Recursively check anonymous members.
2811         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2812         call.
2813         (explain_invalid_constexpr_fn): Likewise.
2815 2017-01-23  Nathan Sidwell  <nathan@acm.org>
2817         PR c++/71710 - template using directive of field
2818         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2819         check earlier.
2821         PR c++/71406 - ICE with scope-ref'd template id exprs
2822         PR c++/77508
2823         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2824         before breaking up TEMPLATE_ID_EXPR.
2826 2017-01-20  Nathan Sidwell  <nathan@acm.org>
2828         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2829         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2831 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
2833         PR c++/77829
2834         PR c++/78656
2835         * cp-tree.h (suggest_alternatives_for): Add bool param.
2836         (suggest_alternative_in_explicit_scope): New decl.
2837         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2838         that isn't the global one, call new function
2839         suggest_alternative_in_explicit_scope, only calling
2840         suggest_alternatives_for if it fails, and disabling near match
2841         searches fort that case.  When SCOPE is the global namespace,
2842         pass true for new param to suggest_alternatives_for to allow for
2843         fuzzy name lookups.
2844         * lex.c (unqualified_name_lookup_error): Pass true for new param
2845         to suggest_alternatives_for.
2846         * name-lookup.c (consider_binding_level): Add forward decl.
2847         (suggest_alternatives_for): Add "suggest_misspellings" param,
2848         using it to conditionalize the fuzzy name-lookup code.
2849         (suggest_alternative_in_explicit_scope): New function.
2850         * parser.c (cp_parser_primary_expression): When calling
2851         finish_id_expression, pass location of id_expression rather
2852         than that of id_expr_token.
2853         (cp_parser_id_expression): Convert local "unqualified_id" from
2854         tree to cp_expr to avoid implicitly dropping location information.
2856 2017-01-20  Marek Polacek  <polacek@redhat.com>
2858         PR c/64279
2859         * call.c (build_conditional_expr_1): Warn about duplicated branches.
2860         * semantics.c (finish_expr_stmt): Build statement using the proper
2861         location.
2863 2017-01-19  Jason Merrill  <jason@redhat.com>
2865         US 20 - forwarding references and class template argument deduction
2866         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2867         * pt.c (push_template_decl_real): Set it.
2868         (maybe_adjust_types_for_deduction): Check it.
2869         (rewrite_template_parm): Copy it.
2871         US 19 - deduction guides and constructors
2872         * call.c (joust): Prefer deduction guides to constructors.
2873         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2874         (deduction_guide_p): Check DECL_P.
2876         * decl.c (check_initializer): Always use build_aggr_init for array
2877         decomposition.
2879         PR c++/79130 - decomposition and direct-initialization
2880         * init.c (build_aggr_init): Communicate direct-initialization to
2881         build_vec_init.
2882         (build_vec_init): Check for array copy sooner.
2883         * parser.c (cp_parser_decomposition_declaration): Remove call to
2884         build_x_compound_expr_from_list.
2886 2017-01-18  Jason Merrill  <jason@redhat.com>
2888         PR c++/68666 - member variable template-id
2889         * typeck.c (finish_class_member_access_expr): Handle variable
2890         template-id.
2891         * pt.c (lookup_and_finish_template_variable): No longer static.
2892         * cp-tree.h: Declare it.
2894 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2896         PR c++/78488
2897         * call.c (build_over_call): When checking ellipsis conversions for
2898         an inherited ctor, make sure there is at least one conversion.
2900 2017-01-18  Jason Merrill  <jason@redhat.com>
2902         PR c++/78894 - ICE with class deduction and default arg
2903         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2905 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2907         PR c++/77489
2908         * mangle.c (write_discriminator): Reorganize abi warning check.
2910 2017-01-18  Nathan Sidwell  <nathan@acm.org>
2912         * cp-tree.h: Clarify exception spec node comment.
2913         * except.c (nothrow_spec_p): Simplify by checking node-equality.
2915         PR c++/79091
2916         * mangle.c (write_exception_spec): Check nothrow explicitly.
2917         (write_encoding): Don't increment processing_template_decl around
2918         encoding.
2920 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2922         PR c++/70182
2923         * mangle.c (write_template_args): Add "on" for operator names.
2925 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
2927         PR c++/77489
2928         * mangle.c (write_discriminator): Handle discriminator >= 10.
2930 2017-01-17  Nathan Sidwell  <nathan@acm.org>
2932         PR c++/61636
2933         * cp-tree.h (maybe_generic_this_capture): Declare.
2934         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2935         (maybe_resolve_dummy): ... here.  Call it.
2936         (maybe_generic_this_capture): New.
2937         * parser.c (cp_parser_postfix_expression): Speculatively capture
2938         this in generic lambda in unresolved member function call.
2939         * pt.c (tsubst_copy_and_build): Force hard error from failed
2940         member function lookup in generic lambda.
2942 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
2944         PR c++/70565
2945         * cp-array-notation.c (expand_array_notation_exprs): Handle
2946         OMP_PARALLEL.
2948 2017-01-11  Jason Merrill  <jason@redhat.com>
2950         PR c++/78337 - ICE on invalid with generic lambda
2951         * semantics.c (process_outer_var_ref): Check if containing_function
2952         is null.  Move inform call under complain test.
2954 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2956         PR c++/77812
2957         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2958         is a new overload.
2960 2017-01-11  Nathan Sidwell  <nathan@acm.org>
2962         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2964 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
2966         PR c++/78341
2967         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2968         assertion.  Formatting fix.
2970         PR c++/72813
2971         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2972         writing PCH file.
2974 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
2976         PR c++/77949
2977         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2978         a missing semicolon if we have a valid insertion location for
2979         the fix-it hint.
2981 2017-01-10  Jason Merrill  <jason@redhat.com>
2983         FI 20, decomposition declaration with parenthesized initializer.
2984         * parser.c (cp_parser_decomposition_declaration): Use
2985         cp_parser_initializer.
2987 2017-01-09  Jason Merrill  <jason@redhat.com>
2989         Implement P0195R2, C++17 variadic using.
2990         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2991         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2992         * error.c (dump_decl): Likewise.
2994 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
2996         PR translation/79019
2997         PR translation/79020
2998         * semantics.c (finish_omp_clauses): Add missing whitespace to
2999         translatable strings.
3000         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3002 2017-01-07  Jason Merrill  <jason@redhat.com>
3004         PR c++/78948 - instantiation from discarded statement
3005         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3006         * cp-tree.h (in_discarded_stmt): Declare it.
3007         (struct saved_scope): Add discarded_stmt bitfield.
3008         (in_discarded_stmt): New macro.
3009         * decl2.c (mark_used): Check it.
3010         * parser.c (cp_parser_selection_statement): Adjust.
3011         (cp_parser_jump_statement): Adjust.
3013 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
3015         PR c++/78931
3016         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3017         REFERENCE_REF_P, set tt to its operand.
3019         PR c++/78890
3020         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3021         unions even for C++11 and later.
3023 2017-01-05  Nathan Sidwell  <nathan@acm.org>
3025         PR c++/78765
3026         * pt.c (convert_nontype_argument): Don't try and see if integral
3027         or enum expressions are constants prematurely.
3029 2017-01-04  Marek Polacek  <polacek@redhat.com>
3031         PR c++/64767
3032         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3033         a zero character literal.
3035 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
3037         PR c++/78949
3038         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3039         vector type.
3041         PR c++/78693
3042         * parser.c (cp_parser_simple_declaration): Only complain about
3043         inconsistent auto deduction if auto_result doesn't use auto.
3045         * parser.c (cp_parser_simple_declaration): Diagnose function
3046         declaration among more than one init-declarators with auto
3047         specifier.
3049         PR c++/71182
3050         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3051         assertion, as lexer->buffer may be NULL.
3053 2017-01-04  Marek Polacek  <polacek@redhat.com>
3055         PR c++/77545
3056         PR c++/77284
3057         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3059 2017-01-04  Nathan Sidwell  <nathan@acm.org>
3061         PR c++/66735
3062         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3063         (lambda_capture_field_type): Update prototype.
3064         * lambda.c (lambda_capture_field_type): Add is_reference parm.
3065         Add referenceness here.
3066         (add_capture): Adjust lambda_capture_field_type call, refactor
3067         error checking.
3068         * pt.c (tsubst): Adjust lambda_capture_field_type call.
3070 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
3072         Update copyright years.
3074 Copyright (C) 2017 Free Software Foundation, Inc.
3076 Copying and distribution of this file, with or without modification,
3077 are permitted in any medium without royalty provided the copyright
3078 notice and this notice are preserved.