* call.c (add_candidates): Move decls to initialization. Don't
[official-gcc.git] / gcc / cp / ChangeLog
blob7adedbe34f81b3b0d913882ba1e73218f4accc14
1 2017-07-21  Nathan Sidwell  <nathan@acm.org>
3         * call.c (add_candidates): Move decls to initialization.  Don't
4         use !!.
6 2017-07-20  Nathan Sidwell  <nathan@acm.org>
8         Remove TYPE_METHODS.
9         * class.c (maybe_warn_about_overly_private_class,
10         finish_struct_methods, one_inheriting_sig, count_fields,
11         add_fields_to_record_type, check_field_decls, check_methods,
12         clone_function_decl, set_method_tm_attributes,
13         finalize_literal_type_property, check_bases_and_members,
14         create_vtable_ptr, determine_key_method,
15         unreverse_member_declarations, finish_struct,
16         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
17         * decl.c (fixup_anonymous_aggr): Likewise.
18         * decl2.c (reset_type_linkage_2): Likewise.
19         * method.c (after_nsdmi_defaulted_late_checks,
20         lazily_declare_fn): Likewise.
21         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
22         * pt.c (instantiate_class_template_1, tsubst_expr,
23         do_type_instantiation, instantiate_pending_templates): Likewise.
24         * search.c (lookup_field_1): Likewise.
25         * semantics.c (finish_member_declaration,
26         finish_omp_declare_simd_methods): Likewise.
28 2017-07-19  Nathan Sidwell  <nathan@acm.org>
30         * class.c (add_implicitly_declared_members): Use
31         classtype_has_move_assign_or_move_ctor_p.
32         (classtype_has_move_assign_or_move_ctor,
33         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
34         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
35         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
36         Replace with ...
37         (classtype_has_move_assign_or_move_ctor_p): ... this.
38         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
39         * tree.c (type_has_nontrivial_copy_init): Adjust.
41         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
42         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
44 2017-07-18  Nathan Sidwell  <nathan@acm.org>
46         * cp-array-notation.c (build_array_notation_ref): Use
47         TYPE_{MIN,MAX}_VALUE.
49         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
50         (add_implicitly_declared_members): Use it.
51         (type_has_move_constructor, type_has_move_assign): Merge into ...
52         (classtype_has_move_assign_or_move_ctor): ... this new function.
53         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
55 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
57         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
58         friend outside class and obsolete auto as storage-class-specifier.
60 2017-07-17  Nathan Sidwell  <nathan@acm.org>
62         * class.c (maybe_warn_about_overly_private_class): Ignore public
63         copy ctors.
65         * class.c (type_has_user_declared_move_constructor,
66         type_has_user_declared_move_assign): Combine into ...
67         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
68         * cp-tree.h (type_has_user_declared_move_constructor,
69         type_has_user_declared_move_assign): Combine into ...
70         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
71         * method.c (maybe_explain_implicit_delete): Use it.
72         (lazily_declare_fn): Use it.
73         * tree.c (type_has_nontrivial_copy_init): Use it.
75         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
76         semantics, simplify implementation.
78 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
80         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
81         in old-style cast diagnostic.
82         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
83         in useless cast diagnostic.
84         * error.c (type_to_string): Remove enum special handling.
86 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
88         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
89         the header names.
90         (maybe_suggest_missing_header): Update for addition of '<' and '>'
91         to above.  Provide a fix-it hint.
92         * pt.c: Include "gcc-rich-location.h"
93         (listify): Attempt to add fix-it hint for missing
94         #include <initializer_list>.
95         * rtti.c: Include "gcc-rich-location.h".
96         (typeid_ok_p): Attempt to add fix-it hint for missing
97         #include <typeinfo>.
99 2017-07-12  Jason Merrill  <jason@redhat.com>
101         P0512R0 - Deduction from an initializer list.
102         * pt.c (do_class_deduction): Do list deduction in two phases.
104 2017-07-12  Nathan Sidwell  <nathan@acm.org>
106         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
107         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
108         identifier flags.
109         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
110         DECL_CXX_DESTRUCTOR explicitly.
111         * decl2.c (grokclassfn): Likewise.
112         * friend.c (do_friend): Likewise.
113         * method.c (make_thunk, make_alias_for,
114         implicitly_declare_fn): Likewise.
116 2017-07-11  Jason Merrill  <jason@redhat.com>
118         Core DR 393
119         * decl.c (grokparms): Downgrade error about array of unknown bound
120         to pedwarn and disable it for C++17.
122 2017-07-11  Nathan Sidwell  <nathan@acm.org>
124         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
126 2017-07-10  Martin Sebor  <msebor@redhat.com>
128         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
130 2017-07-06  Jason Merrill  <jason@redhat.com>
132         PR c++/81204 - parse error with dependent template-name
133         * parser.c (cp_parser_lookup_name): Revert previous change.
135 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
137         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
138         selftest::run_cp_tests.
139         (selftest::run_cp_tests): New function.
140         * cp-tree.h (selftest::run_cp_tests): New decl.
142 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
144         * parser.c (cp_parser_decomposition_declaration): Replace
145         decomposition declaration with structured binding in diagnostics.
146         * decl.c (cp_finish_decomp): Likewise.
147         (grokdeclarator): Likewise.
149         PR c++/81258
150         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
151         forms of structured binding initializers.
153 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
155         PR c++/65775
156         * decl.c (grokdeclarator): Move checks on function return type after
157         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
158         is UNKNOWN_LOCATION fall back to input_location.
160 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
162         * parser.c (enum required_token): Fix spelling of
163         RT_INTERATION to RT_ITERATION.
164         (cp_parser_iteration_statement): Likewise.
165         (cp_parser_required_error): Likewise.
167 2017-06-30  Jason Merrill  <jason@redhat.com>
169         PR c++/81257 - ICE with invalid ::template.
170         PR c++/54769 - wrong lookup of dependent template-name.
171         * parser.c (cp_parser_template_name): Revert part of last change.
173 2017-06-30  Nathan Sidwell  <nathan@acm.org>
175         * config-lang.in (gtfiles): Add cp/lex.c.
176         * cp-tree.h (mangle_convop_name_for_type): Rename ...
177         (make_conv_op_name): ... here.  Move to lex.
178         * lambda.c (maybe_add_lambda_conv_op): Update.
179         * parser.c (cp_parser_conversion_function_id): Update.
180         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
181         tsubst_copy_and_build): Update.
182         * semantics.c (apply_deduced_return_type): Update.
183         * mangle.c (conv_type_hasher, conv_type_names,
184         mangle_conv_op_name_for_type): Move to ...
185         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
186         ... here.  Rename.
188 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
190         PR c++/80014
191         * parser.c (cp_parser_postfix_expression): Construct a location
192         for typeid expressions.
194 2017-06-30  Nathan Sidwell  <nathan@acm.org>
196         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
197         declare.
198         (lookup_all_conversions): Declare.
199         * class.c (get_basefndecls): Use lookup_fnfields_slot.
200         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
201         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
202         diagnostics.
203         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
204         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
205         lookup_all_conversions.
206         * search.c (lookup_fnfields_1): Make static.
207         (lookup_all_conversions): New.
208         (class_method_index_for_fn): Delete.
209         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
210         lookup_fnfields_slot.
212         * call.c (build_new_method_call_1): Use constructo_name to get
213         ctor name.  Move argument processing earlier to merge cdtor
214         handling blocks.
215         * decl.c (grokfndecl): Cdtors have special names.
216         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
217         * pt.c (check_explicit_specialization): Cdtor name is already
218         special.
219         * search.c (class_method_index_for_fn): Likewise.
221         PR c++/81229
222         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
223         a matching TYPE_DECL.
225 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
227         * class.c (add_method): Change pair of errors to error + inform.
228         (handle_using_decl): Likewise.
230 2017-06-29  Jason Merrill  <jason@redhat.com>
232         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
234         PR c++/81180 - ICE with C++17 deduction of member class template.
235         * pt.c (build_deduction_guide): Correct member template handling.
237         PR c++/81188 - matching decltype of member function call.
238         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
240 2017-06-29  Nathan Sidwell  <nathan@acm.org>
242         PR c++/81247
243         * parser.c (cp_parser_namespace_definition): Immediately close the
244         namespace if there's no open-brace.
245         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
246         namespace.
248 2017-06-29  Jason Merrill  <jason@redhat.com>
250         PR c++/81164 - ICE with invalid inherited constructor.
251         * search.c (binfo_direct_p): New.
252         * name-lookup.c (do_class_using_decl): Use it.
254 2017-06-29  Nathan Sidwell  <nathan@acm.org>
256         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
257         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
258         * decl.c (initialize_predefined_identifiers): Name cdtor special
259         names consistently.  Use literals for above deleted defines.
260         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
262         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
263         flag.
265         * call.c (check_dtor_name): Use constructor_name for enums too.
266         (build_new_method_call_1): Use constructor_name for cdtors and
267         show ~ for dtor.
268         * class.c (build_self_reference): Use TYPE_NAME to get name of
269         self reference.
270         * name-lookup (constructor_name): Use DECL_NAME directly.
271         (constructor_name_p): Reimplement.
272         (push_class_level_binding_1): Use TYPE_NAME directly.
274         * class.c (finish_struct): Use OVL_P.
275         (get_vfield_name): Measure constructor_name length.
276         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
277         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
278         * cxx-pretty-print.c (is_destructor_name): Delete.
279         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
280         * decl.c (grokfndecl): Move cheap checks first when looking for
281         implicit extern cness.
283         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
284         indentation. Remove unnecessary assignment of constructor name.
286         Whitespace cleanups.
287         * call.c (name_as_c_string): Move CONST_CAST to return.
288         (build_new_method_call_1): Remove unneeded bracing.
289         * class.c (include_empty_classes): Unbreak line.
290         * constraint.cc (tsubst_check_constraint): Add space.
291         * cp-tree.h (lang_decl_ns): Add comment.
292         (PTRMEM_CST_MEMBER): Break line.
293         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
294         (grokdeclarator): Remove lines, move declaration to first use.
295         * decl2.c (decl_needed_p): Fix indentation.
296         (c_parse_final_cleanups): Remove blank line.
297         * method.c (implicitly_declare_fn): Move declaration to first use.
298         * search.c (current_scope): Add blank lines.
300 2017-06-28  Jason Merrill  <jason@redhat.com>
302         PR c++/72764 - ICE with invalid template typename.
303         * decl.c (build_typename_type): No longer static.
304         * tree.c (strip_typedefs): Use it instead of make_typename_type.
306         PR c++/69300 - ICE with self-referential noexcept
307         * pt.c (maybe_instantiate_noexcept): Check for recursion.
309         PR c++/61022 - error with variadic template template parm
310         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
312         PR c++/72801 - ICE with variadic partial specialization
313         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
315         PR c++/55639 - partial specialization with ::template
316         * parser.c (cp_parser_class_head): Handle ::template.
318         PR c++/45976 - error with ::template in declarator.
319         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
321         PR c++/54769 - wrong lookup of dependent template-name.
322         * parser.c (cp_parser_template_name): Handle dependent object type.
323         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
324         parameter.
325         (cp_parser_id_expression): Pass it.
326         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
328         * parser.c (cp_parser_template_id): Use the range location on the
329         TEMPLATE_ID_EXPR.
331         PR c++/81204 - parse error with dependent template-name
332         * parser.c (cp_parser_lookup_name): Disqualify function templates
333         after lookup.
335 2017-06-27  Nathan Sidwell  <nathan@acm.org>
337         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
338         initialization point.  Don't unnecessarily check for ctor name.
340         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
341         (CLASSTYPE_DESTRUCTOR): ... this.
342         * class.c (accessible_nvdtor_p,
343         maybe_warn_about_overly_private_class,
344         add_implicitly_declared_members,
345         clone_constructors_and_destructors, type_has_virtual_destructor):
346         Adjust for CLASSTYPE_DESTRUCTOR.
347         (deduce_noexcept_on_destructors): Absorb into ...
348         (check_bases_and_members): ... here.
349         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
350         * init.c (build_delete): Likewise.
351         * parser.c (cp_parser_lookup_name): Likewise.
352         * pt.c (check_explicit_specialization): Likewise.
353         * rtti.c (emit_support_tinfos): Likewise.
354         * search.c (lookup_fnfields_idx_nolazy): Likewise.
356         Kill IDENTIFIER_TEMPLATE.
357         * cp-tree.h (lang_identifier): Remove class_template_info field.
358         (IDENTIFIER_TEMPLATE): Delete.
359         * name-lookup.c (constructor_name_full): Subsume into ...
360         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
361         (constructor_name_p): Likewise.
362         * mangle.c (write_source_name): Likewise.
363         * ptree.c (cxx_print_identifier): Likewise.
365 2017-06-27  Marek Polacek  <polacek@redhat.com>
367         PR bootstrap/81216
368         * parser.c (cp_parser_already_scoped_statement): Initialize
369         LOC_AFTER_LABELS.
371 2017-06-26  Jason Merrill  <jason@redhat.com>
373         PR c++/81215 - deduction failure with variadic TTP.
374         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
376 2017-06-26  Martin Sebor  <msebor@redhat.com>
378         PR c++/81169
379         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
380         to detect casting away cv-qualifiers.
382 2017-06-26  Nathan Sidwell  <nathan@acm.org>
384         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
385         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
386         identifier.
387         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
388         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
389         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
390         * decl.c (grok_op_properties): Adjust identifier checking.
391         * init.c (expand_default_init): Adjust identifier descision.
392         * method.c (implicitly_declare_fn): Don't use
393         DECL_ASSIGNMENT_OPERATOR_P.
394         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
395         IDENTIFIER_DTOR_P.
396         * call.c (in_charge_arg_for_name): Reimplement.
397         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
398         IDENTIFIER_DTOR_P.
400 2017-06-26  Marek Polacek  <polacek@redhat.com>
402         PR c/80116
403         * parser.c (cp_parser_statement): Add a default argument.  Save the
404         location of the expression-statement after labels have been parsed.
405         (cp_parser_implicitly_scoped_statement): Set the location of the
406         body of the conditional after parsing all the labels.  Call
407         warn_for_multistatement_macros.
408         (cp_parser_already_scoped_statement): Likewise.
410 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
412         PR c++/62315
413         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
414         'typename' in error messages about missing 'typename'.
416 2017-06-23  Jason Merrill  <jason@redhat.com>
418         PR c++/79056 - C++17 ICE with invalid template syntax.
419         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
420         is a TYPE_DECL.
421         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
422         * pt.c (template_placeholder_p): New.
423         * cp-tree.h: Declare it.
425 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
427         * decl.c (duplicate_decls): Use builtin_structptr_types.
429 2017-06-22  Nathan Sidwell  <nathan@acm.org>
431         Reorder IDENTIFIER flags
432         gcc/cp/
433         * cp-tree.h (enum cp_identifier_kind): New.
434         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
435         IDENTIFIER_KIND_BIT_2): New.
436         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
437         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
438         (C_IS_RESERVED_WORD): Replace with ...
439         (IDENTIFIER_KEYWORD_P): ... this.
440         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
441         (IDENTIFIER_CDTOR_P): ... this.
442         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
443         (IDENTIFIER_OPNAME_P): Replace with ...
444         (IDENTIFIER_ANY_OP_P): ... this.
445         (IDENTIFIER_ASSIGN_OP_P): New.
446         (IDENTIFIER_TYPENAME_P): Replace with ...
447         (IDENTIFIER_CONV_OP_P): ... this.
448         (NEW_DELETE_OPNAME_P): Replace with ...
449         (IDENTIFIER_NEWDEL_OP_P): ... this.
450         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
451         (get_identifier_kind_name, set_identifier_kind): Declare.
452         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
453         (init_operators): Adjust to avoid keywords, use
454         set_identifier_kind. Copy TYPE_EXPR slot.
455         (init_reswords): Call set_identifier_kind.
456         (unqualified_name_lookup_error): Adjust.
457         * operators.def (TYPE_EXPR): Remove.
458         * decl.c (struct predefined_identifier): Move into ...
459         (initialize_predefined_identifiers): ... here.  Call
460         set_identifier_kind.
461         (grokfndecl, check_var_type, grokdeclarator): Adjust.
462         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
463         space.  Adjust.
464         * call.c (name_as_c_string): Adjust.
465         (build_new_method_call_1): Likewise.
466         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
467         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
468         * dump.c (cp_dump_tree): Adjust.
469         * error.c (dump_decl_name): Adjust.
470         * mangle.c (write_unqualified_id, write_member_name,
471         write_expression): Adjust.
472         (mangle_conv_op_name_for_type): Use set_identifier_kind.
473         * name-lookup.c (do_class_using_decl): Adjust.
474         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
475         * parser.c (cp_lexer_get_preprocessor_token,
476         cp_parser_direct_declarator): Likewise.
477         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
478         tsubst_copy, tsubst_copy_and_build): Adjust.
479         * ptree.c (cxx_print_identifier): Print identifier kind.
480         * search.c (lookup_field_r, lookup_member,
481         lookup_fnfields_idx_nolazy): Adjust.
482         * semantics.c (finish_id_expression): Adjust..
483         * typeck.c (cp_build_addr_expr_1): Adjust.
485 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
487         PR c++/81154
488         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
489         Complain about t not being a variable if t is OVERLOAD even
490         when processing_template_decl.
492 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
494         * parser.c (get_cast_suggestion): New function.
495         (maybe_add_cast_fixit): New function.
496         (cp_parser_cast_expression): Capture the location of the closing
497         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
498         about old-style casts.
500 2017-06-20  Jason Merrill  <jason@redhat.com>
502         PR c++/80972 - C++17 ICE with attribute packed.
503         * call.c (build_over_call): Allow a TARGET_EXPR from reference
504         binding.
506 2017-06-20  Nathan Sidwell  <nathan@acm.org>
508         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
509         (nelts_identifier): Delete.
510         * decl.c (initialize_predefined_identifiers): Remove nelts.
512         PR c++/67074 - namespace aliases
513         * decl.c (duplicate_decls): Don't error here on mismatched
514         namespace alias.
515         * name-lookup.c (name_lookup::add_value): Matching namespaces are
516         not ambiguous.
517         (diagnose_name_conflict): Namespaces are never redeclarations.
518         (update_binding): An alias can match a real namespace.
520 2017-06-19  Jason Merrill  <jason@redhat.com>
522         PR c++/80562 - ICE with constexpr if.
523         * semantics.c (finish_if_stmt_cond): Call
524         instantiate_non_dependent_expr.
526         PR c++/80829 - ICE with constexpr copy of base subobject.
527         * constexpr.c (clear_no_implicit_zero): New.
528         (cxx_eval_call_expression): Call it.
530 2017-06-19  Nathan Sidwell  <nathan@acm.org>
532         PR c++/81124
533         PR c++/79766
534         * name-lookup.c (set_decl_namespace): Don't follow using
535         directives and ignore using decls.  Only check overly-explicit
536         scope after discovering decl.
538 2017-06-19  Jason Merrill  <jason@redhat.com>
540         PR c++/81073 - constexpr and static var in statement-expression.
541         * typeck2.c (store_init_value): Always call
542         require_potential_constant_expression.
543         * pt.c (convert_nontype_argument): Likewise.
544         * constexpr.c (potential_constant_expression_1): Adjust message.
545         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
546         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
548 2017-06-19  Nathan Sidwell  <nathan@acm.org>
550         * pt.c (coerce_template_parms): Fix indentation.
551         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
552         in to single block.
554         PR c++/81119
555         * name-lookup.c (update_binding): Only warn about constructors
556         hidden by functions.
558 2017-06-17  Jason Merrill  <jason@redhat.com>
560         PR c++/60063 - -Wunused-local-typedefs and templates.
561         * decl2.c (is_late_template_attribute): Return false for "used".
563         PR c++/70844 - -Wuseless-cast and inheriting constructor.
564         * method.c (forward_parm): Suppress warn_useless_cast.
566 2017-06-16  Jason Merrill  <jason@redhat.com>
568         PR c++/81045 - Wrong type-dependence with auto return type.
569         * pt.c (type_dependent_expression_p): An undeduced auto outside the
570         template isn't dependent.
571         * call.c (build_over_call): Instantiate undeduced auto even in a
572         template.
574         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
575         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
576         set longer for a generic lambda.
578         PR c++/80614 - Wrong mangling for C++17 noexcept type
579         * mangle.c (write_type): Put the eh spec back on the function type.
581         PR c++/81102 - Wrong error with partial specialization.
582         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
583         types.  Do type deduction later.
585         PR c++/81074 - ICE with partial specialization of member template.
586         PR c++/71747
587         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
589         PR c++/80831 - ICE with -fsyntax-only.
590         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
592         PR c++/80639 - ICE with invalid PMF initialization.
593         PR c++/80043 - ICE with -fpermissive
594         * typeck.c (convert_for_assignment): Recurse when instantiate_type
595         returns without an error.
597 2017-06-16  Nathan Sidwell  <nathan@acm.org>
599         * pt.c (tsubst_baselink): Fix & clarify formatting.
601         * cp-tree.h (build_this_parm, cp_build_parm_decl,
602         build_artificial_parm): Add FN parm.
603         * decl.c (start_cleanup_fn): Adjust.
604         (build_this_parm): Add FN parm, pass it through.
605         (grokfndecl): Adjust parm building.
606         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
607         (build_artificial_parm): Add FN parm, pass through.
608         (maybe_retrofit_in_chrg): Adjust parm building.
609         (start_static_storage_duration_function): Likwise.
610         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
611         * method.c (implicitly_declare_fn): Likewise.
612         * parser.c (inject_this_parameter): Likewise.
614         Symbol tables are insert only.
615         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
616         derive from pointer_hash.  Make undeletable.
618         * class.c (resort_type_method_vec): Avoid potential unsigned
619         overflow.
621         Don't defer noexcept_deferred_spec.
622         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
623         * decl.c (cxx_init_decl_processing): Initialize
624         noexcept_deferred_spec.
625         * except.c (unevaluated_noexcept_spec): Delete.
626         * class.c (deduce_noexcept_on_destructor): Use
627         noexcept_deferred_spec directly.
628         * method.c (implicitly_declare_fn): Likewise.
630         Make keyed_classes a vector.
631         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
632         (keyed_classes): Declare as vector.
633         * decl.c (keyed_classes): Define.
634         (cxx_init_decl_processing): Allocate it.
635         (record_key_method_defined): Use vec_safe_push.
636         * class.c (finish_struct_1): Likewise.
637         * pt.c (instantiate_class_template_1): Likewise.
638         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
640         Make rtti lazier
641         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
642         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
643         (tinfo_names): New.
644         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
645         (get_tinfo_decl): Use get_tinfo_desc.
646         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
647         (create_pseudo_type_info): Delete.
648         (get_pseudo_ti_index): Just determine the index.
649         (get_tinfo_desc): New.  Create all types lazily.
650         (create_tinfo_types): Just allocate the descriptor array.
651         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
652         location.
654 2017-06-15  Martin Sebor  <msebor@redhat.com>
656         PR c++/80560
657         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
658         functions.
659         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
660         (build_cxx_call): Call maybe_warn_class_memaccess.
662 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
664         * cp-gimplify.c (cp_genericize_r): Turn most of the function
665         into a switch (TREE_CODE (stmt)) statement from long else if
666         sequence.
668 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
670         PR c++/80973
671         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
672         argument even if it has REFERENCE_TYPE.
674         PR c++/80984
675         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
676         BLOCK_VARS (outer) chain.
677         (cxx_omp_const_qual_no_mutable): Likewise.
679 2017-06-13  Martin Liska  <mliska@suse.cz>
681         PR sanitize/78204
682         * class.c (build_base_path): Use sanitize_flags_p.
683         * cp-gimplify.c (cp_genericize_r): Likewise.
684         (cp_genericize_tree): Likewise.
685         (cp_genericize): Likewise.
686         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
687         * decl.c (compute_array_index_type): Likewise.
688         (start_preparsed_function): Likewise.
689         * decl2.c (one_static_initialization_or_destruction): Likewise.
690         * init.c (finish_length_check): Likewise.
691         * lambda.c (maybe_add_lambda_conv_op): Likewise.
692         * typeck.c (cp_build_binary_op): Likewise.
693         (build_static_cast_1): Likewise.
695 2017-06-11  Jason Merrill  <jason@redhat.com>
697         * error.c (dump_expr): Use is_this_parameter.
699         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
700         id_equal.
702 2017-06-09  Jason Merrill  <jason@redhat.com>
704         Missing bits from N4268, constant evaluation for all non-type args.
705         * call.c (build_converted_constant_expr): Rename from
706         build_integral_nontype_arg_conv, handle all types.
707         * pt.c (convert_nontype_argument): In C++17 call it for all types.
708         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
709         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
711         Overhaul pointer-to-member conversion and template argument handling.
712         * call.c (standard_conversion): Avoid creating ck_pmem when the
713         class type is the same.
714         * cvt.c (can_convert_qual): Split from
715         perform_qualification_conversions.
716         * constexpr.c (cxx_eval_constant_expression): Check it.
717         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
718         adjustment is necessary.
719         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
720         (convert_nontype_argument): Avoid redundant error.
722         * call.c (convert_like_real): Remove "inner" parameter.
723         Don't replace a constant with its value.
724         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
726         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
727         nullptr_node.
729         * parser.c (cp_parser_constant_expression): Check
730         potential_rvalue_constant_expression after decay_conversion.
731         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
733         PR c++/80384 - ICE with dependent noexcept-specifier
734         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
735         noexcept-specifier.
737         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
739 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
741         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
742         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
743         (excpet.c): Mark terminate as cold.
745 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
747         PR c/81006
748         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
749         to sizetype before size_binop.
751         PR c++/81011
752         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
753         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
754         and OMP_CLAUSE_SHARED_READONLY flags.
756 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
758         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
760 2017-06-07  Nathan Sidwell  <nathan@acm.org>
762         * class.c (layout_class_type): Restructure overlong-bitfield tpe
763         search.
765 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
767         PR c++/80990
768         * pt.c (do_class_deduction): Build qualified type.
770 2017-06-06  Nathan Sidwell  <nathan@acm.org>
772         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
773         sans using directives.  Don't walk into inline namespaces.
775         PR c++/80979
776         * name-lookup.c (adl_class_only): Don't add visible friends.
778 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
780         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
782 2017-06-02  Nathan Sidwell  <nathan@acm.org>
784         Remove lang_type_ptrmem.
785         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
786         into ...
787         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
788         (lang_type): ... this.  Delete old definition.
789         (lang_type_ptrmem): Delete.
790         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
791         (LANG_TYPE_PTRMEM_CHECK): Delete.
792         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
793         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
794         * decl.c (build_ptrmemfunc_type): Adjust.
795         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
796         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
797         
798         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
799         setting.
800         
801         Remove cp_binding_level::namespaces
802         * name-lookup.h (cp_binding_level): Lose namespaces field.
803         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
804         list.
805         (suggest_alternatives_for): Adjust for namespace list.  Do
806         breadth-first search.
807         * decl2.c (collect_source_refs): Namespaces are on the regulr
808         list.
809         (collect_ada_namespace): Likewise.
811 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
813         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
814         warning.
816 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
818         PR c++/80812
819         * method.c (constructible_expr): Strip array types before calling
820         build_value_init.
822 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
824         PR c++/80896
825         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
826         for case INDIRECT_REF too in the main switch.
828 2017-05-31  Jason Merrill  <jason@redhat.com>
830         PR c++/80840 - ICE with constexpr and reference
831         * pt.c (convert_nontype_argument): Don't test whether a decl is
832         value-dependent when binding to a reference.
834 2017-05-31  Nathan Sidwell  <nathan@acm.org>
836         * cp-tree.h (lang_decl_slector): New enum.
837         (lang_decl_base): Make selector an enum.  Drop decomposition_p
838         field.
839         (lang_decl): Use enum for discrimination.
840         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
841         LANG_DECL_DEOMP_CHECK): Use enum.
842         (DECL_DECOMPOSITION_P): Use selector value.
843         (SET_DECL_DECOMPOSITION_P): Delete.
844         (retrofit_lang_decl): Lose SEL parm.
845         (fit_decomposition_lang_decl): Declare.
846         * decl.c (cp_finish_decomp, grokdeclarator): Use
847         fit_decomposition_lang_decl.
848         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
849         retrofit_lang_decl.
850         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
851         (fit_decomposition_lang_decl): Likewise.
852         (retrofit_lang_decl): Use worker functions.
853         (cxx_dup_lang_specific_decl): Use selector enum.
854         (maybe_add_lang_type_raw): New.  Broken out of ...
855         (cxx_make_type_name): ... here.  Call it.
857 2017-05-30  Jason Merrill  <jason@redhat.com>
859         PR c++/80856 - ICE with local extern in template
860         * semantics.c (finish_call_expr): Replace a local extern overload
861         set in a template with the IDENTIFIER_NODE.
863 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
865         * call.c (perform_implicit_conversion_flags): Convert
866         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
867         (print_conversion_rejection): Replace pairs of %qT with
868         %qH and %qI in various places.
869         (build_user_type_conversion_1): Likewise.
870         (build_integral_nontype_arg_conv): Likewise.
871         (build_conditional_expr_1): Likewise.
872         (convert_like_real): Likewise.
873         (convert_arg_to_ellipsis): Likewise.
874         (joust): Likewise.
875         (initialize_reference): Likewise.
876         * cvt.c (cp_convert_to_pointer): Likewise.
877         (cp_convert_to_pointer): Likewise.
878         (convert_to_reference): Likewise.
879         (ocp_convert): Likewise.
880         * error.c (cp_printer): Gain bool and const char ** parameters.
881         (struct deferred_printed_type): New struct.
882         (class cxx_format_postprocessor): New class.
883         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
884         to pp->m_format_postprocessor.
885         (comparable_template_types_p): New function.
886         (newline_and_indent): New function.
887         (arg_to_string): New function.
888         (print_nonequal_arg): New function.
889         (print_template_differences): New function.
890         (type_to_string_with_compare): New function.
891         (print_template_tree_comparison): New function.
892         (append_formatted_chunk): New function.
893         (add_quotes): New function.
894         (cxx_format_postprocessor::handle): New function.
895         (defer_phase_2_of_type_diff): New function.
896         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
897         %H and %I.
898         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
899         %qH and %qI in various places.
900         (convert_member_func_to_ptr): Likewise.
901         (build_reinterpret_cast_1): Likewise.
902         (convert_for_assignment): Likewise.
903         * typeck2.c (check_narrowing): Likewise.
905 2017-05-30  Nathan Sidwell  <nathan@acm.org>
907         Kill IDENTIFIER_NAMESPACE_BINDINGS
908         * cp-tree.h (lang_identifier): Delete namespace_bindings.
909         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
910         (lang_decl_ns): Add bindings.
911         (DECL_NAMESPACE_BINDINGS): New.
912         * lex.c (retrofit_lang_decl): Create namespace hash table.
913         * name-lookup.c (find_namespace_slot): Change to use hash-map.
914         * ptree.c (cxx_print_binding): Delete.
915         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
917         * cp-tree.def (OVERLOAD): Fix comment.
918         * cp-tree.h: Fix comments and whitespace.
919         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
920         * name-lookup.c (add_decl_to_level): Assert not class.
921         (check_local_shadow): Use OVL_P.
922         (pushdecl_with_scope_1): Rename to ...
923         (do_pushdecl_with_Scope): ... here.
924         (do_nonmember_using_decl): Use qualified_namespace_lookup return
925         value.
926         (push_class_level_binding_1): Use OVL_P.
927         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
928         (pushtag_1): Rename to ...
929         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
930         (pushtag): Adjust.
931         (store_class_bindings): Do not time here.
932         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
933         * pt.c (listify): Declare argvec at point of initialization.
935         PR c++/80913
936         * name-lookup.c (add_decl_to_level): Assert not making a circular
937         chain.
938         (update_binding): Don't prematurely slide artificial decl.
940 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
942         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
944 2017-05-29  Nathan Sidwell  <nathan@acm.org>
946         PR c++/80891 (#1,#5)
947         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
948         * name-lookup.c (name_lookup): Add deduping field.
949         (name_lookup::preserve_state, name_lookup::restore_state): Deal
950         with deduping.
951         (name_lookup::add_overload): New.
952         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
953         (name_lookup::search_adl): Set deduping.  Don't unmark here.
954         * pt.c (most_specialized_instantiation): Revert previous change,
955         Assert not given duplicates.
956         * tree.c (lookup_mark): Just mark the underlying decls.
957         (lookup_maybe_add): Dedup using marked decls.
959         PR c++/80891 (#4)
960         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
961         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
963         Stat hack representation
964         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
965         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
966         (stat_hack): New.
967         (find_namespace_binding): Replace with ...
968         (find_namespace_slot): ... this.
969         (find_namespace_value): New.
970         (name_lookup::search_namespace_only,
971         name_lookup::adl_namespace_only): Adjust.
972         (update_binding): Add SLOT parameter, adjust.
973         (check_local_shadow): Use find_namespace_value.
974         (set_local_extern_decl_linkage): Likewise.
975         (do_pushdecl): Adjust for namespace slot.
976         (push_local_binding): Assert not a namespace binding.
977         (check_for_out_of_scope_variable): Use find_namespace_value.
978         (set_identifier_type_value_with_scope): Likewise.
979         (get_namespace_binding): Likewise.
980         (set_namespace_binding): Delete.
981         (set_global_binding): Directly update the binding.
982         (finish_namespace_using_decl): Likewise.
983         (lookup_type_scope_1): Use find_namespace_slot and update.
984         (do_push_nested_namespace): Use find_namespace_value.
986         PR c++/80891 (#1)
987         * pt.c (most_specialized_instantiation): Cope with duplicate
988         instantiations.
990         PR c++/80891 (#3)
991         * cp-tree.h (build_min_nt_call_vec): Declare.
992         * decl.c (build_offset_ref_call_from_tree): Call it.
993         * parser.c (cp_parser_postfix_expression): Likewise.
994         * pt.c (tsubst_copy_and_build): Likewise.
995         * semantics.c (finish_call_expr): Likewise.
996         * tree.c (build_min_nt_loc): Keep unresolved lookups.
997         (build_min): Likewise.
998         (build_min_non_dep): Likewise.
999         (build_min_non_dep_call_vec): Likewise.
1000         (build_min_nt_call_vec): New.
1002         PR c++/80891 (#2)
1003         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
1004         (ovl_used): New.
1005         (lookup_keep): Call it.
1007 2017-05-26  Nathan Sidwell  <nathan@acm.org>
1009         Implement DR2061
1010         * name-lookup.c (push_inline_namespaces): New.
1011         (push_namespace): Look inside inline namespaces.
1013         Inline and using namespace representation change.
1014         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
1015         inlinees as vector.
1016         (DECL_NAMESPACE_USING): Adjust.
1017         (DECL_NAMESPACE_INLINEES): New.
1018         * name-lookup.h (struct cp_binding_level): Change usings
1019         representation.
1020         * name-lookup.c (name_lookup::do_queue_usings,
1021         name_lookup::queue_usings): Adjust.
1022         (name_lookup::search_namespace, name_lookup::search_usings,
1023         name_lookup::queue_namespace): Adjust.
1024         (name_lookup::adl_namespace_only): Adjust.
1025         (add_using_namespace, push_namespace): Push onto vector.
1026         (pop_namespace): Add timing logic.
1028         * call.c (build_operator_new_call): Do namelookup and ADL here.
1029         (build_new_op_1): Likewise.
1030         * name-lookup.h (lookup_function_nonclass): Delete declaration.
1031         (do_using_directive): Likewise.
1032         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
1033         declare early.
1034         (struct scope_binding): Delete.
1035         (EMPTY_SCOPE_BINDING): Delete.
1036         (set_decl_namespace): Use OVL_P.
1037         (finish_local_using_decl): Lose unnecesary checks.
1038         (lookup_function_nonclass): Delete.
1039         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
1041         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
1042         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
1043         unduplicatable.
1044         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
1045         (lkp_iterator): Add outer field.  Adjust ctor.
1046         (lkp_iterator::operator++): New.
1047         (lookup_mark, lookup_maybe_add): Declare.
1048         * name-lookup.c (name_lookup): Delete fn_set member.
1049         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
1050         and mark lookup.
1051         (name_lookup::add_value): Use lookup_add directly.
1052         (name_lookup::add_fns: Use lookup_maybe_add.
1053         (name_lookup::search_adl): Mark and unmark fns.
1054         (pushdecl): Adjust.
1055         * pt.c (check_explicit_specialization): Use lookup_add directly.
1056         * ptree.c (cxx_print_xnode): Show complete overload structure.
1057         * tree.c (lookup_mark, lookup_maybe_add): New.
1059         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
1061 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
1063         * cp-tree.h (struct lang_decl_decomp): New type.
1064         (struct lang_decl): Add u.decomp.
1065         (LANG_DECL_DECOMP_CHECK): Define.
1066         (DECL_DECOMPOSITION_P): Note it is set also on the vars
1067         for user identifiers.
1068         (DECL_DECOMP_BASE): Define.
1069         (retrofit_lang_decl): Add extra int = 0 argument.
1070         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
1071         use it to influence the selector choices and for selector
1072         0 to non-zero transition copy old content.
1073         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
1074         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
1075         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
1076         wording if decl is a structured binding.
1077         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
1078         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
1079         of individual variables for tuple structured bindings.
1080         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
1081         Clear DECL_DECOMP_BASE.
1082         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
1083         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
1084         is expected.
1085         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
1086         DECL_VALUE_EXPR.
1088 2017-05-25  Jason Merrill  <jason@redhat.com>
1090         PR c++/80605 - __is_standard_layout and zero-length array
1091         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
1093 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1095         Kill OVL_CURRENT, OVL_NEXT.
1096         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
1097         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
1098         (consider_binding_level): Use OVL_FIRST.
1099         (cp_emit_debug_info_for_using): Use lkp_iterator.
1100         * pt.c (check_explicit_specialization): Use ovl_iterator.       
1102         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
1103         * cp-tree.h (lang_decl_ns): Remove ns_users field.
1104         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
1105         (TREE_INDIRECT_USING): Delete.
1106         * name-lookup.h (is_associated_namespace): Delete.
1107         * name-lookup.c (name_lookup::search_usings,
1108         name_lookup::do_queue_usings): Usings are always direct.
1109         (is_associated_namespace): Delete.
1110         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
1111         (namespace_ancestor_1, namespace_ancestor): Delete.
1112         (push_using_directive_1, push_using_directive): Delete.
1113         (add_using_namespace_1): Delete.
1114         (add_using_namespace): Reimplement.
1115         (emit_debug_info_using_namespace): New.
1116         (finish_namespace_using_directive, finish_local_using_directive,
1117         push_namespace): Adjust.
1118         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
1120 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
1122         * semantics.c (finish_handler_parms): Warn about non-reference type
1123         catch handlers.
1125 2017-05-25  Nathan Sidwell  <nathan@acm.org>
1127         Reimplement unqualified namespace lookup.
1128         * name-lookup.c (name_lookup::using_pair,
1129         name_lookup::using_queue): New typedefs.
1130         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
1131         name_lookup::queue_usings): New.
1132         (name_lookup::search_unqualified): New.
1133         (merge_functions, same_entity_p, ambiguous_decl,
1134         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
1135         lookup_using_namespace): Delete.
1136         (lookup_name_real_1): Adjust.
1138         Reimplement qualified namespace lookup.
1139         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
1140         (name_lookup::ambiguous, name_lookup::add_value,
1141         name_lookup::add_type, name_lookup::process_binding): New.
1142         (name_lookup::search_namespace_only,
1143         name_lookup::search_namespace, name_lookup::search_usings): New.
1144         (name_lookup::search_qualified): New.
1145         (do_nonmember_using_decl, suggest_alternatives_for,
1146         lookup_qualified_name): Adjust.
1147         (tree_vec_contains): Delete.
1148         (qualified_lookup_using_namespace): Rename to ...
1149         (qualified_namespace_lookup): ... here.  Reimplement.
1151         Reimplement ADL.
1152         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
1153         * name-lookup.h (lookup_arg_dependent): Return plain tree.
1154         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
1155         arg_assoc_args_vec, arg_assoc_type, add_function,
1156         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
1157         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
1158         lookup_arg_dependent_1): Delete.
1159         (name_lookup): New lookup object.
1160         (name_lookup::preserve_state, name_lookup::restore_state,
1161         name_lookup::mark_seen, name_lookup::find_and_mark,
1162         name_lookup::add_fns, name_lookup::adl_namespace_only,
1163         name_lookup::adl_namespace, name_lookup::adl_class_only,
1164         name_lookup::adl_bases, name_lookup::adl_class,
1165         name_lookup::adl_expr, name_lookup::adl_type,
1166         name_lookup::adl_template_arg, name_lookup::search_adl): New.
1167         (lookup_arg_dependent): Return a plain tree.  Adjust.
1168         (is_associated_namespace): Move later.
1169         
1170 2017-05-24  Nathan Sidwell  <nathan@acm.org>
1172         * friend.c (do_friend): Remove check for existing decl.
1173         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1174         * name-lookup.c (push_local_binding): Directly look for binding.
1175         (lookup_name_innermost_nonclass_level_1): Delete.
1176         (lookup_name_innermost_nonclass_level): Delete.
1178         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1180         * cp-tree.h (cp_free_lang_data): Add extern.
1181         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1182         ATTRIBUTE_PURE.
1183         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1184         * typeck.c (type_unknown_p): Delete.
1185         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1186         overload management.
1187         (dependent_name): Likewise.
1188         (decl_anon_ns_mem_p): Simplify.
1190 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
1192         PR c++/80544
1193         * tree.c (reshape_init): Use unqualified type for direct enum init.
1194         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1195         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1196         non-class destination types.
1197         (build_const_cast_1): Strip cv-quals from destination types.
1198         (build_static_cast, build_reinterpret_cast, build_const_cast)
1199         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1201 2017-05-24  Martin Sebor  <msebor@redhat.com>
1203         PR c/80731
1204         * call.c (fully_fold_internal): Adjust.
1206 2017-05-24  Nathan Sidwell  <nathan@acm.org>
1208         * cp-tree.h (ovl_skip_hidden): Declare.
1209         * tree.c (ovl_skip_hidden): New.
1210         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1211         (lookup_arg_dependent_1): Likewise.
1212         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1213         (hidden_name_p, remove_hidden_names): Delete.
1214         (lookup_name_real_1): Do not strip hidden names.
1215         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1217         * cp-tree.h (OVL_HIDDEN_P): New.
1218         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1219         (ovl_iterator::reveal_node): Declare.
1220         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1221         (ovl_insert): Order on hiddenness.
1222         (ovl_iterator::reveal_node): New.
1223         * name-lookup.c (anticipated_builtin_p): New.
1224         (supplement_binding_1): Use it.
1225         (set_local_extern_decl_linkage): Use hidden_p.
1226         (do_pushdecl): Deal with unhiding a hidden decl, use
1227         anticipated_builtin_p.
1228         (do_nonmember_using_decl): Use anticipated_decl_p.
1229         (lookup_name_real_1): Use DECL_HIDDEN_P.
1231 2017-05-23  Jason Merrill  <jason@redhat.com>
1233         -Wunused and C++17 structured bindings
1234         * decl.c (poplevel): Don't warn about unused structured bindings,
1235         only real variables.
1236         * error.c (dump_simple_decl): Handle structured bindings.
1237         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
1239 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1241         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
1242         * name-lookup.c (create_local_binding): New.
1243         (update_binding): New.
1244         (pushdecl_maybe_friend_1): Rename to ...
1245         (do_pushdecl): ... this.  Reimplement.
1246         (pushdecl): Adjust.
1247         (push_overloaded_decl_1, push_overloaded_decl): Delete.
1249 2017-05-23  Jason Merrill  <jason@redhat.com>
1251         PR c++/80396 - built-in for make_integer_sequence.
1252         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
1253         (expand_integer_pack, expand_builtin_pack_call): New.
1254         (find_parameter_packs_r): Check builtin_pack_call_p.
1255         (check_for_bare_parameter_packs): Handle it.
1256         (tsubst_pack_expansion): Call expand_builtin_pack_call.
1257         (declare_integer_pack): New.
1258         (init_template_processing): Call it.
1259         * decl2.c (mark_used): Check builtin_pack_fn_p.
1261 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1263         * name-lookup.c (find_namespace_binding): New.
1264         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
1265         (set_identifier_type_value_with_scope): Use find_namespace_binding.
1266         (find_binding, cp_binding_level_find_binding_for_name,
1267         binding_for_name, namespace_binding_1): Delete.
1268         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
1269         (get_namespace_binding, set_namespace_binding,
1270         finish_namespace_using_decl, unqualified_namespace_lookup_1,
1271         qualified_lookup_using_namespace, lookup_type_scope_1,
1272         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
1274         PR c++/80866
1275         * parser.c (cp_parser_template_id): Keep the lookup when stashing
1276         the template_id.
1278         * cp-tree.h (DECL_HIDDEN_P): New.
1279         * name-lookup.c (set_decl_context,
1280         set_local_extern_decl_linkage): New, broken out of ...
1281         (pushdecl_maybe_friend_1): ... here.  Call them.
1283 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
1285         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
1286         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
1287         "VECTOR_LENGTH".
1289 2017-05-23  Nathan Sidwell  <nathan@acm.org>
1291         * cp-tree.h (OVL_P): New.
1292         * name-lookup.h (push_local_binding): Delete.
1293         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1294         (finish_namespace_using_decl, finish_local_using_decl): ... here
1295         * name-lookup.c (add_decl_to_level): Swap args.
1296         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
1297         (diagnose_name_conflict): Check contexts are same for redecl.
1298         (update_local_overload): New.
1299         (compparms_for_decl_and_using): Rename to ...
1300         (matching_fn_p): ... here.
1301         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
1302         push_local_bindings call.
1303         (push_local_binding): Make static, replace FLAGS arg with
1304         IS_USING.
1305         (validate_nonmember_using_decl): Use OVL_FIRST.
1306         (do_nonmember_using_decl): Use in/out parameters.  Use
1307         lkp_iterator and simplify.
1308         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1309         (finish_namespace_using_decl, finish_local_using_decl): ... here.
1310         Adjust.
1311         (lookup_type_current_level): Delete.
1312         * parser.c (cp_parser_using_declaration): Adjust.
1313         * pt.c (tsubst_expr): Adjust.
1315 2017-05-22  Nathan Sidwell  <nathan@acm.org>
1317         * name-lookup.h (parse_using_directive): Replace with ...
1318         (finish_namespace_using_directive): ... this and ...
1319         (finish_local_using_directive): ... this.
1320         * name-lookup.c (add_using_namespace_1): Move later.
1321         (add_using_namespace): Move later, add namespace_p arg, remove
1322         indirect arg.
1323         (push_using_directive_1): Directly recurse.
1324         (do_using_directive, parse_using_directive): Delete, split into ...
1325         (finish_namespace_using_directive): ... this and ...
1326         (finish_local_using_directive): ... this.
1327         (push_namespace): Use add_using_namespace.
1328         * parser.c (cp_parser_using_directive): Call
1329         finish_namespace_using_directive or finish_local_using_directive.
1330         * pt.c (tsubst_expr): Call finish_local_using_directive.
1332         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
1333         * cp-tree.h (raw_dump_id): Declare.
1334         * decl2.c (raw_dump_id): Define.
1335         (dump_tu): Use raw_dump_id.
1337         * config-lang.in (gtfiles): Sort list, break lines.
1339         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1340         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1341         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1342         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1343         CPTI_RETHROW_FN): New.
1344         (noexcept_deferred_spec): New.
1345         (terminate_node, call_unexpected_node): Rename to ...
1346         (terminate_fn, call_unexpected_fn): ... here.
1347         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1348         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1349         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1350         (init_exception_processing): Adjust.
1351         (declare_library_fn): Create and push the fns here.
1352         (do_get_exception_ptr, do_begin_catch, do_end_catch,
1353         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1354         declare_library_fn use.
1355         (unevaluated_noexcept_spec): Adjust.
1356         * cp-gimplify.c (genericize_eh_spec_block,
1357         gimplify_most_not_throw_expr): Adjust.
1359         * name-lookup.c (pushdecl_top_level,
1360         pushdecl_top_level_and_finish): Move after namespace pushing and
1361         popping functions.
1362         (push_to_top_level): Rename to ...
1363         (do_push_to_top_level): ... here.  Remove timing code.
1364         (pop_from_top_level_1): Rename to ...
1365         (do_pop_from_top_level): ... here.
1366         (do_push_nested_namespace, do_pop_nested_namespace)
1367         (push_to_top_level): New wrapper for do_push_to_top_level.
1368         (pop_from_top_level): Adjust.
1369         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1371 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1373         * config-lang.in (gtfiles): Add c-family/c-format.c,
1374         except.c, init.c, lambda.c and friend.c.
1375         * class.c (dvirt_fn): Move out of function scope,
1376         add GTY attribute.
1377         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1378         * init.c (fn): Likewise.
1379         * lambda.c (ptr_id, max_id): Likewise.
1380         * friend.c (global_friend): Add GTY attribute.
1382 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1384         * call.c (add_list_candidates): Use OVL_FIRST.
1385         (build_new_method_call_1): Likewise.
1386         * cp-tree.h (OVL_SINGLE_P): New.
1387         (TYPE_HIDDEN_P): New.
1388         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1389         * dump.c (cp_tump_tree): Adjust overload dumping.
1390         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1391         printing.
1392         * method.c (lazily_declare_fn): Assert we added it.
1393         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1394         OVL_FIRST.
1395         (cp_parser_template_name): Use lkp_iterator.
1396         * pt.c (begin_template_parm_list): Fixup comment.
1397         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1398         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1399         (ovl_scope): Use lkp_iterator.
1401 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
1403         * parser.c (cp_parser_omp_clause_default): Handle
1404         "OMP_CLAUSE_DEFAULT_PRESENT".
1406         * parser.c (cp_parser_omp_clause_default): Avoid printing more
1407         than one syntax error message.
1409 2017-05-19  Nathan Sidwell  <nathan@acm.org>
1411         * class.c (class_dump_id): Define.
1412         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1413         * cp-objcp-common.c (cp_register_dumps): New.
1414         * cp-objcp-common.h (cp_register_dumps): Declare.
1415         (LANG_HOOKS_REGISTER_DUMPS): Override.
1416         * cp-tree.h (class_dump_id): Declare.
1418 2017-05-18  Nathan Sidwell  <nathan@acm.org>
1420         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1421         (OVL_USED_P): New.
1422         (lookup_keep): Declare.
1423         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1424         * pt.c (tsubst_copy): Assert lookup is persistent.
1425         * semantics.c (finish_call_expr): Use lkp_iterator, call
1426         lookup_keep.
1427         * tree.c (ovl_copy): New.
1428         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1429         (lookup_keep): New.
1431         * cp-tree.h (OVL_USED): Replace with ...
1432         (OVL_USING_P): ... this.
1433         (ovl_iterator::using_p): Adjust.
1434         * name-lookup.c (push_overloaded_decl_1,
1435         do_nonmember_using_decl): Adjust.
1436         * search.c (lookup_field_r): Adjust.
1437         * tree.c (ovl_insert, ovl_scope): Adjust.
1439         * cp-tree.h (lookup_add): Swap args.
1440         (ovl_cons, build_overload): Delete.
1441         * name-lookup.c (add_function, push_overloaded_decl_1,
1442         do_nonmember_using_decl, merge_functions, remove_hidden_names):
1443         Use lookup_add, ovl_insert.
1444         * pt.c (check_explicit_specialization): Use lookup_add.
1445         (do_class_deduction): Likewise. Refactor if.
1446         * tree.c (lookup_add): Swap args.
1447         (ovl_cons, build_overload): Delete.
1449         * name-lookup.c (find_local_binding): New, broken out of ...
1450         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
1451         (set_namespace_binding): Swap scope & name args.
1452         (namespace_binding_1): Likewise.
1453         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1454         (push_overloaded_decl_1): Likewise.
1455         (set_global_binding): Likewise.
1456         (get_namespace_binding): Adjust namespace_binding_1 call.
1458 2017-05-17  Nathan Sidwell  <nathan@acm.org>
1460         * cp-tree.h (default_hash_traits <lang_identifier *>): New
1461         specialization.
1462         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1463         (extern_c_fns): New hash table.
1464         (check_extern_c_conflict): New, broken out of ...
1465         (pushdecl_maybe_friend_1): ... here.  Call it.
1466         (c_linkage_bindings): Just look in hash table.
1468 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
1470         PR c++/80654
1471         PR c++/80682
1472         Implement new C++ intrinsics __is_assignable and __is_constructible.
1473         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1474         (is_xible): New.
1475         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1476         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1477         * method.c (constructible_expr): Set cp_unevaluated.
1478         (is_xible_helper): New.
1479         (is_trivially_xible): Adjust.
1480         (is_xible): New.
1481         * parser.c (cp_parser_primary_expression): Handle
1482         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1483         (cp_parser_trait_expr): Likewise.
1484         * semantics.c (trait_expr_value): Handle
1485         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1487 2017-05-17  Nathan Sidwell  <nathan@acm.org>
1489         * cp-tree.h (ovl_iterator::using_p): New predicate.
1490         (ovl_iterator::remove_node): New worker.
1491         (ovl_insert): Declare.
1492         * tree.c (ovl_insert): New.
1493         (ovl_iterator::remove_node): New.
1494         * class.c (add_method): Use ovl_iterator, ovl_insert.
1495         (clone_function_decl): Fix description.
1496         (clone_constructors_and_destructors): Use ovl_iterator.
1498         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1499         (maybe_warn_about_overly_private_class): Use ovl_iterator.
1500         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1501         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1502         (get_base_fndecls): Use ovl_iterator.
1503         (warn_hidden): Use OVL_NAME, ovl_iterator.
1504         (add_implicitly_declared_members): Use ovl_iterator.
1505         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1506         flatten nested if.
1507         (finish_shorthand_constraint): Simplify, use ovl_make.
1508         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
1509         * search.c (shared_member_p): Use ovl_iterator.
1510         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1511         (lookup_conversion_operator): Use OVL_FIRST.
1512         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1513         (look_for_overrides_here): Use ovl_iterator.
1514         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1515         * typeck.c (build_x_unary_op): Use ovl_make.
1517 2017-05-17  Martin Liska  <mliska@suse.cz>
1519         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1520         use it instead of int type.
1521         (dump_vtable): Likewise.
1522         (dump_vtt): Likewise.
1523         * decl2.c (dump_tu): Likewise.
1525 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
1527         * call.c (enforce_access): Add access_failure_info * param and use
1528         it to record access failures.
1529         * cp-tree.h (class access_failure_info): New class.
1530         (enforce_access): Add access_failure_info * param, defaulting to
1531         NULL.
1532         (lookup_member): Likewise.
1533         (locate_field_accessor): New function decl.
1534         (perform_or_defer_access_check): Add access_failure_info * param,
1535         defaulting to NULL.
1536         * search.c (lookup_member): Add access_failure_info * param and
1537         pass it on to call to perform_or_defer_access_check.
1538         (matches_code_and_type_p): New function.
1539         (field_access_p): New function.
1540         (direct_accessor_p): New function.
1541         (reference_accessor_p): New function.
1542         (field_accessor_p): New function.
1543         (struct locate_field_data): New struct.
1544         (dfs_locate_field_accessor_pre): New function.
1545         (locate_field_accessor): New function.
1546         * semantics.c (perform_or_defer_access_check): Add
1547         access_failure_info * param, and pass it on to call to
1548         enforce_access.
1549         * typeck.c (access_failure_info::record_access_failure): New method.
1550         (access_failure_info::maybe_suggest_accessor): New method.
1551         (finish_class_member_access_expr): Pass an access_failure_info
1552         instance to the lookup_member call, and call its
1553         maybe_suggest_accessor method afterwards.
1555 2017-05-16  Marek Polacek  <polacek@redhat.com>
1557         PR sanitizer/80536
1558         PR sanitizer/80386
1559         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1561 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1563         * name-lookup.c (check_local_shadow): New, broke out of ...
1564         (pushdecl_maybe_friend_1): ... here.  Call it.
1566         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1567         (ovl_first): Move inline definition to end of file.
1568         (ovl_make, lookup_add): Declare.
1569         (get_fns, get_first_fn): Make pure.
1570         * tree.c (ovl_cache): New.
1571         (ovl_make, lookup_add): New.
1572         * pt.c (do_class_deduction): Don't add candidates that will be
1573         elided.
1575         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1576         (print_error_for_call_failure): Use OVL_NAME.
1577         (build_op_call_1): Use ovl_iterator.
1578         (add_candidates): Use OVL_FIRST & lkp_iterator.
1579         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1580         lkp_iterator.
1581         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1582         (type_has_user_nondefault_constructor,
1583         in_class_defaulted_default_constructor,
1584         type_has_user_provided_constructor,
1585         type_has_user_provided_or_explicit_constructor,
1586         type_has_non_user_provided_default_constructor,
1587         vbase_has_user_provided_move_assign,
1588         type_has_move_constructor, type_has_move_assign,
1589         type_has_user_declared_move_constructor,
1590         type_has_user_declared_move_assign,
1591         type_build_ctor_call, type_build_dtor_call,
1592         type_requires_array_cookie, explain_non_literal_class): Likewise.
1593         (finish_struct): Use lkp_iterator.
1594         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1595         (note_name_declared_in_class): Use OVL_NAME.
1596         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1597         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1598         cxx_pretty_printer::expression): Likewise.
1599         * decl2.c (check_classfn): Use ovl_iterator.
1600         * pt.c (retrieve_specialization): Use ovl_iterator.
1601         * tree.c (cp_tree_equal): Use lkp_iterator.
1602         (type_has_nontrivial_copy_init): Use ovl_iterator.
1604         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1605         check is_overloaded_fn.
1607 2017-05-16  Martin Liska  <mliska@suse.cz>
1609         * parser.c (cp_lexer_print_token): Add default value for flags
1610         argument of print_gimple_stmt, print_gimple_expr,
1611         print_generic_stmt and print_generic_expr.
1613 2017-05-16  Nathan Sidwell  <nathan@acm.org>
1615         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1616         iterators.
1617         (MAYBE_BASELINK_FUNCTIONS): New.
1618         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1619         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1620         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1621         * method.c (inherited_ctor_binfo): Use ovl_iterator.
1622         (binfo_inherited_from): Likewise.
1623         * parser.c (lookup_literal_operator): Use lkp_iterator.
1624         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1625         (print_candidates_1): Likewise.
1626         (determine_specialization): Likewise.
1627         (resolve_overloaded_unification): Likewise.
1628         (resolve_nondeduced_context): Likewise.
1629         (type_dependent_expression_p): Likewise.
1630         (dependent_template_p): Likewise.
1631         * ptree.c (cxx_print_xnode): Likewise.
1632         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1633         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1634         * typeck.c (check_template_keyword): Use lkp_iterator.
1636         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1637         (ovl_first): New.
1638         * constexpr.c (function_concept_check): Use OVL_FIRST.
1639         * cvt.c (build_expr_type_conversion): Likewise.
1640         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1641         * decl2.c (mark_used): Use OVL_FIRST.
1642         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1643         (dump_expr, location_of): Use OVL_FIRST.
1644         * friend.c (do_friend): Use OVL_NAME.
1645         * init.c (build_offset_ref): Use OVL_FIRST.
1646         * mangle.c (write_member_name): Likewise.
1647         (write_expression): Use OVL_NAME.
1648         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1649         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1650         * pt.c (check_explicit_specialization): Use OVL_FIRST.
1651         (check_template_shadow): Likewise.
1652         (tsubst_template_args): Use OVL_NAME.
1653         (tsubst_baselink): Use OVL_FIRST.
1654         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1655         * tree.c (get_first_fn): Use OVL_FIRST.
1656         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1657         (cp_build_addr_expr_1): Use OVL_FIRST.
1659         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1660         peeking.
1661         * semantics.c (finish_id_expression): Directly init local var.
1662         (finish_omp_reduction_clause): Use really_overloaded_fn.
1663         * tree.c (get_fns): Document.  Assert we got an overload.
1664         (get_first_fn) Document.
1665         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1666         really_overloaded_fn.
1667         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1669         * cp-tree.h (SCOPE_DEPTH): New.
1670         * name-lookup.h (is_nested_namespace): Declare.
1671         * name-lookup.c (is_nested_namespace): New.
1672         (is_ancestor): Use it.
1673         (set_decl_namespace): Likewise.
1674         (push_namespace): Set SCOPE_DEPTH.
1675         * pt.c (check_specialization_namespace): Use is_nested_namespace.
1676         (check_unqualigied_spec_or_inst): Likewise.
1678 2017-05-15  Nathan Sidwell  <nathan@acm.org>
1680         PR c++/79369
1681         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1682         * name-lookup.h (push_namespace): Return int, add make_inline arg.
1683         * name-lookup.c (push_namespace): Deal with inline directly.
1684         Return pushed count.
1685         * parser.c (cp_parser_namespace_definition): Adjust for
1686         push_namespace change.
1688 2017-05-11  Nathan Sidwell  <nathan@acm.org>
1690         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1691         LANG_HOOKS_PUSHDECL): Move to ...
1692         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1693         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1694         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1696         * name-lookup.h (pushdecl): Add default friend parm.
1697         (pushdecl_maybe_friend): Delete.
1698         (pushdecl_top_level): Add default friend parm.
1699         (pushdecl_top_level_maybe_friend): Delete.
1700         * name-lookup.c (pushdecl_maybe_friend): Delete.
1701         (pushdecl): Add is_friend parm.
1702         (pushdecl_top_level): Add is friend_parm.
1703         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1704         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1705         * friend.c (do_friend): Adjust.
1706         * pt.c (tsubst_friend_class): Adjust.
1708         Revert pushdecl_top_level_and_finish name change.
1709         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1710         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1711         * decl.c (cp_make_fname_decl): Adjust.
1712         * decl2.c (get_guard, handle_tls_init):  Adjust.
1713         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
1715         * name-lookup.c (pushdecl_outermost_localscope): Always
1716         conditionally stop timer.
1718         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1719         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1721         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1722         pushtag_top_level_maybe_friend,
1723         pushdecl_top_level_and_finish): Move declarations to ...
1724         * name-lookup.h: ... here.  Group pushdecl variants.
1725         (pushdecl_top_level_and_finish): Rename to ...
1726         (pushdecl_top_level_with_init): ... here.
1727         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1728         * decl2.c (get_guard, handle_tls_init): Likewise.
1729         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1730         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1731         * method.c (implicitly_declare_fn): Likewise.
1732         * searchc (node_debug_info_needed): Likewise.
1733         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1734         (pushdecl_top_level_with_init): ... here.
1735         (pop_everything): Use namespace_bindings_p.
1737         * name-lookup.h (pop_binding): Rename to pop_local_binding.
1738         (getdecls): Rename to get_local_decls.
1739         * name-lookup.c (pop_binding): Rename to ...
1740         (pop_local_binding): ... here.
1741         (pop_bindings_and_leave_scope): Adjust.
1742         (getdecls): Rename to ...
1743         (get_local_decls): ... here.  Assert local scope.
1744         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
1745         logic.
1746         (store_parm_decls): Adjust get_local_decls call.
1747         (parser.c (synthesize_implicit_template_parm): Likewise.
1749 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
1751         PR c++/80682
1752         * method.c (is_trivially_xible): Reject void types.
1754 2017-05-10  Nathan Sidwell  <nathan@acm.org>
1756         * class.c (handle_using_decl): Always use OVL_CURRENT.
1757         (resolve_address_of_overloaded_function): Move iterator decl into
1758         for scope.  Don't strip anticipated decls here.
1760         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1761         printing.
1762         (print_candidates): Adjust.
1764         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
1765         line breaking.
1766         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
1767         koenig_p handling here.
1768         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1769         (tsubst_omp_clauses): Likewise.
1770         (do_class_deduction): Adjust buld_new_function_call calls.
1771         * semantics.c (finish_call_expr): Likewise.
1773 2017-05-10  Jason Merrill  <jason@redhat.com>
1775         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1776         (unify_type_mismatch, unify_parameter_pack_mismatch)
1777         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1778         (unify_parameter_pack_inconsistent, unify_inconsistency)
1779         (unify_vla_arg, unify_method_type_error, unify_arity)
1780         (unify_arg_conversion, unify_no_common_base)
1781         (unify_inconsistent_template_template_parameters)
1782         (unify_template_deduction_failure)
1783         (unify_template_argument_mismatch)
1784         (unify_overload_resolution_failure): Call unify_invalid.
1786         CWG 1847 - Clarifying compatibility during partial ordering
1787         * pt.c (more_specialized_fn): No order between two non-deducible
1788         parameters.
1790         * pt.c (dependent_type_p): Make sure we aren't called with
1791         global_type_node.
1793         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1794         * pt.c (convert_template_argument): Just return an argument pack.
1795         (coerce_template_parameter_pack, template_parm_to_arg)
1796         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1797         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1798         Don't set the type of a NONTYPE_ARGUMENT_PACK.
1799         * parser.c (make_char_string_pack, make_string_pack): Likewise.
1801 2017-05-10  Nathan Sidwell  <nathan@acm.org>
1803         * cp-tree.h (add_method, clone_function_decl): Change last arg to
1804         bool.
1805         * class.c (add_method): Change third arg to bool.  Adjust.
1806         (one_inheriting_sig, one_inherited_ctor): Adjust.
1807         (clone_function_decl): Change 2nd arg to bool.  Adjust.
1808         (clone_constructors_and_destructors): Adjust.
1809         * lambda.c (maybe_add_lambda_conv_op): Adjust.
1810         * method.c (lazily_declare_fn): Adjust.
1811         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1812         * semantics.c (finish_member_declaration): Adjust.
1814 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1816         PR c++/80145
1817         * decl.c (finish_function): To improve error recovery, change the
1818         logic for calling apply_deduced_return_type.
1820 2017-05-09  Jason Merrill  <jason@redhat.com>
1822         PR c++/80605 - __is_standard_layout and empty base
1823         * class.c (check_bases): Ignore empty bases.
1825         PR c++/70979 - literal class and closure types
1826         * class.c (finalize_literal_type_property): Handle closures
1827         specifically.
1828         (explain_non_literal_class): Likewise.
1830         PR c++/66297, DR 1684 - literal class and constexpr member fns
1831         * constexpr.c (is_valid_constexpr_fn): Only complain about
1832         non-literal enclosing class in C++11.
1833         * class.c (finalize_literal_type_property): Likewise.
1835 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
1837         PR c++/80186
1838         * pt.c (tsubst_decl): Early return error_mark_node if
1839         grok_ctor_properties returns false.
1841 2017-05-09  Jason Merrill  <jason@redhat.com>
1843         PR c++/70167 - array prvalue treated as lvalue
1844         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1845         (enum fcl_t): New.
1846         * semantics.c (finish_compound_literal): Add fcl_context parameter.
1847         Only make a static variable for C99 syntax.
1848         * parser.c (cp_parser_postfix_expression): Pass it.
1849         * pt.c (tsubst_copy_and_build): Likewise.
1850         * call.c (extend_ref_init_temps): Set
1851         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1853 2017-05-09  Nathan Sidwell  <nathan@acm.org>
1855         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1856         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1857         * name-lookup.h (pushdecl_top_level): Declare.
1859 2017-05-08  Jason Merrill  <jason@redhat.com>
1861         PR c++/80178 - parameter passing for uncopyable classes
1862         * tree.c (type_has_nontrivial_copy_init): True for classes with only
1863         deleted copy/move ctors.
1864         (remember_deleted_copy, maybe_warn_parm_abi): New.
1865         * decl.c (require_complete_types_for_parms, check_function_type):
1866         Call maybe_warn_parm_abi.
1867         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1869 2017-05-08  Nathan Sidwell  <nathan@acm.org>
1871         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1872         (start_preparsed_function): Do decl pushing before setting
1873         current_funciton_decl and announcing it.
1875         * name-lookup.h (pushdecl_with_scope): Replace with ...
1876         (pushdecl_outermost_localscope): ... this.
1877         * name-lookup.c (pushdecl_with_scope): Replace with ...
1878         (pushdecl_outermost_localscope): ... this.
1879         (pushdecl_namespace_level): Adjust.
1880         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1881         * lambda.c (insert_capture_proxy): Likewise.
1883         * class.c (build_vtbl_initializer): Don't shadow outer variable
1884         with static var.
1886         Revert _binding -> _value change.
1887         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1888         (get_namespace_binding, set_global_binding): ... these.
1889         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1890         (get_namespace_binding, set_global_binding): ... these.
1891         (arg_assoc_namespace, pushdecl_maybe_friend_1,
1892         check_for_out_of_scope_variable, push_overloaded_decl_1,
1893         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1894         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1895         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1896         * decl.c (poplevel): Adjust.
1897         * pt.c (make_constrained_auto): Likewise.
1899 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
1901         PR translation/80280
1902         * call.c (print_z_candidate): Fix quoting.
1904 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
1906         * error.c (pedwarn_cxx98): Replace report_diagnostic
1907         with diagnostic_report_diagnostic.
1909 2017-05-05  Nathan Sidwell  <nathan@acm.org>
1911         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1912         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1913         (IDENTIFIER_NAMESPACE_VALUE): Delete.
1914         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1915         with ...
1916         (get_namespace_value, set_global_value): ... these.
1917         (get_global_value_if_present, is_typename_at_global_scope): Delete.
1918         * decl.c (poplevel): Use get_namespace_value.
1919         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1920         * class.c (build_vtbl_initializer): Stash library decl in
1921         static var. Use IDENTIFIER_GLOBAL_VALUE.
1922         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1923         do_allocate_exception, do_free_exception, build_throw): Likewise.
1924         * init.c (throw_bad_array_new_length): Likewise.
1925         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1926         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1927         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1928         get_namespace_value.
1929         (set_namespace_binding_1): Rename to
1930         (set_namespace_binding): ... here.
1931         (set_global_value): New.
1932         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1933         get_namespace_value.
1934         * pt.c (listify): Use get_namespace_value.
1936         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1937         current scope.
1938         * lex.c (unqualified_name_lookup_error): Likewise.
1940         * class.c (alter_class): Use retrofit_lang_decl directly.
1941         * decl.c (push_local_name, dupliate_decls): Likewise.
1942         * semantics.c (omp_privatize_field): Likewise.
1944         Kill walk_namespaces.
1945         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1946         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1948         Kill per-namespace static_decls.
1949         * cp-tree.h (static_decls): Declare.
1950         (wrapup_globals_for_namespace,
1951         diagnose_inline_vars_for_namespace): Replace with ...
1952         (wrapup_namespace_globals): ... this.
1953         * decl.c (static_decls): Define.
1954         (wrapup_globals_for_namespace,
1955         diagnose_inline_vars_for_namespace): Replace with ...
1956         (wrapup_namespace_globals): ... this.
1957         (cxx_init_decl_processing): Initialize static_decls.
1958         * decl2.c (c_parse_final_cleanups): Adjust.
1959         * name-lookup.h (cp_binding_level): Remove static_decls member.
1960         * name-lookup.c (add_decl_to_level): Adjust.
1961         (begin_scope): Adjust.
1963 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
1965         PR c++/71577
1966         * decl.c (reshape_init): Unconditionally return error_mark_node
1967         upon error about too many initializers.
1969 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1971         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1973 2017-05-04  Martin Sebor  <msebor@redhat.com>
1975         PR translation/80280
1976         * call.c (print_z_candidate): Add missing quoting to %D and other
1977         like directives.
1978         (build_op_call_1): Same.
1979         * constraint.cc (diagnose_check_constraint): Same.
1980         * mangle.c (mangle_decl): Same.
1981         * name-lookup.c (cp_binding_level_debug): Same.
1982         (set_decl_namespace): Same.
1983         * parser.c (cp_parser_tx_qualifier_opt): Same.
1984         * pt.c (print_candidates_1): Same.
1985         (check_template_variable): Same.
1986         (tsubst_default_argument): Same.
1987         (most_specialized_partial_spec): Same.
1988         * semantics.c (omp_reduction_lookup): Same.
1989         * tree.c (check_abi_tag_redeclaration): Same.
1990         * typeck.c (comptypes): Same.
1991         * typeck2.c (abstract_virtuals_error_sfinae): Same.
1993 2017-05-04  Nathan Sidwell  <nathan@acm.org>
1995         More global trees.
1996         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1997         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1998         CPTI_INIT_LIST_IDENTIFIER.
1999         (global_namespace, global_type_node, global_identifier,
2000         anon_identifier, init_list_identifier): New.
2001         * decl.c (global_type_node, global_scope_name): Delete.
2002         (initialize_predefined_identifiers): Add new identifiers.
2003         (cxx_init_decl_processing): Adjust.
2004         * name-lookup.h (global_namespace, global_type_node): Delete.
2005         * name-lookup.c (global_namespace, anonymous_namespace_name,
2006         get_anonymous_namespace_name): Delete.
2007         (namespace_scope_ht_size, begin_scope, pushtag_1,
2008         push_namespace): Adjust,
2009         * call.c (type_has_extended_temps): Use init_list_identifier.
2010         * pt.c (listify): Likewise.
2012         * name-lookup.c: Reorder functions to make merging from modules
2013         branch simpler.
2015 2017-05-03  Jason Merrill  <jason@redhat.com>
2017         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
2019 2017-05-03  Nathan Sidwell  <nathan@acm.org>
2021         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
2022         along with #defines, to before name-lookup include.
2024 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
2026         * pt.c (is_auto_or_concept): Remove.
2027         (type_uses_auto_or_concept): Remove, unused.
2028         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
2029         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
2030         * cp-tree.h (is_auto_or_concept): Remove.
2032 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
2034         PR c++/80038
2035         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
2036         add pedigree operation and detach call here.
2037         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
2038         cilk_cp_gimplify_call_params_in_spawned_fn.
2039         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
2040         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
2042 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
2044         * parser.c (cp_parser_member_declaration): Add fix-it hints for
2045         stray comma and missing semicolon at end of member declaration.
2047 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
2049         * parser.c (cp_parser_cast_expression): Add target type of cast to
2050         diagnostic.
2051         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
2053 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
2055         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
2056         return type to bool.
2057         * cp-tree.h (grok_ctor_properties): Update.
2059 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
2061         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
2062         information to diagnostic of invalid colon in nested-name-specifier.
2064 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
2066         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
2067         diagnostic of invalid class/struct keyword after enum.
2069 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2071         * parser.c (cp_parser_member_declaration): Add fix-it hint
2072         for removing stray semicolons.
2074 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2076         * name-lookup.c (get_std_name_hint): New function.
2077         (maybe_suggest_missing_header): New function.
2078         (suggest_alternative_in_explicit_scope): Call
2079         maybe_suggest_missing_header.
2081 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
2083         PR c++/80177
2084         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
2085         candidate type of bm from tree to const char *.
2086         (consider_binding_level): Likewise.
2087         (lookup_name_fuzzy): Likewise, using this to merge the best
2088         result from the preprocessor into bm, rather than immediately
2089         returning, so that better matches from reserved words can "win".
2090         Guard the rejection of keywords that don't start decl-specifiers
2091         so it only happens for FUZZY_LOOKUP_TYPENAME.
2093 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2095         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
2096         (start_enum): Likewise.
2097         (build_enumerator): Likewise. Use %qE instead of plain %E.
2098         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
2099         %<%D%> in diagnostics.
2100         (cp_parser_elaborated_type_specifier): Likewise.
2101         * pt.c (make_pack_expansion): Use %qT and %qE instead of
2102         %<%T%> and %<%E%> in diagnostics.
2103         (tsubst_pack_expansion): Likewise.
2105 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
2107         PR c++/80016
2108         * parser.c (cp_parser_unary_expression):  Generate a location
2109         range for alignof and sizeof expressions.
2111 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
2113         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
2114         error message.
2115         (cp_parser_virt_specifier_seq_opt): Likewise.
2116         (set_and_check_decl_spec_loc): Likewise twice.
2118 2017-04-21  Jason Merrill  <jason@redhat.com>
2120         PR c++/80179 - ICE with initialized flexible array member.
2121         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
2123 2017-04-21  Richard Biener  <rguenther@suse.de>
2125         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
2126         (copy_type): Likewise.
2127         * lex.c (copy_decl): Pass down mem-stat info.
2128         (copy_type): Likewise.
2130 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
2132         PR c++/80473
2133         * init.c (build_new_1): Suppress notes about over-aligned new when
2134         the warning is suppressed.
2136 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
2138         * parser.c (cp_parser_member_declaration): Add warning with fixit
2139         information for extra semicolon after in-class function definition.
2141 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
2143         PR middle-end/80423
2144         * tree.c (build_cplus_array_type): Call build_array_type
2145         with the intended TYPE_TYPELESS_STORAGE flag value, instead
2146         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
2147         on the shared type.
2149 2017-04-18  Marek Polacek  <polacek@redhat.com>
2151         PR c++/80244 - ICE with attribute in template alias.
2152         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
2154         PR c++/80241 - ICE with alignas pack expansion.
2155         * error.c (dump_expr): Handle TREE_LIST.
2156         * parser.c (cp_parser_std_attribute_list): Return error_mark if
2157         make_pack_expansion returns an error.
2159 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2161         PR c++/80287
2162         * class.c (fixup_may_alias): Fix all type variants.
2164 2017-04-17  Jason Merrill  <jason@redhat.com>
2166         PR c++/80415 - wrong error with default arg and array reference.
2167         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2169         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2171 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
2173         * decl.c (name_unnamed_type): Split out of...
2174         (grokdeclarator): ... this.
2175         * decl.h (name_unnamed_type): Declare.
2177 2017-04-12  Richard Biener  <rguenther@suse.de>
2178         Bernd Edlinger  <bernd.edlinger@hotmail.de>
2180         PR middle-end/79671
2181         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2182         for arrays of character or std::byte type.
2184 2017-04-11  Jason Merrill  <jason@redhat.com>
2186         PR c++/80294 - ICE with constexpr and inheritance.
2187         * constexpr.c (reduced_constant_expression_p):
2188         A null constructor element is non-constant.
2189         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2190         returning an empty base.
2192 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
2194         PR c++/80370
2195         * decl.c (cp_finish_decomp): If processing_template_decl on
2196         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2197         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
2198         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2199         processing.
2200         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2201         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2202         dependent.
2204 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
2206         PR c++/80363
2207         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2209 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
2211         PR c++/80176
2212         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2213         operand, if it is a static member function, recurse on the
2214         BASELINK.
2216 2017-04-10  Marek Polacek  <polacek@redhat.com>
2218         PR sanitizer/80348
2219         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
2220         ORIG_TYPE earlier and not only when shortening.
2222 2017-04-07  Jason Merrill  <jason@redhat.com>
2224         PR c++/80356 - ICE with reference to function template argument.
2225         PR c++/79294
2226         * pt.c (convert_nontype_argument_function): Adjust type even with a
2227         value-dependent argument.
2229         PR c++/80267 - ICE with nested capture of reference
2230         PR c++/60992
2231         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2233 2017-04-07  Marek Polacek  <polacek@redhat.com>
2235         PR sanitizer/80348
2236         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
2238         PR c++/80095
2239         * call.c (build_over_call): Don't check cxx_dialect.
2240         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
2241         whether SUB is a CONSTRUCTOR.
2242         * init.c (build_new_1): Don't check cxx_dialect.
2243         * tree.c (replace_placeholders): Add a function comment.  Return if
2244         not in C++14, or if the object isn't a (member of a) class.
2245         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
2246         TYPE is CLASS_TYPE_P.
2248 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
2250         PR c++/80309
2251         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
2252         of a loop doing vec_safe_push of NULL.  Formatting fixes.
2253         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
2254         to newidx before calling canonical_type_parameter on newtype.
2256 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
2258         PR c++/80296
2259         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
2260         UNARY_PLUS_EXPR case.
2262 2017-04-03  Jason Merrill  <jason@redhat.com>
2264         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2266 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
2268         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
2269         * decl2.c (one_static_initialization_or_destruction): Likewise.
2270         * name-lookup.c (store_bindings): Likewise.
2271         * parser.c (make_call_declarator): Likewise.
2272         * pt.c (check_explicit_specialization): Likewise.
2274 2017-04-03  Jason Merrill  <jason@redhat.com>
2276         PR sanitizer/79993 - ICE with VLA initialization from string
2277         PR c++/69487 - wrong VLA initialization from string
2278         * init.c (finish_length_check): Split out from build_vec_init.
2279         (build_vec_init): Handle STRING_CST.
2280         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
2281         (digest_init_r): Don't give a STRING_CST VLA type.
2283 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
2285         PR c++/79572
2286         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
2287         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
2288         for NOP_EXPR to REFERENCE_TYPE.
2290         PR libstdc++/80251
2291         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
2292         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2293         CPTK_IS_AGGREGATE.
2294         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
2295         Remove extraneous parens.
2296         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
2297         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
2298         (cp_parser_trait_expr): Likewise.
2300 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
2302         PR middle-end/80162
2303         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
2304         * typeck.c (cxx_mark_addressable): Likewise.  Look through
2305         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
2306         to ARRAY_TYPE.
2307         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2309 2017-03-24  Jason Merrill  <jason@redhat.com>
2311         PR c++/77339 - ICE with invalid use of alias template.
2312         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
2313         alias template.
2315 2017-03-24  Marek Polacek  <polacek@redhat.com>
2317         PR c++/80119
2318         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
2319         doesn't have side effects.
2321 2017-03-23  Jason Merrill  <jason@redhat.com>
2323         PR c++/80150 - ICE with overloaded variadic deduction.
2324         * pt.c (try_one_overload): Remove asserts.
2326         PR c++/77563 - missing ambiguous conversion error.
2327         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2329 2017-03-23  Marek Polacek  <polacek@redhat.com>
2331         * cp-tree.h: Remove a C_RID_YYCODE reference.
2333 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
2335         PR c++/80141
2336         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2337         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2338         processing_template_decl.
2340 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
2342         PR c++/77752
2343         * name-lookup.c (pushtag_1): Add check for bogus, non template,
2344         std::initializer_list.
2346 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
2348         PR c++/35878
2349         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2351 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
2353         PR c++/35878
2354         * init.c (std_placement_new_fn_p): New.
2355         (build_new_1): Call it.
2357 2017-03-20  Jason Merrill  <jason@redhat.com>
2359         PR c++/80096 - ICE with C++17 non-type auto.
2360         * pt.c (tsubst): Delay tsubst of type of template non-type
2361         parameter.
2363         PR c++/79519 - ICE with deleted template friend.
2364         * decl.c (grokdeclarator): Complain about misplaced function
2365         definition using =, as well.
2367         PR c++/79640 - infinite recursion with generic lambda.
2368         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2369         before substituting its initializer.
2371 2017-03-20  Marek Polacek  <polacek@redhat.com>
2372             Paolo Carlini  <paolo.carlini@oracle.com>
2374         PR c++/80059 - ICE with noexcept and __transaction_atomic
2375         * except.c (build_must_not_throw_expr): Call
2376         instantiate_non_dependent_expr.
2378 2017-03-19  Jason Merrill  <jason@redhat.com>
2380         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2381         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2382         reference decomposition.
2384         PR c++/80077 - error with constexpr and -fno-elide-constructors.
2385         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2386         expanding trivial constructor.
2388 2017-03-17  Jason Merrill  <jason@redhat.com>
2390         PR c++/78345 - ICE initializing array from lambda.
2391         * init.c (build_aggr_init): Check array initializer.
2392         (build_vec_init): Check the type of a CONSTRUCTOR.
2394         PR c++/80073 - C++17 ICE with virtual base.
2395         * decl.c (xref_basetypes): Also check for indirect vbases.
2397 2017-03-16  Jason Merrill  <jason@redhat.com>
2399         * decl.c (start_enum): std::byte aliases anything.
2401         PR c++/79797
2402         * constexpr.c (lookup_placeholder): Tweak.
2404 2017-03-15  Jason Merrill  <jason@redhat.com>
2406         PR c++/80043 - ICE with -fpermissive
2407         * typeck.c (convert_for_assignment): Handle instantiate_type
2408         not giving an error.
2410 2017-03-14  Nathan Sidwell  <nathan@acm.org>
2412         PR c++/79393 DR 1658 workaround
2413         * method.c (synthesized_method_base_walk): Inihibit abstract class
2414         virtual base access check here.
2415         (synthesized_method_walk): Not here.
2417 2017-03-13  Nathan Sidwell  <nathan@acm.org>
2419         PR c++/79393 DR 1658 workaround
2420         * method.c (synthesized_method_walk): Check vbases of abstract
2421         classes for dtor walk.
2423 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
2425         PR translation/79848
2426         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2428 2017-03-10  Jason Merrill  <jason@redhat.com>
2430         PR c++/79960 - alias templates and partial ordering
2431         * pt.c (comp_template_args): Add partial_order parm.
2432         (template_args_equal): Likewise.
2433         (comp_template_args_porder): New.
2434         (get_partial_spec_bindings): Use it.
2436 2017-03-10  Marek Polacek  <polacek@redhat.com>
2438         PR c++/79967
2439         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2441 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
2443         PR c++/79899
2444         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2445         Use XALLOCAVEC macro.
2447         PR c++/79896
2448         * decl.c (finish_enum_value_list): If value is error_mark_node,
2449         don't copy it and change its type.
2450         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2451         of CONST_DECL is error_mark_node.
2453 2017-03-09  Marek Polacek  <polacek@redhat.com>
2455         PR c++/79900 - ICE in strip_typedefs
2456         * tree.c (strip_typedefs): Skip the attribute handling if T is
2457         a variant type which hasn't been updated yet.
2459         PR c++/79687 - wrong code with pointer-to-member
2460         * init.c (constant_value_1): Break if the variable has a dynamic
2461         initializer.
2463 2017-03-08  Jason Merrill  <jason@redhat.com>
2465         PR c++/79797 - ICE with self-reference in array DMI.
2466         * constexpr.c (lookup_placeholder): Split out...
2467         (cxx_eval_constant_expression): ...from here.
2469 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
2471         PR c/79834
2472         * parser.c (cp_parser_omp_cancellation_point,
2473         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2474         cp_parser_omp_target_update): Change "may only be used in compound
2475         statements" diagnostics, such that the same translatable string is
2476         used for all pragmas.
2477         (cp_parser_pragma): Likewise.  Use error_at instead of
2478         cp_parser_error for that diagnostics.
2480 2017-03-06  Marek Polacek  <polacek@redhat.com>
2482         PR c++/79796 - ICE with NSDMI and this pointer
2483         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2484         replace_placeholders.
2486 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
2488         PR c++/79822
2489         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2490         ({ (void) 0; }).
2492 2017-03-06  Jason Merrill  <jason@redhat.com>
2494         Revert "Allow deduction guides to look into primary template."
2495         * cp-tree.h, parser.c, pt.c, search.c: Revert.
2497 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
2499         PR c++/70266
2500         * except.c (build_must_not_throw_expr): Perform the implicit
2501         conversions on the condition.
2503 2017-03-03  Jason Merrill  <jason@redhat.com>
2505         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2506         -Wc++1z-compat.
2508         Core issues 2273 and 2277
2509         * call.c (joust): Adjust using-declaration tiebreaker to handle
2510         the intermediate base case.
2511         * method.c (strip_inheriting_ctors): Just return the argument if
2512         !flag_new_inheriting_ctors.
2514 2017-03-03  Richard Biener  <rguenther@suse.de>
2516         PR c++/79825
2517         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2519 2017-03-03  Marek Polacek  <polacek@redhat.com>
2521         PR c++/79791
2522         * typeck.c (string_conv_p): In C++11, always call pedwarn with
2523         OPT_Wwrite_strings.
2525 2017-03-02  Jason Merrill  <jason@redhat.com>
2527         Update overload resolution with deduction guides.
2528         * pt.c (do_class_deduction): Always build the copy guide.
2529         (copy_guide_p, template_guide_p): New.
2530         (build_deduction_guide): Remember the original constructor.
2531         * call.c (joust): Prefer the copy guide and non-template guides.
2533         Allow deduction guides to look into primary template.
2534         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2535         (struct cp_decl_specifier_seq): Add constructor_p.
2536         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2537         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
2538         Clear deduction_guide_type.  Don't handle deduction guide names.
2539         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2540         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
2541         (cp_parser_member_declaration, cp_parser_cache_defarg)
2542         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2543         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2544         (build_deduction_guide): Set deduction_guide_type.
2545         (dependent_scope_p): Check deduction_guide_type.
2546         * search.c (lookup_member): Likewise.
2548 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
2550         PR c++/79782
2551         * init.c (mark_exp_read_r): New function.
2552         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2553         whole arguments instead of plain mark_exp_read on TREE_LIST values.
2555 2017-03-01  Jason Merrill  <jason@redhat.com>
2557         Class template argument deduction in new-expression
2558         * init.c (build_new): Handle deduction from no initializer.
2559         * parser.c (cp_parser_new_expression): Don't require a single
2560         expression for class template deduction.
2561         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2562         class template placeholder.
2563         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2564         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2565         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2567 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
2569         PR c++/79746
2570         * init.c (emit_mem_initializers): When not constructing vbases of
2571         abstract classes, mark arguments as read for
2572         -Wunused-but-set-parameter.
2574 2017-02-28  Jason Merrill  <jason@redhat.com>
2576         Class template argument deduction refinements
2577         * call.c (joust): Move deduction guide tiebreaker down.
2578         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2579         deduction with no initializer.
2580         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2581         (do_class_deduction): Use that rather than special case.
2582         (do_auto_deduction): Handle null initializer.
2584 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
2586         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2587         instead of just cond ? "..." : "...".
2588         (grokdeclarator): Likewise.
2589         (build_enumerator): Likewise.
2590         * init.c (build_new_1): Likewise.
2591         * call.c (build_new_method_call_1): Likewise.
2592         * parser.c: Include intl.h.
2593         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2594         "enter"/"exit" keyword.
2595         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2596         message.
2598 2017-02-27  Jason Merrill  <jason@redhat.com>
2600         PR c++/71568 - SFINAE forming pointer to member function
2601         * init.c (build_offset_ref): Check the return value of
2602         perform_or_defer_access_check.
2604 2017-02-27  Marek Polacek  <polacek@redhat.com>
2606         * decl.c (expand_static_init): Add missing } in a comment.
2608 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
2610         * init.c: Include intl.h.
2611         (build_new_1): Move message strings into pedwarn to make them
2612         -Wformat-security friendly. Mark string for translation.
2613         * pt.c (tsubst_copy_and_build): Mark string for translation.
2614         Make the pointer const.
2615         * semantics.c (finish_id_expression): Mark strings for translation.
2617 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
2619         * call.c (build_op_delete_call): Make msg1 and msg2 const.
2621 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
2623         PR c++/79588
2624         * call.c (build_over_call): Call check_function_arguments even for
2625         -Wrestrict, adjust check_function_arguments caller.
2626         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2627         here.
2628         * typeck.c (cp_build_function_call_vec): Adjust
2629         check_function_arguments caller.
2631 2017-02-24  Marek Polacek  <polacek@redhat.com>
2633         PR translation/79705
2634         * decl.c (check_redeclaration_exception_specification): Mark a string
2635         for translation.  Make the pointer const.
2637 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
2639         PR c++/79361
2640         * pt.c (register_specialization): Check duplicate_decls return value
2641         for error_mark_node and pass it back.
2643 2017-02-22  Jason Merrill  <jason@redhat.com>
2645         PR c++/79679 - missing destructor for argument
2646         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2647         conversions.
2649         * pt.c (do_class_deduction): Handle 0 argument case.
2651 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
2653         PR c++/79664
2654         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2655         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2656         * constexpr.c (potential_constant_expression_1): Handle
2657         OMP_*, OACC_* and CILK_* trees.  Use error_at with
2658         EXPR_LOC_OR_LOC (t, input_location) computed early
2659         instead of error, or error_at with location_of (t).
2661 2017-02-22  Marek Polacek  <polacek@redhat.com>
2663         PR c++/79653
2664         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2665         if the alignas expression is erroneous.
2666         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2667         error_mark_node.
2669         PR c++/79657
2670         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2672 2017-02-21  Jason Merrill  <jason@redhat.com>
2674         PR c++/50308 - wrong deprecated warning with ADL
2675         PR c++/17729 - duplicate deprecated warning
2676         * semantics.c (finish_id_expression): Only call mark_used on a
2677         function if we aren't building a call.
2679         PR c++/41727 - ICE with partial spec of partial instantiation
2680         * pt.c (process_partial_specialization): For now, don't check more
2681         specialized if there is more than one level of args.
2683 2017-02-21  Marek Polacek  <polacek@redhat.com>
2685         PR c++/79535
2686         * cp-tree.h (maybe_reject_flexarray_init): Declare.
2687         * init.c (maybe_reject_flexarray_init): No longer static.
2688         Add check for current_function_decl.
2689         * parser.c (cp_parser_late_parse_one_default_arg): Reject
2690         a default mem-initializer for a flexible array.
2692 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
2693             Paolo Carlini  <paolo.carlini@oracle.com>
2695         PR c++/79654
2696         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2697         on error.
2698         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2699         decl after the decomposition artificial decl has error_mark_node.
2700         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2701         instead of just == error_mark_node comparison.
2703 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
2705         PR sanitizer/79589
2706         * decl.c: Include gimplify.h.
2707         (cp_finish_decomp): Make sure there is no sharing of trees
2708         in between DECL_VALUE_EXPR of decomposition decls.
2710         PR c++/79655
2711         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2713         PR c++/79639
2714         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2715         call cplus_expand_constant on it first.
2717 2017-02-19  Jason Merrill  <jason@redhat.com>
2719         PR c++/78139 - destructor needed by new-expression
2720         * call.c (build_special_member_call): Use tf_no_cleanup.
2722         PR c++/78282 - auto template and pack expansion
2723         * pt.c (find_parameter_packs_r): Don't walk into the type of
2724         templates other than template template-parameters.
2726         PR c++/79606 - ICE with this->base_member in NSDMI
2727         * class.c (build_base_path): Check processing_template_decl.
2729         PR c++/79607 - ICE with T{} initializer
2730         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2732         PR c++/79566 - elaborated-type-specifier in range for
2733         * parser.c (cp_parser_simple_declaration): Fix check for type
2734         definition.
2736         PR c++/79400 - confusing suggestion of 'noexcept'
2737         * parser.c (cp_parser_exception_specification_opt): Remove
2738         suggestion for deprecated dynamic exception-specification.
2740         PR c++/79470 - partial ordering with reference parameters
2741         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2743         PR c++/79500 - ICE with non-template deduction guide
2744         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2745         DECL_TEMPLATE_RESULT.
2747         PR c++/79580 - ICE with compound literal
2748         * parser.c (cp_parser_class_head): If we're in the middle of an
2749         expression, use ts_within_enclosing_non_class.
2751         PR c++/79503 - inherited ctor taking base class
2752         * call.c (add_function_candidate): Also check that
2753         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2755 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
2757         PR c++/79380
2758         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2759         argument.
2761 2017-02-19  Eric Fiselier  <eric@efcs.ca>
2762             Jonathan Wakely  <jwakely@redhat.com>
2764         PR c++/69523
2765         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2766         control warning about literal suffix identifiers without a leading
2767         underscore.
2769 2017-02-17  Jason Merrill  <jason@redhat.com>
2771         PR c++/79508 - lookup error with member template
2772         * parser.c (cp_parser_template_name): Clear
2773         parser->context->object_type if we aren't doing lookup.
2775         PR c++/78690 - ICE with using and global type with same name
2776         * pt.c (type_dependent_object_expression_p): True for
2777         IDENTIFIER_NODE.
2779         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2780         * pt.c (convert_template_argument): Just return an auto arg pack.
2781         (tsubst_template_args): Don't tsubst an auto pack type.
2783         PR c++/79556 - C++17 ICE with non-type auto
2784         * pt.c (do_auto_deduction): Don't try to deduce from null type.
2786         PR c++/79533 - C++17 ICE with temporary cast to reference
2787         * call.c (build_over_call): Conversion to a reference prevents copy
2788         elision.
2790 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
2791             Jason Merrill  <jason@redhat.com>
2793         PR c++/79502 - lost nodiscard attribute
2794         * pt.c (apply_late_template_attributes): Do apply non-dependent
2795         attributes to types.
2797 2017-02-16  Jason Merrill  <jason@redhat.com>
2799         PR c++/78572 - ICE with self-modifying array initializer
2800         * constexpr.c (cxx_eval_store_expression): The object we're
2801         initializing is outside the constant-expression.
2802         (cxx_eval_call_expression): Set ctx->call.
2804         PR c++/79050 - ICE with undeduced auto and LTO
2805         * decl.c (poplevel): Remove undeduced auto decls.
2807 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
2809         PR c++/79512
2810         * parser.c (cp_parser_omp_target): For -fopenmp-simd
2811         ignore #pragma omp target even when not followed by identifier.
2813 2017-02-15  Jason Merrill  <jason@redhat.com>
2814             Jakub Jelinek  <jakub@redhat.com>
2816         PR c++/79464 - ICE in IPA with omitted constructor parms
2817         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2818         (adjust_clone_args): Adjust.
2819         (add_method): Remember omitted parms.
2820         * call.c (add_function_candidate): Likewise.
2821         * mangle.c (write_method_parms): Likewise.
2822         * method.c (ctor_omit_inherited_parms): Return false if there are no
2823         parms to omit.
2825 2017-02-15  Martin Sebor  <msebor@redhat.com>
2827         PR c++/79363
2828         * init.c (maybe_reject_flexarray_init): New function.
2829         (perform_member_init): Call it.
2831 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
2833         PR c++/79301
2834         * parser.c (cp_parser_std_attribute): Don't pedwarn about
2835         [[deprecated]] with -std=c++11 and [[fallthrough]] with
2836         -std=c++11 and -std=c++14.
2838         PR c++/79288
2839         * decl.c (grokdeclarator): For static data members, handle thread_p
2840         only after handling inline.
2842 2017-02-14  Marek Polacek  <polacek@redhat.com>
2844         PR c++/79420
2845         PR c++/79463
2846         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2847         clobbering if the postfix expression isn't an EXPR_P.
2849 2017-02-13  Jason Merrill  <jason@redhat.com>
2851         PR c++/79461 - ICE with lambda in constexpr constructor
2852         * constexpr.c (build_data_member_initialization): Ignore
2853         initialization of a local variable.
2855 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
2857         * init.c (warn_placement_new_too_small): Add missing space in
2858         diagnostics.
2859         * parser.c (cp_parser_oacc_declare): Likewise.
2860         * mangle.c (maybe_check_abi_tags): Likewise.
2862         PR c++/79232
2863         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2864         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2865         in the rightmost operand.
2867 2017-02-13  Nathan Sidwell  <nathan@acm.org>
2869         PR c++/79296 - ICE mangling localized template instantiation
2870         * decl2.c (determine_visibility): Use template fn context for
2871         local class instantiations.
2873 2017-02-11  Jason Merrill  <jason@redhat.com>
2875         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2876         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2877         (build_new_1): Use replace_placeholders.
2878         * tree.c (replace_placeholders_t): Also track whether we've seen a
2879         placeholder.
2880         (replace_placeholders, replace_placeholders_r): Adjust.
2881         * cp-tree.h: Adjust.
2883         PR c++/77790 - ICE with auto function in C++11 mode
2884         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2885         (require_deduced_type): Add complain parm, return bool.
2886         * cp-tree.h: Adjust.
2887         * decl2.c (mark_used): Use require_deduced_type.
2889 2017-02-10  Jason Merrill  <jason@redhat.com>
2891         PR c++/78908 - template ops and bitfields
2892         * tree.c (build_min_non_dep): Use unlowered_expr_type.
2894         PR c++/78897 - constexpr union
2895         * constexpr.c (cxx_eval_store_expression): A store to a union member
2896         erases a previous store to another member.
2898         PR c++/71285 - member of fold-expression
2899         * semantics.c (finish_unary_fold_expr)
2900         (finish_binary_fold_expr): Use null type for fold-expressions.
2902         PR c++/79401 - protected inherited constructor
2903         * call.c (enforce_access): For inheriting constructor, find a base
2904         binfo in the path we already have.
2906 2017-02-10  Marek Polacek  <polacek@redhat.com>
2908         PR c++/79435
2909         * pt.c (type_dependent_expression_p): Check if the expression type
2910         is null.
2912         PR c++/79184
2913         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2914         if warnings shouldn't be given.
2916 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
2918         PR c++/71737
2919         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2920         an error_mark_node as type.
2922 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2923             Jason Merrill  <jason@redhat.com>
2925         PR c++/79143
2926         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2927         from pattern to type.
2929 2017-02-09  Jason Merrill  <jason@redhat.com>
2931         PR c++/79316 - default argument in deduction guide
2932         PR c++/79350 - explicit deduction guide
2933         * parser.c (cp_parser_constructor_declarator_p)
2934         (cp_parser_direct_declarator): Parse deduction guides more like
2935         constructors.
2936         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2937         * tree.c (special_function_p): Return it.
2938         * decl.c (check_special_function_return_type): Handle it.
2939         (grokdeclarator, grokfndecl): Adjust.
2940         (cp_finish_decl): Pass flags to do_auto_deduction.
2941         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2942         * pt.c (dguide_name_p): Take a const_tree.
2943         (do_class_deduction): Handle explicit.
2944         (do_auto_deduction): Pass flags through.
2945         (build_deduction_guide): Copy explicit flag.
2947 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
2949         PR c++/79429
2950         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2951         non-pragma_compound context here.
2952         (cp_parser_omp_target): Likewise.
2953         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2954         parsing for ordered and target omp pragmas in non-pragma_stmt
2955         non-pragma_compound contexts.
2957         PR c/79431
2958         * parser.c (cp_parser_oacc_declare): Formatting fix.
2959         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2960         automatic variables.
2962 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
2963             Chung-Lin Tang  <cltang@codesourcery.com>
2965         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
2966         parsing.  Parse constant expression. Remove semantic checking.
2967         (cp_parser_omp_clause_collapse): Disallow tile.
2968         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
2969         error about missing for after already emitting one.  Use more
2970         conventional for idiom for unbounded loop.
2971         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2972         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2973         (finish_omp_for): Deal with tile clause.
2975 2017-02-07  Nathan Sidwell  <nathan@acm.org>
2977         * method.c (synthesized_method_base_walk): New.  Broken out of ...
2978         (synthesized_method_walk): ... here.  Call it.  Cleanup
2979         initializations.
2981 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
2983         PR c++/79360
2984         * typeck2.c (process_init_constructor_union): Consider only
2985         FIELD_DECLs when looking for an NSDMI.
2987 2017-02-06  Jason Merrill  <jason@redhat.com>
2989         PR c++/71193 - incomplete types in templates
2990         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2991         handle incomplete type by pedwarning and then treating as dependent.
2993 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
2995         PR c++/79379
2996         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2997         (potential_constant_expression_1): Likewise.
2999         PR c++/79377
3000         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
3001         allow one fewer than expected arguments if flag_permissive.
3003         PR c++/79372
3004         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
3005         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
3006         with error_mark_node type.
3008 2017-02-03  Jason Merrill  <jason@redhat.com>
3010         PR c++/78689 - ICE on constructor with label
3011         * optimize.c (maybe_clone_body): Replace omitted parameters with
3012         null lvalues.
3013         * class.c (build_clone): Fix logic for omitting inherited parms.
3015         PR c++/12245 - excessive memory use
3016         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
3017         back in.  Don't cache constants.
3018         (maybe_constant_init): Don't cache constants.
3020         PR c++/79294 - ICE with invalid template argument
3021         * pt.c (convert_nontype_argument_function): Check value-dependence.
3022         (convert_nontype_argument): Don't check it here for function ptrs.
3024 2017-02-02  Richard Biener  <rguenther@suse.de>
3026         PR cp/14179
3027         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
3028         it lazily on the first changed element only and copy it
3029         fully upfront, only storing changed elements.
3031 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
3033         PR c++/69637
3034         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
3035         to the width.
3037 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
3039         PR c++/79304
3040         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
3041         after ARROW_EXPR.
3043 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
3045         PR c++/79298
3046         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
3047         any namespace aliases.
3049 2017-01-31  Nathan Sidwell  <nathan@acm.org>
3051         PR c++/79290
3052         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
3054         PR c++/67273
3055         PR c++/79253
3056         * pt.c: (instantiate_decl): Push to top level when current
3057         function scope doesn't match.  Only push lmabda scope stack when
3058         pushing to top.
3060         * cp-tree.h (instantiate_decl): Make defer_ok bool.
3061         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
3062         (instantiate_decl): Simplify and reorder state saving and restoration.
3064         PR c++/79264
3065         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
3066         * semantics.c (finish_member_declaration): Assert class is being
3067         defined.
3069 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
3071         Introduce C++ support in libcc1.
3072         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
3073         (ansi_opname): Rename to...
3074         (cp_operator_id): ... this.  Adjust all callers.
3075         (ansi_assopname): Rename to...
3076         (cp_assignment_operator_id): ... this.  Adjust all callers.
3077         (cp_literal_operator_id): Declare.
3078         (set_global_friend): Declare.
3079         (is_global_friend): Declare.
3080         (enum cp_oracle_request): New type.
3081         (cp_binding_oracle_function): New type.
3082         (cp_binding_oracle): Declare.
3083         (cp_finish_injected_record_type): Declare.
3084         * friend.c (global_friend): New var.
3085         (set_global_friend): New fn.
3086         (is_global_friend): New fn.
3087         (is_friend): Call is_global_friend.
3088         * name-lookup.c (cp_binding_oracle): New var.
3089         (query_oracle): New fn.
3090         (qualified_lookup_using_namespace): Call query_oracle.
3091         (lookup_name_real_1): Likewise.
3092         * parser.c (cp_literal_operator_id): Drop static.
3093         * search.c (friend_accessible_p): Call is_global_friend.
3094         * semantics.c (is_this_parameter): Accept a variable if the
3095         binding oracle is enabled.
3097 2017-01-27  Jason Merrill  <jason@redhat.com>
3099         PR c++/78771 - ICE with inherited constructor.
3100         * call.c (build_over_call): Call deduce_inheriting_ctor here.
3101         * pt.c (tsubst_decl): Not here.
3102         * class.c (add_method): Or here.
3103         * method.c (deduce_inheriting_ctor): Handle clones.
3104         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
3106 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
3108         PR c++/64382
3109         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
3110         New function.
3111         * cp/cp-tree.h: Declare it.
3112         * cp/semantics.c (finish_id_expression): Resolve names within a default
3113         capturing generic lambda defined within a template prior to
3114         instantiation to allow for captures to be added to the closure type.
3116 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
3118         PR c++/68727
3119         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
3120         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
3121         * parser.c (cp_parser_builtin_offsetof): Pass result of
3122         build_static_cast of null_pointer_node to finish_offsetof.
3123         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
3124         it for -Winvalid-offsetof pedwarn instead of trying to guess
3125         original offsetof type from EXPR.  Save OBJECT_PTR as a new
3126         second operand to OFFSETOF_EXPR.
3127         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
3128         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
3129         as OBJECT_PTR.
3131 2017-01-26  Jason Merrill  <jason@redhat.com>
3133         * name-lookup.c (parse_using_directive): Deprecate strong using.
3135         PR c++/79176 - lambda ICE with -flto -Os
3136         * decl2.c (vague_linkage_p): Handle decloned 'tors.
3137         * tree.c (decl_linkage): Likewise.
3139 2017-01-25  Martin Sebor  <msebor@redhat.com>
3141         * decl.c (grokdeclarator): Fix a typo in a comment.
3143 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
3145         PR c++/78896
3146         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
3147         lambda expressions.
3149         PR c++/77914
3150         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
3151         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
3153 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
3155         PR lto/79061
3156         * decl.c (cxx_init_decl_processing): Pass main_input_filename
3157         to build_translation_unit_decl.
3159 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
3161         PR c++/79205
3162         * cp-gimplify.c (cp_genericize_r): Add result of
3163         convert_from_reference on invisiref parm to p_set.
3165 2017-01-24  Nathan Sidwell  <nathan@acm.org>
3167         PR c++/78469 - defaulted ctor and inaccessible dtor
3168         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3169         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3170         * tree.c (build_target_expr): Check tf_no_cleanup.
3172         PR c++/79118 - anon-members and constexpr
3173         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3174         ctor decl.  Recursively check anonymous members.
3175         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3176         call.
3177         (explain_invalid_constexpr_fn): Likewise.
3179 2017-01-23  Nathan Sidwell  <nathan@acm.org>
3181         PR c++/71710 - template using directive of field
3182         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3183         check earlier.
3185         PR c++/71406 - ICE with scope-ref'd template id exprs
3186         PR c++/77508
3187         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3188         before breaking up TEMPLATE_ID_EXPR.
3190 2017-01-20  Nathan Sidwell  <nathan@acm.org>
3192         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3193         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3195 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
3197         PR c++/77829
3198         PR c++/78656
3199         * cp-tree.h (suggest_alternatives_for): Add bool param.
3200         (suggest_alternative_in_explicit_scope): New decl.
3201         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3202         that isn't the global one, call new function
3203         suggest_alternative_in_explicit_scope, only calling
3204         suggest_alternatives_for if it fails, and disabling near match
3205         searches fort that case.  When SCOPE is the global namespace,
3206         pass true for new param to suggest_alternatives_for to allow for
3207         fuzzy name lookups.
3208         * lex.c (unqualified_name_lookup_error): Pass true for new param
3209         to suggest_alternatives_for.
3210         * name-lookup.c (consider_binding_level): Add forward decl.
3211         (suggest_alternatives_for): Add "suggest_misspellings" param,
3212         using it to conditionalize the fuzzy name-lookup code.
3213         (suggest_alternative_in_explicit_scope): New function.
3214         * parser.c (cp_parser_primary_expression): When calling
3215         finish_id_expression, pass location of id_expression rather
3216         than that of id_expr_token.
3217         (cp_parser_id_expression): Convert local "unqualified_id" from
3218         tree to cp_expr to avoid implicitly dropping location information.
3220 2017-01-20  Marek Polacek  <polacek@redhat.com>
3222         PR c/64279
3223         * call.c (build_conditional_expr_1): Warn about duplicated branches.
3224         * semantics.c (finish_expr_stmt): Build statement using the proper
3225         location.
3227 2017-01-19  Jason Merrill  <jason@redhat.com>
3229         US 20 - forwarding references and class template argument deduction
3230         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
3231         * pt.c (push_template_decl_real): Set it.
3232         (maybe_adjust_types_for_deduction): Check it.
3233         (rewrite_template_parm): Copy it.
3235         US 19 - deduction guides and constructors
3236         * call.c (joust): Prefer deduction guides to constructors.
3237         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
3238         (deduction_guide_p): Check DECL_P.
3240         * decl.c (check_initializer): Always use build_aggr_init for array
3241         decomposition.
3243         PR c++/79130 - decomposition and direct-initialization
3244         * init.c (build_aggr_init): Communicate direct-initialization to
3245         build_vec_init.
3246         (build_vec_init): Check for array copy sooner.
3247         * parser.c (cp_parser_decomposition_declaration): Remove call to
3248         build_x_compound_expr_from_list.
3250 2017-01-18  Jason Merrill  <jason@redhat.com>
3252         PR c++/68666 - member variable template-id
3253         * typeck.c (finish_class_member_access_expr): Handle variable
3254         template-id.
3255         * pt.c (lookup_and_finish_template_variable): No longer static.
3256         * cp-tree.h: Declare it.
3258 2017-01-18  Nathan Sidwell  <nathan@acm.org>
3260         PR c++/78488
3261         * call.c (build_over_call): When checking ellipsis conversions for
3262         an inherited ctor, make sure there is at least one conversion.
3264 2017-01-18  Jason Merrill  <jason@redhat.com>
3266         PR c++/78894 - ICE with class deduction and default arg
3267         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
3269 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3271         PR c++/77489
3272         * mangle.c (write_discriminator): Reorganize abi warning check.
3274 2017-01-18  Nathan Sidwell  <nathan@acm.org>
3276         * cp-tree.h: Clarify exception spec node comment.
3277         * except.c (nothrow_spec_p): Simplify by checking node-equality.
3279         PR c++/79091
3280         * mangle.c (write_exception_spec): Check nothrow explicitly.
3281         (write_encoding): Don't increment processing_template_decl around
3282         encoding.
3284 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3286         PR c++/70182
3287         * mangle.c (write_template_args): Add "on" for operator names.
3289 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
3291         PR c++/77489
3292         * mangle.c (write_discriminator): Handle discriminator >= 10.
3294 2017-01-17  Nathan Sidwell  <nathan@acm.org>
3296         PR c++/61636
3297         * cp-tree.h (maybe_generic_this_capture): Declare.
3298         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
3299         (maybe_resolve_dummy): ... here.  Call it.
3300         (maybe_generic_this_capture): New.
3301         * parser.c (cp_parser_postfix_expression): Speculatively capture
3302         this in generic lambda in unresolved member function call.
3303         * pt.c (tsubst_copy_and_build): Force hard error from failed
3304         member function lookup in generic lambda.
3306 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
3308         PR c++/70565
3309         * cp-array-notation.c (expand_array_notation_exprs): Handle
3310         OMP_PARALLEL.
3312 2017-01-11  Jason Merrill  <jason@redhat.com>
3314         PR c++/78337 - ICE on invalid with generic lambda
3315         * semantics.c (process_outer_var_ref): Check if containing_function
3316         is null.  Move inform call under complain test.
3318 2017-01-11  Nathan Sidwell  <nathan@acm.org>
3320         PR c++/77812
3321         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
3322         is a new overload.
3324 2017-01-11  Nathan Sidwell  <nathan@acm.org>
3326         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
3328 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
3330         PR c++/78341
3331         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
3332         assertion.  Formatting fix.
3334         PR c++/72813
3335         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3336         writing PCH file.
3338 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
3340         PR c++/77949
3341         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3342         a missing semicolon if we have a valid insertion location for
3343         the fix-it hint.
3345 2017-01-10  Jason Merrill  <jason@redhat.com>
3347         FI 20, decomposition declaration with parenthesized initializer.
3348         * parser.c (cp_parser_decomposition_declaration): Use
3349         cp_parser_initializer.
3351 2017-01-09  Jason Merrill  <jason@redhat.com>
3353         Implement P0195R2, C++17 variadic using.
3354         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3355         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3356         * error.c (dump_decl): Likewise.
3358 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
3360         PR translation/79019
3361         PR translation/79020
3362         * semantics.c (finish_omp_clauses): Add missing whitespace to
3363         translatable strings.
3364         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3366 2017-01-07  Jason Merrill  <jason@redhat.com>
3368         PR c++/78948 - instantiation from discarded statement
3369         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3370         * cp-tree.h (in_discarded_stmt): Declare it.
3371         (struct saved_scope): Add discarded_stmt bitfield.
3372         (in_discarded_stmt): New macro.
3373         * decl2.c (mark_used): Check it.
3374         * parser.c (cp_parser_selection_statement): Adjust.
3375         (cp_parser_jump_statement): Adjust.
3377 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
3379         PR c++/78931
3380         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3381         REFERENCE_REF_P, set tt to its operand.
3383         PR c++/78890
3384         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3385         unions even for C++11 and later.
3387 2017-01-05  Nathan Sidwell  <nathan@acm.org>
3389         PR c++/78765
3390         * pt.c (convert_nontype_argument): Don't try and see if integral
3391         or enum expressions are constants prematurely.
3393 2017-01-04  Marek Polacek  <polacek@redhat.com>
3395         PR c++/64767
3396         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3397         a zero character literal.
3399 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
3401         PR c++/78949
3402         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3403         vector type.
3405         PR c++/78693
3406         * parser.c (cp_parser_simple_declaration): Only complain about
3407         inconsistent auto deduction if auto_result doesn't use auto.
3409         * parser.c (cp_parser_simple_declaration): Diagnose function
3410         declaration among more than one init-declarators with auto
3411         specifier.
3413         PR c++/71182
3414         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3415         assertion, as lexer->buffer may be NULL.
3417 2017-01-04  Marek Polacek  <polacek@redhat.com>
3419         PR c++/77545
3420         PR c++/77284
3421         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3423 2017-01-04  Nathan Sidwell  <nathan@acm.org>
3425         PR c++/66735
3426         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3427         (lambda_capture_field_type): Update prototype.
3428         * lambda.c (lambda_capture_field_type): Add is_reference parm.
3429         Add referenceness here.
3430         (add_capture): Adjust lambda_capture_field_type call, refactor
3431         error checking.
3432         * pt.c (tsubst): Adjust lambda_capture_field_type call.
3434 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
3436         Update copyright years.
3438 Copyright (C) 2017 Free Software Foundation, Inc.
3440 Copying and distribution of this file, with or without modification,
3441 are permitted in any medium without royalty provided the copyright
3442 notice and this notice are preserved.