* doc/generic.texi (ANNOTATE_EXPR): Document 3rd operand.
[official-gcc.git] / gcc / cp / ChangeLog
blobac623f08f401a06974470d026ea1346d03b22b7a
1 2017-11-23  Mike Stump  <mikestump@comcast.net>
2             Eric Botcazou  <ebotcazou@adacore.com>
4         * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
5         * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
6         ANNOTATE_EXPR.
7         (finish_do_stmt): Likewise.
8         (finish_for_cond): Likewise.
10 2017-11-22  Jakub Jelinek  <jakub@redhat.com>
12         PR c++/82401
13         * name-lookup.c (member_name_cmp): Return 0 if a == b.
15 2017-11-22  David Malcolm  <dmalcolm@redhat.com>
17         PR c++/62170
18         * error.c (type_to_string): Add leading comment.  Add params
19         "postprocessed", "quote", and "show_color", using them to fix
20         quoting of the "aka" for types involving typedefs.
21         (arg_to_string): Update for new params to type_to_string.
22         (cxx_format_postprocessor::handle): Likewise.
23         (cp_printer): Convert penultimate param from bool to bool *.
24         Update call to type_to_string and calls to
25         defer_phase_2_of_type_diff.
27 2017-11-22  Marek Polacek  <polacek@redhat.com>
29         PR c++/60336
30         PR middle-end/67239
31         PR target/68355
32         * class.c (layout_class_type): Set DECL_PADDING_P on padding.
33         * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
34         (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
36 2017-11-21  Martin Liska  <mliska@suse.cz>
38         * class.c (finalize_literal_type_property): Add quotes for
39         constexpr keyword.
40         (explain_non_literal_class): Likewise.
41         * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
42         (is_valid_constexpr_fn): Likewise.
43         (check_constexpr_ctor_body): Likewise.
44         (register_constexpr_fundef): Likewise.
45         (explain_invalid_constexpr_fn): Likewise.
46         (cxx_eval_builtin_function_call): Likewise.
47         (cxx_eval_call_expression): Likewise.
48         (cxx_eval_loop_expr): Likewise.
49         (potential_constant_expression_1): Likewise.
50         * decl.c (check_previous_goto_1): Likewise.
51         (check_goto): Likewise.
52         (grokfndecl): Likewise.
53         (grokdeclarator): Likewise.
54         * error.c (maybe_print_constexpr_context): Likewise.
55         * method.c (process_subob_fn): Likewise.
56         (defaulted_late_check): Likewise.
57         * parser.c (cp_parser_compound_statement): Likewise.
59 2017-11-21  Marc Glisse  <marc.glisse@inria.fr>
61         * constexpr.c (cxx_eval_constant_expression,
62         potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
63         * cp-gimplify.c (cp_fold): Likewise.
64         * error.c (dump_expr): Likewise.
65         * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
67 2017-11-21  Jakub Jelinek  <jakub@redhat.com>
69         P0428R2 - familiar template syntax for generic lambdas
70         * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
71         for cxx2a and above, reword pedwarn for C++14/C++17.
73 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
75         PR c/81404
76         * name-lookup.c: Include "c-family/known-headers.h"
77         (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
78         potentially return a new suggest_missing_header hint.
80 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
82         PR c++/72786
83         * name-lookup.c (class macro_use_before_def): New class.
84         (lookup_name_fuzzy): Detect macro that were used before being
85         defined, and report them as such.
87 2017-11-20  Jason Merrill  <jason@redhat.com>
89         * decl2.c (constrain_class_visibility): Don't warn about artificial
90         fields.
92 2017-11-20  Jakub Jelinek  <jakub@redhat.com>
94         P0329R4: Designated Initialization
95         * parser.c (cp_parser_initializer_clause): List in comment grammar
96         designated-initializer-list.
97         (cp_parser_initializer_list): Allow .identifier = without pedwarn for
98         C++2A, parse .identifier { ... }.  Improve location_t argument to
99         pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
100         designated initializer list.  Diagnose mixing designated and
101         non-designated initializer clauses for C++2A.  Diagnose duplicated
102         identifiers in designators.
103         * name-lookup.h (search_anon_aggr): New declaration.
104         * name-lookup.c (fields_linear_search): Use search_anon_aggr.
105         (search_anon_aggr): New function.
106         * typeck2.c (process_init_constructor_record): Allow designator
107         to skip over some non-static data members.  Handle anonymous
108         aggregates.  Add diagnostics for designator order not matching
109         member declaration order.
111 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
113         * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
114         Include "c-family/name-hint.h"
115         (suggest_alternatives_for): Convert "fuzzy_name" from const char *
116         to name_hint, and rename to "hint".  Pass location to
117         lookup_name_fuzzy.
118         (lookup_name_fuzzy): Convert return type from const char *
119         to name_hint.  Add location_t param.
120         * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
121         Include "c-family/name-hint.h"
122         (cp_parser_diagnose_invalid_type_name): Convert
123         "suggestion" from const char * to name_hint, and rename to "hint".
124         Pass location to lookup_name_fuzzy.
126 2017-11-20  Nathan Sidwell  <nathan@acm.org>
128         PR c++/82878
129         PR c++/78495
130         * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
131         ctor.
132         * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
133         inhibibition check removed in previous c++/78495 change.
135 2017-11-20   Jakub Jelinek  <jakub@redhat.com>
137         PR c++/82781
138         * constexpr.c (cxx_eval_vector_conditional_expression): New function.
139         (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
140         of cxx_eval_conditional_expression.
142 2017-11-19  Jakub Jelinek  <jakub@redhat.com>
144         PR c/66618
145         PR c/69960
146         * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
147         cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
149 2017-11-16  Jason Merrill  <jason@redhat.com>
151         PR c++/79092 - non-type args of different types are different
152         * tree.c (cp_tree_equal): Check the type of constants.
153         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
154         when comparing to previously deduced argument.
155         (maybe_convert_nontype_argument): New.
156         (convert_nontype_argument): Call it.
157         (tsubst_copy_and_build): Handle partial instantiation of
158         IMPLICIT_CONV_EXPR.
159         (unify): Ignore type when deducing from array bound.
160         (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
161         (value_dependent_expression_p): Any type-dependent expression is
162         value-dependent.  Handle IMPLICIT_CONV_EXPR.
163         * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
164         * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
166 2017-11-16  Nathan Sidwell  <nathan@acm.org>
168         PR c++/82836
169         PR c++/82737
170         * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
171         Override.
172         * cp-tree.h (overwrite_mangling): Declare.
173         * decl2.c (struct mangled_decl_hash): Entries are deletable.
174         (overwrite_mangling): New.
176         PR c++/81060
177         * decl.c (xref_tag_1): Push lambda into current scope.
178         * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
180 2017-11-15  Nathan Sidwell  <nathan@acm.org>
182         PR c++/81574
183         * lambda.c (lambda_capture_field_type): Function references are
184         always catured by reference.
186 2017-11-15  Martin Liska  <mliska@suse.cz>
188         * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
189         instead of cp_build_indirect_ref.
191 2017-11-15  Martin Liska  <mliska@suse.cz>
193         * decl.c (begin_destructor_body): In case of VPTR sanitization
194         (with disabled recovery), zero vptr in order to catch virtual calls
195         after lifetime of an object.
197 2017-11-14  Jason Merrill  <jason@redhat.com>
199         Use GTY((cache)) on some hash tables.
200         * decl.c (decomp_type_table): Use tree_cache_map.
201         * init.c (nsdmi_inst): Likewise.
202         * pt.c (defarg_ints): Likewise.
203         * cp-objcp-common.c (cp_get_debug_type): Likewise.
205 2017-11-13  Jason Merrill  <jason@redhat.com>
207         Capture adjustments for P0588R1.
208         * semantics.c (process_outer_var_ref): Capture variables when
209         they are named; complain about non-capture uses when odr-used.
210         * expr.c (mark_use): Rvalue use looks through capture proxy.
211         * constexpr.c (potential_constant_expression_1): Improve error about
212         use of captured variable.
213         * lambda.c (need_generic_capture, dependent_capture_r)
214         (do_dependent_capture, processing_nonlambda_template): Remove.
215         * call.c (build_this): Remove uses of the above.
216         * decl.c (cp_finish_decl): Likewise.
217         * semantics.c (maybe_cleanup_point_expr)
218         (maybe_cleanup_point_expr_void, finish_goto_stmt)
219         (maybe_convert_cond): Likewise.
220         * typeck.c (check_return_expr): Likewise.
222         Defer folding of *&.
223         * typeck.c (cp_build_fold_indirect_ref): New.
224         (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
225         Add 'fold' parameter.
226         * cp-tree.h: Declare cp_build_fold_indirect_ref.
227         * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
228         parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
229         * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
230         (cp_convert_range_for): Likewise.
231         * typeck2.c (build_x_arrow): Use RO_ARROW.
233         * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
234         INDIRECT_REF of ADDR_EXPR.
236         PR c++/82360 - ICE with static_cast in template.
237         * call.c (perform_direct_initialization_if_possible): Check
238         processing_template_decl.
239         * typeck.c (build_static_cast_1): Likewise.
241 2017-11-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
243         Remove the null check from placement new in all modes
244         * init.c (build_new_1): Don't do a null check for
245         a namespace-scope non-replaceable placement new
246         in any mode unless -fcheck-new is provided.
248 2017-11-07 Boris Kolpackov  <boris@codesynthesis.com>
250         * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
251         in cp-tree.h.
253 2017-11-07  Jakub Jelinek  <jakub@redhat.com>
255         PR c++/82835
256         * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
257         convert_default_arg instead of i.
259 2017-11-06  Jason Merrill  <jason@redhat.com>
261         P0704R1 - fixing const-qualified pointers to members
262         * typeck2.c (build_m_component_ref): Also accept in lower stds with
263         a pedwarn.
265 2017-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
267         PR c++/65579
268         * decl2.c (finish_static_data_member_decl): If there's an initializer,
269         complete the type and re-apply the quals.
271 2017-11-06  Martin Liska  <mliska@suse.cz>
273         PR middle-end/82404
274         * constexpr.c (cxx_eval_builtin_function_call): Handle
275         __builtin_unreachable call.
276         (get_function_named_in_call): Declare function earlier.
277         (constexpr_fn_retval): Skip __builtin_unreachable.
278         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
279         ...
280         (cp_maybe_instrument_return): ... this.
281         (cp_genericize): Call the function unconditionally.
283 2017-11-03  Nathan Sidwell  <nathan@acm.org>
285         PR c++/82710
286         * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
287         warning too.
289 2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
291         PR c++/81957
292         * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
293         (expand_integer_pack, convert_template_argument, coerce_template_parms,
294         gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
295         unify): Adjust calls.
296         * tree.c (cp_build_qualified_type_real): Likewise.
297         * cp-tree.h (make_pack_expansion): Adjust declaration.
299 2017-11-02  Nathan Sidwell  <nathan@acm.org>
301         * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
302         (IDENTIFIER_NEW_OP_P): New.
303         * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
304         * pt.c (push_template_decl_real): Likewise.
305         * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
307         PR c++/82710
308         * decl.c (grokdeclarator): Don't warn when parens protect a return
309         type from a qualified name.
311 2017-11-01  Nathan Sidwell  <nathan@acm.org>
313         * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
314         Renumber and reserve udlit value.
315         (IDENTIFIER_NEWDEL_OP_P): Delete.
316         (IDENTIFIER_OVL_OP_P): New.
317         (IDENTIFIER_ASSIGN_OP_P): Adjust.
318         (IDENTIFIER_CONV_OP_P): Adjust.
319         (IDENTIFIER_OVL_OP_INFO): Adjust.
320         (IDENTIFIER_OVL_OP_FLAGS): New.
321         * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
322         * lex.c (get_identifier_kind_name): Adjust.
323         (init_operators): Don't special case new/delete ops.
324         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
325         * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
326         * typeck.c (check_return_expr): Likewise.
328         * cp-tree.h (assign_op_identifier, call_op_identifier): Use
329         compressed code.
330         (struct lang_decl_fn): Use compressed operator code.
331         (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
332         (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
333         (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
334         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
335         (build_library_fn): Likewise.
336         (grok_op_properties): Likewise.
337         * mangle.c (write_unqualified_name): Likewise.
338         * method.c (implicitly_declare_fn): Likewise.
339         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
341         * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
342         (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
343         (enum ovl_op_code): New.
344         (struct ovl_op_info): Add ovl_op_code field.
345         (ovl_op_info): Size by OVL_OP_MAX.
346         (ovl_op_mapping, ovl_op_alternate): Declare.
347         (OVL_OP_INFO): Adjust for mapping array.
348         (IDENTIFIER_OVL_OP_INFO): New.
349         * decl.c (ambi_op_p, unary_op_p): Delete.
350         (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
351         ovl_op_alternate.
352         * lex.c (ovl_op_info): Adjust and static initialize.
353         (ovl_op_mappings, ovl_op_alternate): Define.
354         (init_operators): Iterate over ovl_op_info array and init mappings
355         & alternate arrays.
356         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
357         * operators.def (DEF_OPERATOR): Remove KIND parm.
358         (DEF_SIMPLE_OPERATOR): Delete.
359         (OPERATOR_TRANSITION): Expand if defined.
361 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
363         * pt.c (listify): Use %< and %> for description of #include.
365 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
367         * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
368         than 0.
369         * name-lookup.c (suggest_alternatives_for): Update for renaming of
370         inform_at_rich_loc.
371         (maybe_suggest_missing_header): Likewise.
372         (suggest_alternative_in_explicit_scope): Likewise.
373         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
374         renaming of error_at_rich_loc.
375         (cp_parser_string_literal): Likewise.
376         (cp_parser_nested_name_specifier_opt): Likewise.
377         (cp_parser_cast_expression): Likewise for renaming of
378         warning_at_rich_loc.
379         (cp_parser_decl_specifier_seq): Likewise for renaming of
380         error_at_rich_loc and warning_at_rich_loc.
381         (cp_parser_elaborated_type_specifier): Likewise for renaming of
382         pedwarn_at_rich_loc.
383         (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
384         error_at_rich_loc.
385         (cp_parser_virt_specifier_seq_opt): Likewise.
386         (cp_parser_class_specifier_1): Likewise.
387         (cp_parser_class_head): Likewise.
388         (cp_parser_member_declaration): Likewise for renaming of
389         pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
390         (cp_parser_enclosed_template_argument_list): Likewise for renaming
391         of error_at_rich_loc.
392         (set_and_check_decl_spec_loc): Likewise.
393         * pt.c (listify): Likewise.
394         * rtti.c (typeid_ok_p): Likewise.
395         * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
396         than 0.
397         * typeck.c (access_failure_info::maybe_suggest_accessor): Update
398         for renaming of inform_at_rich_loc.
399         (finish_class_member_access_expr): Likewise for renaming of
400         error_at_rich_loc.
402 2017-10-31  Nathan Sidwell  <nathan@acm.org>
404         * cp-tree.h (struct operator_name_info_t): Rename to ...
405         (struct ovl_op_info_t): ... here.  Add tree_code field.
406         (operator_name_info, assignment_operator_name_info): Delete.
407         (ovl_op_info): Declare.
408         (OVL_OP_INFO): Adjust.
409         * decl.c (grok_op_properties): Use ovl_op_flags.
410         * lex.c (operator_name_info, assignment_operator_name_info):
411         Delete.
412         (ovl_op_info): Define.
413         (set_operator_ident): Adjust.
414         (init_operators): Set tree_code.
415         * mangle.c (write_unqualified_id): Adjust operator array scan.
417         * lex.c (init_operators): Allow NULL operator name.  Don't add
418         special cases.
419         * operators.def: Use NULL for mangling only operators.  Move to
420         after regular operators but move assignment operators last.
422         * cp-tree.h (enum ovl_op_flags): New.
423         (struct operator_name_info_t): Rename arity to flags.
424         * lex.c (set_operator_ident): New.
425         (init_operators): Use it.  Adjust for flags.
426         * mangle.c (write_unqualified_id): Adjust for flags.
427         * operators.def: Replace arity with flags.
429         * cp-tree.h (ovl_op_identifier): New.
430         (assign_op_identifier, call_op_identifier): Adjust.
431         (cp_operator_id, cp_assignment_operator_ide): Delete.
432         (SET_OVERLOADED_OPERATOR_CODE): Delete.
433         (OVL_OP_INFO): New.
434         * call.c (op_error): Use OVL_OP_INFO.
435         (build_conditional_expr_1): Use ovl_op_identifier.
436         (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
437         (build_op_delete_call): Likewise.
438         * class.c (type_requires_array_cookie): Use ovl_op_identifier.
439         * decl.c (duplicate_decls): Directly copy operator code.
440         (builtin_function_1): Do not set operator code.
441         (build_library_fn): Directly set operator code.
442         (push_cp_library_fn): Use ovl_op_identifier.
443         (grok_op_properties): Directly set operator code.
444         * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
445         * error.c (dump_expr): Use OVL_OP_INFO.
446         (op_to_string): Add assop arg. Use OVL_OP_INFO.
447         (assop_to_string): Delete.
448         (args_to_string): Adjust.
449         * init.c (build_new_1): Use ovl_op_identifier.
450         * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
451         (write_expression): Likewise.
452         * method.c (synthesized_method_walk): Use ovl_op_identifier.
453         (implicitly_declare_fn): Use assign_op_identifier. Directly set
454         operator code.
455         * name-lookup.c (get_class_binding): Use assign_op_identifier.
456         * parser.c (cp_parser_operator): Use ovl_op_identifier.
457         (cp_parser_omp_clause_reduction): Likewise.
458         * semantics.c (omp_reduction_id): Likewise.
459         * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
461         * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
462         (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
463         (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
464         (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
465         * call.c (add_function_candidate): Use
466         DECL_OVERLOADED_OPERATOR_IS.
467         (build_op_call_1): Use call_op_identifier &
468         DECL_OVERLOADED_OPERATOR_IS.
469         (build_over_call): Likewise.
470         (has_trivial_copy_assign_p): Use assign_op_identifier.
471         (build_special_member_call): Likewise.
472         * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
473         (vbase_has_user_provided_move_assign,
474         classtype_has_move_assign_or_move_ctor_p): Likewise.
475         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
476         (grok_special_member_properties): Use assign_op_identifier.
477         (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
478         * decl2.c (mark_used): Use DECL_CONV_FN_P.
479         * dump.c (dump_access): Delete prototype.
480         (dump_op): Delete.
481         (cp_dump_tree): Don't call it.
482         * lambda.c (lambda_function): Use call_op_identifier.
483         (maybe_add_lambda_conv_op): Not an overloaded operator.  Remove
484         unneeded braces.
485         * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
486         * method.c (do_build_copy_assign): Use assign_op_identifier.
487         (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
488         (get_copy_assign): Use assign_op_identifier.
489         (synthesized_method_walk): Likewise.
490         (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
491         * parser.c (cp_parser_lambda_declarator_opt): Use
492         call_op_identifier.
493         * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
494         assign_op_identifier.
495         * tree.c (special_function_p):  Use DECL_OVERLOADED_OPERATOR_IS.
496         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
497         (check_return_expr): Use assign_op_identifier.
499 2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
501         PR c++/82085
502         * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
503         unconditionally call convert_from_reference.
505 2017-10-30  Nathan Sidwell  <nathan@acm.org>
507         * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
508         as a few lines earlier.
509         * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
510         * decl.c (grokfndecl): Fix indentation.
511         (compute_array_index_type): Use processing_template_decl_sentinel.
512         (grok_op_properties): Move warnings to end.  Reorder other checks
513         to group similar entities.  Tweak diagnostics.
514         * lex.c (unqualified_name_lookup_error): No need to check name is
515         not ERROR_MARK operator.
516         * parser.c (cp_parser_operator): Select operator code before
517         looking it up.
518         * typeck.c (check_return_expr): Fix indentation and line wrapping.
520 2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>
522         * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
524 2017-10-26  Nathan Sidwell  <nathan@acm.org>
526         * decl.c (sort_labels): Restore function.
527         (pop_labels): Sort labels
528         (identify_goto): Add translation markup.
530 2017-10-25  Nathan Sidwell  <nathan@acm.org>
532         Kill IDENTIFIER_LABEL_VALUE.
533         * cp-tree.h (lang_identifier): Delete label_value slot.
534         (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
535         (struct named_label_hasher): Rename to ...
536         (struct named_label_hash): ... here.  Reimplement.
537         (struct language_function): Adjust x_named_labels.
538         * name-lookup.h (struct cp_label_binding): Delete.
539         (struct cp_binding_level): Delete shadowed_labels slot.
540         * decl.c (struct named_label_entry): Add name and outer slots.
541         (pop_label): Rename to ...
542         (check_label_used): ... here.  Don't pop.
543         (note_label, sort_labels): Delete.
544         (pop_labels, pop_local_label): Reimplement.
545         (poplevel): Pop local labels as any other decl. Remove
546         shadowed_labels handling.
547         (named_label_hash::hash, named_label_hash::equal): New.
548         (make_label_decl): Absorb into ...
549         (lookup_label_1): ... here.  Add making_local_p arg, reimplement.
550         (lookup_label, declare_local_label): Adjust.
551         (check_goto, define_label): Adjust.
552         * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
553         * ptree.c (cxx_print_identifier): Don't print identifier binding.
555         * decl.c (identifier_goto): Reduce duplication.
556         (check_previous_goto_1): Likewise.
557         (check_goto): Move var decls to initialization.
558         (check_omp_return, define_label_1, define_label): Likewise.
560 2017-10-25  Jakub Jelinek  <jakub@redhat.com>
562         PR libstdc++/81706
563         * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
564         newdecl to corresponding __builtin_ if any.
566 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
568         PR c++/82466
569         * decl.c (duplicate_decls): Warn for built-in functions declared as
570         non-function, use OPT_Wbuiltin_declaration_mismatch.
572         * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
574 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
576         PR c++/80991
577         * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
578         a TREE_LIST as TRAIT_EXPR_TYPE2.
580 2017-10-24  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
581             Paolo Carlini  <paolo.carlini@oracle.com>
583         PR c++/82307
584         * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
585         enumeration type whose underlying type is fixed.
587 2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
589         PR c++/80449
590         * semantics.c (finish_compound_literal): Check do_auto_deduction
591         return value for error_mark_node.
593 2017-10-23  Jason Merrill  <jason@redhat.com>
595         PR c++/77369 - wrong noexcept handling in C++14 and below
596         * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
598 2017-10-20  Nathan Sidwell  <nathan@acm.org>
600         * class.c (layout_class_type): Cleanup as-base creation, determine
601         mode here.
602         (finish_struct_1): ... not here.
604 2017-10-19  Jakub Jelinek  <jakub@redhat.com>
606         PR c++/82600
607         * typeck.c (check_return_expr): Don't call
608         maybe_warn_about_returning_address_of_local in templates.
610 2017-10-17  Nathan Sidwell  <nathan@acm.org>
612         PR c++/82560
613         * call.c (build_over_call): Don't pass tf_no_cleanup to nested
614         calls.
616         PR middle-end/82546
617         * cp-objcp-common.c (cp_tree_size): Reformat.  Adjust returns size
618         of TYPE nodes.
620 2017-10-13  Jason Merrill  <jason@redhat.com>
622         PR c++/82357 - bit-field in template
623         * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
625 2017-10-13  David Malcolm  <dmalcolm@redhat.com>
627         * cp-tree.h (maybe_show_extern_c_location): New decl.
628         * decl.c (grokfndecl): When complaining about literal operators
629         with C linkage, issue a note giving the location of the
630         extern "C".
631         * parser.c (cp_parser_new): Initialize new field
632         "innermost_linkage_specification_location".
633         (cp_parser_linkage_specification): Store the location
634         of the linkage specification within the cp_parser.
635         (cp_parser_explicit_specialization): When complaining about
636         template specializations with C linkage, issue a note giving the
637         location of the extern "C".
638         (cp_parser_explicit_template_declaration): Likewise for templates.
639         (maybe_show_extern_c_location): New function.
640         * parser.h (struct cp_parser): New field
641         "innermost_linkage_specification_location".
643 2017-10-12  Nathan Sidwell  <nathan@acm.org>
645         * cp-tree.h (cp_expr): Add const operator * and operator->
646         accessors.
647         (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
648         TS_CP_WRAPPER, LAST_TS_CP_ENUM.
650 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
652         * parser.c (get_required_cpp_ttype): New function.
653         (cp_parser_error_1): Call it, using the result to call
654         maybe_suggest_missing_token_insertion.
656 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
658         * parser.c (get_matching_symbol): Move to before...
659         (cp_parser_error): Split out into...
660         (cp_parser_error_1): ...this new function, merging in content
661         from...
662         (cp_parser_required_error): ...here.  Eliminate partial duplicate
663         of body of cp_parser_error in favor of a call to the new
664         cp_parser_error_1 helper function.
666 2017-10-11  Nathan Sidwell  <nathan@acm.org>
668         * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
669         (record_mangling): Likewise.
671 2017-10-10  Nathan Sidwell  <nathan@acm.org>
673         * name-lookup.c (extern_c_fns): Rename to ...
674         (extern_c_decls): ... here.
675         (check_extern_c_conflict, extern_c_linkage_bindings): Update.
676         (do_pushdecl): Check extern-c fns and vars.
678         * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
679         specialization.
681         * decl2.c (struct mangled_decl_hash): New hash traits.
682         (mangled_decls): Make hash_table<mangled_decl_hash>.
683         (generate_mangling_alias, record_mangling): Adjust.
685 2017-10-10  Jason Merrill  <jason@redhat.com>
687         More delayed lambda capture fixes.
688         * call.c (add_function_candidate): Use build_address.
689         (build_op_call_1): Call mark_lvalue_use early.
690         (build_over_call): Handle error from build_this.
691         * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
692         (cxx_eval_increment_expression): Don't use rvalue().
693         * cvt.c (convert_to_void): Use mark_discarded_use.
694         * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR.  Fix
695         reference handling.  Don't copy the expression.
696         (mark_discarded_use): New.
697         * lambda.c (insert_capture_proxy): Add some sanity checking.
698         (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
699         * pt.c (register_local_specialization): Add sanity check.
700         * semantics.c (process_outer_var_ref): Fix check for existing proxy.
701         * typeck.c (cp_build_addr_expr_1): Handle error from
702         mark_lvalue_use.
703         (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
704         from rvalue.
706         Handle generic lambda capture in dependent expressions.
707         * lambda.c (need_generic_capture, dependent_capture_r)
708         (do_dependent_capture): New.
709         * pt.c (processing_nonlambda_template): Use need_generic_capture.
710         * semantics.c (maybe_cleanup_point_expr)
711         (maybe_cleanup_point_expr_void, finish_goto_stmt)
712         (maybe_convert_cond): Call do_dependent_capture.
713         * typeck.c (build_static_cast): Remove dependent capture handling.
715         * typeck.c (condition_conversion): Assert !processing_template_decl.
716         * semantics.c (finish_omp_clauses): Don't
717         fold_build_cleanup_point_expr if processing_template_decl.
718         (outer_var_p): A temporary can't be from an outer scope.
719         * pt.c (type_dependent_expression_p): Fix dependency checking of
720         functions without DECL_TEMPLATE_INFO.
721         (instantiate_decl): Use lss_copy.
722         * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
724         * typeck.c (check_return_expr): Check non-dependent conversion in
725         templates.
726         * constraint.cc (check_function_concept): Don't complain about an
727         empty concept if seen_error.
729 2017-10-10  Richard Sandiford  <richard.sandiford@linaro.org>
731         * cvt.c (ignore_overflows): Use wi::to_wide when
732         operating on trees as wide_ints.
733         * decl.c (check_array_designated_initializer): Likewise.
734         * mangle.c (write_integer_cst): Likewise.
735         * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
737 2017-10-10  Nathan Sidwell  <nathan@acm.org>
739         * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
741 2017-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
743         PR c++/47791
744         * decl.c (finish_function): Take a bool intead of an int; adjust.
745         * cp-tree.h (finish_function): Adjust declaration.
746         * decl2.c (generate_tls_wrapper, finish_objects,
747         finish_static_storage_duration_function): Adjust calls.
748         * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
749         Likewise.
750         * method.c (synthesize_method): Likewise.
751         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
752         * pt.c (instantiate_decl): Likewise.
753         * parser.c (cp_parser_function_definition_after_declarator,
754         cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
755         Likewise.
756         (cp_parser_ctor_initializer_opt,
757         cp_parser_ctor_initializer_opt_and_function_body,
758         cp_parser_function_try_block,
759         cp_parser_function_definition_after_declarator,
760         cp_parser_function_transaction): Return void; adjust declarations.
762 2017-10-06  Nathan Sidwell  <nathan@acm.org>
764         PR c++/82424
765         * name-lookup.c (check_local_shadow): Don't try and convert
766         dependent types.
768 2017-10-06  Jakub Jelinek  <jakub@redhat.com>
770         PR c++/82299
771         * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
772         init.
773         * typeck.c (convert_for_assignment): Likewise.
775         P0704R1 - fixing const-qualified pointers to members
776         * typeck2.c (build_m_component_ref): For -std=c++2a allow
777         pointer to const & qualified method on rvalue.
779 2017-10-06  Nathan Sidwell  <nathan@acm.org>
781         Use hash_table for extern "C" names
782         * name-lookup.c (extern_c_fns): Use hash_table.
783         (check_extern_c_conflict): Adjust.
784         (c_linkage_bindings): Adjust.
786         Use hash_table for namespace bindings
787         * cp-tree.h (struct named_decl_hash): New.
788         (lang_decl_ns): Change type of bindings field.
789         * lex.c (maybe_add_lang_decl_raw): Adjust.
790         * name-lookup.c (find_namespace_slot): Adjust.
791         (do_pushdecl): Push NULL-named namespace.
792         (do_push_nested_namespace): Adjust.
793         (push_namespace): Push anonymous namespace as NULL name.
795 2017-10-05  Jason Merrill  <jason@redhat.com>
797         Pass variadic class objects exactly like named by-value args.
798         * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
800 2017-10-05  Nathan Sidwell  <nathan@acm.org>
802         Warn on MVP declarations
803         * cp-tree.h (struct cp_declarator): Add parenthesized field.
804         * decl.c (grokdeclarator): Warn about unnecessary parens.
805         * parser.c (make_declarator): Init parenthesized field.
806         (cp_parser_direct_declarator): Set parenthesized field.
808         Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
809         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
810         SET_IDENTIFIER_GLOBAL_VALUE): Delete.
811         * name-lookup.h (set_global_binding): Remove NAME parm.
812         (get_global_binding): New inline fn.
813         * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
814         (identifier_global_value): Move to ...
815         * cp-objcp-common.c (identifier_global_value): ... here.
816         * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
817         * decl.c (record_builtin_type, expand_static_init,
818         grokdeclarator): Adjust.
819         * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
820         get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
821         * except.c (declare_library_fn, build_throw): Adjust.
822         * init.c (throw_bad_array_length): Adjust.
823         * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
825         * decl2.c (record_mangling): Fix spello and formatting from
826         previous patch.
828 2017-10-04  Nathan Sidwell  <nathan@acm.org>
830         Give builtin types the correct name.
831         * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
832         * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
833         rname.
835 2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
836             Andrew Pinski  <apinski@cavium.com>
838         PR c++/71946
839         * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
841 2017-10-04  Nathan Sidwell  <nathan@acm.org>
843         Move mangling aliases out of global namespace.
844         * cp-tree.h (record_mangling): New.
845         (maybe_remove_implicit_alias): Delete.
846         * decl2.c (mangled_decls): New hash map.
847         (generate_mangling_alias): Reimplement using mangled_decls.
848         (record_mangling): New.
849         * mangle.c (decl_implicit_alias_p,
850         maybe_remove_implicit_alias): Delete.
851         (mangle_decl): Use record_mangling.
852         * name-lookup.c (supplement_binding_1): Remove
853         maybe_remove_implicit_alias check.
855 2017-10-04  Jakub Jelinek  <jakub@redhat.com>
857         PR c++/82373
858         * error.c (dump_function_decl): If show_return, call dump_type_suffix
859         on the same return type dump_type_prefix has been called on.
861 2017-10-04  Jason Merrill  <jason@redhat.com>
863         PR c++/81525 - broken handling of auto in generic lambda.
864         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
866 2017-10-04  Nathan Sidwell  <nathan@acm.org>
868         * call.c (convert_arg_to_ellipsis): Correct comment about passing
869         by reference.
871 2017-10-02  Richard Sandiford  <richard.sandiford@linaro.org>
873         * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
874         when comparing the array bounds with an ARRAY_REF index.
876 2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
878         PR c++/68754
879         * method.c (defaulted_late_check): Early return if the defaulted
880         declaration does not match the expected signature.
882 2017-09-29  Jakub Jelinek  <jakub@redhat.com>
884         P0683R1 - default member initializers for bit-fields
885         * cp-tree.h (grokbitfield): Add INIT parameter.
886         * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
887         if true, parse a conditional-expression rather than
888         assignment-expression.
889         (cp_parser_member_declaration): For C++11 and later pass true
890         as STRICT_P to cp_parser_constant_expression.  Parse C++2A bitfield
891         NSDMIs.  Adjust grokbitfield caller.  Handle DECL_INITIAL also for
892         DECL_C_BIT_FIELDs.
893         (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
894         * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
895         (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
896         * decl2.c (grokbitfield): Add INIT parameter, pass it to
897         cp_finish_decl.
898         * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
899         just non-bitfields.
901         * class.c (check_bitfield_decl): Retrieve and clear width from
902         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
903         (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
904         DECL_INITIAL.
905         (remove_zero_width_bit_fields): Adjust comment.
906         * decl2.c (grokbitfield): Stash width into
907         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
908         * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
909         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
911         * parser.c (cp_parser_member_declaration): Parse attributes before
912         colon of a bitfield in addition to after colon.
914         * Make-lang.in (check-c++-all): Test also c++2a.
916 2017-09-28  Jason Merrill  <jason@redhat.com>
918         PR c++/56973, DR 696 - capture constant variables only as needed.
919         * expr.c (mark_use): Split out from mark_rvalue_use and
920         mark_lvalue_use.  Handle lambda capture of constant variables.
921         (mark_lvalue_use_nonread): New.
922         * semantics.c (process_outer_var_ref): Don't capture a constant
923         variable until forced.
924         * pt.c (processing_nonlambda_template): New.
925         * call.c (build_this): Check it.
926         * decl2.c (grok_array_decl): Call mark_rvalue_use and
927         mark_lvalue_use_nonread.
928         * init.c (constant_value_1): Don't call mark_rvalue_use.
929         * typeck.c (build_static_cast): Handle lambda capture.
931         Use local_specializations to find capture proxies.
932         * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
933         * lambda.c (build_capture_proxy): Set it.
934         (add_capture): Pass initializer to build_capture_proxy.
935         (start_lambda_function): Likewise.
936         (insert_capture_proxy): Use register_local_specialization.
937         (is_lambda_ignored_entity): Always ignore proxies.
938         * name-lookup.c (qualify_lookup): Don't check
939         is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
940         * semantics.c (process_outer_var_ref): Use
941         retrieve_local_specialization.
942         * parser.c (cp_parser_lambda_body): Push local_specializations.
943         * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
944         (tsubst_lambda_expr): Push local_specializations sooner.
945         (tsubst_copy_and_build): Don't register_local_specialization.
947         * call.c (build_special_member_call): Use the return value of
948         mark_lvalue_use.
949         * decl.c (compute_array_index_type): Likewise.
950         * parser.c (cp_parser_oacc_wait_list): Likewise.
951         * lambda.c (is_normal_capture_proxy): Handle *this capture.
952         (add_capture): Clarify internal_error message.
954 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
956         PR bootstrap/81926
957         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
959 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
961         PR sanitizer/81929
962         * tree.c (struct replace_placeholders_t): Add pset field.
963         (replace_placeholders_r): Call cp_walk_tree with d->pset as
964         last argument instead of NULL.  Formatting fix.
965         (replace_placeholders): Add pset variable, add its address
966         into data.  Pass &pset instead of NULL to cp_walk_tree.
968 2017-09-22  David Malcolm  <dmalcolm@redhat.com>
970         * call.c (get_fndecl_argument_location): New function.
971         (convert_like_real): Use it  when complaining about argument type
972         mismatches.
973         * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
974         * parser.c (make_parameter_declarator): Add "loc" param and use
975         it to initialize the new field.
976         (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
977         the "no_parameters" parameter.
978         (cp_parser_parameter_declaration_list): Set the location of the
979         result of grokdeclarator to be the parameter's loc, assuming no
980         errors.
981         (cp_parser_parameter_declaration): Generate a location for the
982         parameter and pass to make_parameter_declarator.
984 2017-09-20  Nathan Sidwell  <nathan@acm.org>
986         * name-lookup.c (member_name_cmp): Use DECL_UID for final
987         ordering.
989 2017-09-20  Jakub Jelinek  <jakub@redhat.com>
991         P0409R2 - allow lambda capture [=, this]
992         * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
993         redundant [=, this].
995 2017-09-18  Jason Merrill  <jason@redhat.com>
997         PR c++/82069 - ICE with lambda in template
998         * semantics.c (process_outer_var_ref): Check uses_template_parms
999         instead of any_dependent_template_arguments_p.
1001 2017-09-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1002             Paolo Carlini  <paolo.carlini@oracle.com>
1004         PR c++/64644
1005         * decl2.c (finish_anon_union): Complain about "anonymous union with
1006         no members" with a pedwarn.
1008 2017-09-15  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1010         * typeck.c (build_reinterpret_cast_1,
1011         build_const_cast_1): Implement -Wcast-align=strict.
1013 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
1015         * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1016         adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1017         to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
1018         (cxx_init_decl_processing, next_initializable_field,
1019         is_direct_enum_init, check_initializer, cp_finish_decl,
1020         mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1021         finish_function): Likewise.
1022         * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1023         * pt.c (mark_template_parm, convert_nontype_argument,
1024         instantiate_class_template_1, type_unification_real, unify,
1025         get_partial_spec_bindings, dependent_type_p_r): Likewise.
1026         * typeck.c (cp_build_unary_op): Likewise.
1027         * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1028         * call.c (build_user_type_conversion_1, build_over_call,
1029         build_special_member_call): Likewise.
1030         * lambda.c (begin_lambda_type): Likewise.
1031         * typeck2.c (process_init_constructor_record): Likewise.
1032         * class.c (build_base_field, finalize_literal_type_property,
1033         explain_non_literal_class): Likewise.
1034         * parser.c (cp_parser_diagnose_invalid_type_name,
1035         cp_parser_primary_expression, cp_parser_lambda_introducer,
1036         cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1037         cp_convert_range_for, cp_parser_perform_range_for_lookup,
1038         cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1039         cp_parser_static_assert, cp_parser_simple_type_specifier,
1040         cp_parser_namespace_definition, cp_parser_using_declaration,
1041         cp_parser_init_declarator, cp_parser_type_parameter_key,
1042         cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1043         cp_parser_constructor_declarator_p): Likewise.
1044         * mangle.c (struct globals): Rename need_cxx1z_warning to
1045         need_cxx17_warning.
1046         (write_exception_spec, start_mangling, mangle_decl): Likewise.
1047         * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1048         it.
1049         (check-c++17): New goal.  Use 17 instead of 1z.
1050         (check-c++-all): Use 17 instead of 1z.
1052 2017-09-14  Jakub Jelinek  <jakub@redhat.com>
1054         PR c++/81314
1055         * cp-gimplify.c (omp_var_to_track): Look through references.
1056         (omp_cxx_notice_variable): Likewise.
1058 2017-09-13  Nathan Sidwell  <nathan@acm.org>
1060         Conv-op identifers not in identifier hash table
1061         * lex.c (conv_type_hasher): Make member fns inline.
1062         (make_conv_op_name): Directly clone conv_op_identifier.
1064         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1065         * cp-tree.h (struct lang_type): Rename methods to members.
1066         (CLASSTYPE_METHOD_VEC): Rename to ...
1067         (CLASSTYPE_MEMBER_VEC): ... this.
1068         * name-lookup.h (get_method_slot): Rename to ...
1069         (get_member_slot): ... this.
1070         (resort_type_method_vec): Rename to ...
1071         (resort_type_member_vec): ... this.
1072         * class.c (add_method, warn_hidden): Adjust.
1073         * search.c (dfs_locate_field_accessor_pre): Adjust.
1074         * name-lookup.c (method_vec_binary_search): Rename to ...
1075         (member_vec_binary_search): ... this and adjust.
1076         (method_vec_linear_search): Rename to ...
1077         (member_vec_linear_search): ... this and adjust.
1078         (fields_linear_search, get_class_binding_direct): Adjust.
1079         (get_method_slot): Rename to ...
1080         (get_member_slot): ... this and adjust.
1081         (method_name_slot): Rename to ...
1082         (member_name_slot): ... this and adjust.
1083         (resort_type_method_vec): Rename to ...
1084         (resort_type_member_vec): ... this and adjust.
1085         (method_vec_append_class_fields): Rename to ...
1086         (member_vec_append_class_fields): ... this and adjust.
1087         (method_vec_append_enum_values): Rename to ...
1088         (member_vec_append_enum_values): ... this and adjust.
1089         (method_vec_dedup): Rename to ...
1090         (member_vec_dedup): ... this and adjust.
1091         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1092         
1093 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
1095         PR c++/70621
1096         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1097         returns it; avoid misleading error message.
1099 2017-09-12  Nathan Sidwell  <nathan@acm.org>
1101         Kill CLASSTYPE_SORTED_FIELDS.
1102         * cp-tree.h (struct lang_type): Lose sorted_fields member.
1103         (CLASSTYPE_SORTED_FIELDS): Delete.
1104         * name-lookup.h (set_class_bindings): Add EXTRA arg.
1105         * name-lookup.c (fields_linear_search): New, broken out of ...
1106         (lookup_field_1): ... here.  Delete remainder of function.
1107         (get_class_binding_direct): Reimplement without sorted_fields.
1108         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1109         (get_method_slot): Call set_class_binding when creating method_vec
1110         on complete type.
1111         (method_name_cmp): Order identically named slots.
1112         (sorted_fields_type_new): Delete.
1113         (field_vc_append_class_fields): Rename to ...
1114         (method_vec_append_class_fields): ... here.  Adjust.
1115         (field_vec_append_enum_values): Renme to ...
1116         (method_vec_append_enum_values): ... here. Adjust.
1117         (method_vec_dedup): New.
1118         (set_class_bindings): Reimplement.
1119         (insert_late_enum_def_bindings): Reimplement.
1121         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1122         consistency.
1123         (restort_data): Move later.
1124         (method_name_cmp, resort_method_name_cmp): Simplify.
1125         (resort_type_method_vec): Reformat.
1127 2017-09-09  Jason Merrill  <jason@redhat.com>
1129         * constexpr.c (reduced_constant_expression_p): If
1130         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1132 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
1134         PR bootstrap/81926
1135         * cp-objcp-common.c (struct debug_type_hasher): New class.
1136         (debug_type_hash): New variable.
1137         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1139 2017-09-08  Jason Merrill  <jason@redhat.com>
1141         PR c++/70029 - ICE with ref-qualifier and -flto
1142         * tree.c (cxx_copy_lang_qualifiers): New.
1143         * cp-tree.h: Declare it.
1144         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1146 2017-09-06  Jason Merrill  <jason@redhat.com>
1148         PR c++/82053 - ICE with default argument in lambda in template
1149         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1150         in templates.
1151         (retrieve_specialization): Use lambda_fn_in_template_p.
1152         * cp-tree.h: Declare it.
1154         PR c++/82070 - error with nested lambda capture
1155         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1156         register_local_specialization.
1158 2017-09-06  Nathan Sidwell  <nathan@acm.org>
1160         * name-lookup.h (lookup_field_1): Delete.
1161         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1162         * name-lookup.c (lookup_field_1): make static
1163         (method_vec_binary_search, method_vec_linear_search): New.  Broken
1164         out of ...
1165         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
1166         Do complete search of this level.
1167         (get_class_binding): Adjust.
1168         * decl.c (reshape_init_class): Call get_class_binding.
1169         * search.c (lookup_field_r): Move field searching into
1170         get_class_binding_direct.
1172         * class.c (warn_hidden): Don't barf on non-functions.
1173         * decl2.c (check_classfn): Likewise.  Check template match earlier.
1175         * name-lookup.c (count_fields): Rename to ...
1176         (count_class_fields): ... here.  Take a class, don't count
1177         NULL-named fields.
1178         (add_fields_to_record_type): Rename to ...
1179         (field_vec_append_class_fields): ... here.  Take a class, don't
1180         add NULL-named fields.
1181         (add_enum_fields_to_record_type): Rename to ...
1182         (field_vec_append_enum_values): ... here.
1183         (set_class_bindings): Adjust, assert we added expected number.
1184         (insert_late_enum_def_bindings): Reimplement.  Create vector if
1185         there are now sufficient entries.
1187         * name-lookup.h (lookup_fnfields_slot_nolazy,
1188         lookup_fnfields_slot): Rename to ...
1189         (get_class_binding_direct, get_class_binding): ... here.
1190         * name-lookup.c (lookup_fnfields_slot_nolazy,
1191         lookup_fnfields_slot): Rename to ...
1192         (get_class_binding_direct, get_class_binding): ... here.
1193         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1194         * call.c (build_user_type_conversion_1): Adjust.
1195         (has_trivial_copy_assign_p): Adjust.
1196         (has_trivial_copy_p): Adjust.
1197         * class.c (get_basefndecls) Adjust.
1198         (vbase_has_user_provided_move_assign) Adjust.
1199         (classtype_has_move_assign_or_move_ctor_p): Adjust.
1200         (type_build_ctor_call, type_build_dtor_call): Adjust.
1201         * decl.c (register_dtor_fn): Adjust.
1202         * decl2.c (check_classfn): Adjust.
1203         * pt.c (retrieve_specialization): Adjust.
1204         (check_explicit_specialization): Adjust.
1205         (do_class_deduction): Adjust.
1206         * search.c (lookup_field_r): Adjust.
1207         (look_for_overrides_here, lookup_conversions_r): Adjust.
1208         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1209         * tree.c (type_has_nontrivial_copy_init): Adjust.
1210         * method.c (lazily_declare_fn): Adjust comment.
1212 2017-09-05  Nathan Sidwell  <nathan@acm.org>
1214         * name-lookup.c (do_class_using_decl): Elide read-once temps.
1215         Move declarations to initializations.
1217         * class.c (add_method): Move slot search and insertion to ...
1218         * name-lookup.c (get_method_slot): ... this new function.
1219         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1220         * name-lookup.h (get_method_slot): Declare.
1221         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1222         realistic type.
1223         (grok_special_member_properties): Set
1224         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1225         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
1227         * cp-tree.h (lang_decl_base): Rename template_conv_p to
1228         unknown_bound_p.
1229         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1230         (DECL_CONV_FN_TYPE): FN must be conv op.
1231         (DECL_TEMPLATE_CONV_FN_P): Delete.
1232         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1233         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1234         setting.
1236         * class.c (unreverse_member_declarations): Remove extraneous if.
1237         * pt.c (push_template_decl_real): Use string concatenation, not
1238         \<newline>.  Add %<..%>.
1240 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
1242         PR c++/81942
1243         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1244         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1245         creating cdtor_label.
1246         * constexpr.c (returns): Add the case of a constructor/destructor
1247         returning via a LABEL_DECL_CDTOR label.
1248         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1250 2017-09-01  Nathan Sidwell  <nathan@acm.org>
1252         * cp-tree.h (resort_type_method_vec): Move declaration to ...
1253         * name-lookup.h (resort_type_method_vec): ... here.
1254         (set_class_bindings): Lose 2nd arg.
1255         * class.c (finish_struct_1, finish_struct): Adjust
1256         set_class_bindings call.  Don't call finish_struct_methods.
1257         (resort_data, method_name_cmp, resort_method_name_cmp,
1258         resort_type_method_vec, finish_struct_methods): Move to ...
1259         * name-lookup.c (resort_data, method_name_cmp,
1260         resort_method_name_cmp, resort_type_method_vec): ... here.
1261         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
1263         * class.c (finish_struct): Call set_class_bindings for the
1264         template case too.
1266         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1267         Don't call maybe_warn_about_overly_private_class here.
1268         (warn_hidden): Cleanup declarations and comments.
1269         (type_has_user_provided_constructor): No need to check
1270         CLASSTYPE_METHOD_VEC.
1271         (type_has_user_provided_or_explicit_constructor): Likewise.
1272         (classtype_has_move_assign_or_move_ctor_p): Likewise.
1273         (check_bases_and_members): Don't call finish_struct_methods here.
1274         (finish_struct_1): Call finish_struct_methods and
1275         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
1276         here.
1277         (finish_struct): For templates process USING_DECLS and clear
1278         DECL_IN_AGGR_P before calling finish_struct_methods. Call
1279         maybe_warn_about_overly_private_class here.
1281         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1282         Restore sorted_fields vector.
1283         * cp-tree.h (lang_type): Restore sorted_fields vector.
1284         (CLASSTYPE_SORTED_FIELDS): Restore.
1285         (CLASSTYPE_BINDINGS): Delete.
1286         * name-lookup.c (lookup_field_1): Restore binary search.
1287         (sorted_fields_type_new, count_fields,
1288         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1289         (set_class_bindings): Revert.
1290         (insert_late_enum_def_binding): Restore field_vec insertion.
1292 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
1294         PR c/81887
1295         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1297 2017-09-01  Marek Polacek  <polacek@redhat.com>
1299         PR c++/82040
1300         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1302 2017-08-30  Jason Merrill  <jason@redhat.com>
1304         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1305         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1306         (regenerated_lambda_fn_p): New.
1307         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1308         (tsubst_copy) [VAR_DECL]: Likewise.
1310         PR c++/82030 - ICE inheriting from multiple lambdas
1311         PR c++/80767
1312         * call.c (compare_ics): Handle null candidate.
1314 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
1316         Make taking the address of an overloaded function a non-deduced context
1318         * pt.c (unify_overload_resolution_failure): Remove.
1319         (unify_one_argument): Adjust.
1321 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1322             Alan Hayward  <alan.hayward@arm.com>
1323             David Sherwood  <david.sherwood@arm.com>
1325         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1327 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1328             Alan Hayward  <alan.hayward@arm.com>
1329             David Sherwood  <david.sherwood@arm.com>
1331         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1333 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1334             Alan Hayward  <alan.hayward@arm.com>
1335             David Sherwood  <david.sherwood@arm.com>
1337         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1338         instead of TYPE_MODE.
1340 2017-08-29  Jason Merrill  <jason@redhat.com>
1342         PR c++/81236 - ICE with template-id in generic lambda
1343         * semantics.c (finish_id_expression): Remove special dependent case.
1344         Avoid some later pieces when dependent.
1345         (finish_qualified_id_expr): Do normal BASELINK handling in a
1346         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1347         (parsing_default_capturing_generic_lambda_in_template): Remove.
1348         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1349         error for types that will never be complete.
1350         * mangle.c (write_expression): Add sanity check.
1351         * tree.c (build_qualified_name): Add sanity check.
1352         (cp_walk_subtrees): Walk into the class context of a BASELINK.
1353         * lambda.c (add_capture): Improve diagnostic for generic lambda
1354         capture failure.
1355         * call.c (build_new_method_call_1): Print the right constructor
1356         name.
1358         Reimplement handling of lambdas in templates.
1359         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1360         * decl.c (start_preparsed_function): Call start_lambda_scope.
1361         (finish_function): Call finish_lambda_scope.
1362         * init.c (get_nsdmi): Call start/finish_lambda_scope.
1363         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1364         * parser.c (cp_parser_function_definition_after_declarator): Don't
1365         call start/finish_lambda_scope.
1366         * pt.c (retrieve_specialization): Ignore lambda functions in
1367         templates.
1368         (find_parameter_packs_r): Ignore capture proxies.  Look into
1369         lambdas.
1370         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1371         (tsubst_default_argument): Call start/finish_lambda_scope.
1372         (tsubst_function_decl): Handle lambda functions differently.
1373         (tsubst_template_decl): Likewise.
1374         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1375         proxies.
1376         (tsubst_lambda_expr): Create a new closure rather than instantiate
1377         the one from the template.
1378         (tsubst_copy_and_build): Don't register a specialization of a pack.
1379         (regenerate_decl_from_template): Call start/finish_lambda_scope.
1380         (instantiate_decl): Remove special lambda function handling.
1381         * semantics.c (process_outer_var_ref): Remove special generic lambda
1382         handling.  Don't implicitly capture in a lambda in a template.  Look
1383         for an existing proxy.
1384         * class.c (current_nonlambda_class_type): Use decl_type_context.
1386         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1387         (LAMBDA_EXPR_RETURN_TYPE): Remove.
1388         (struct tree_lambda_expr): Remove closure and return_type fields.
1389         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1390         * pt.c (tsubst_copy_and_build): Likewise.
1391         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1392         (cp_parser_lambda_body): Adjust unspecified return type check.
1393         * ptree.c (cxx_print_lambda_node): Don't print closure or
1394         return type.
1396         PR c++/80935 - wrong C++17 error with lambda
1397         * decl.c (check_for_uninitialized_const_var): Check
1398         is_instantiation_of_constexpr.
1399         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1400         is_instantiation_of_constexpr.
1401         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1403         * lambda.c (build_lambda_object): Check for error_mark_node.
1404         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1405         pack as well.
1406         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1407         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1409         PR c++/80767 - unnecessary instantiation of generic lambda
1410         * call.c (convert_like_real): Call build_user_type_conversion_1 if
1411         cand is null.
1412         (add_conv_candidate): Build a ck_user conversion with no candidate.
1414         Fix lambdas in template default argument of inherited ctor.
1415         * method.c (synthesized_method_base_walk): Replace an inherited
1416         template with its specialization.
1417         (synthesized_method_walk): Make inheriting_ctor a pointer.
1418         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1419         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1421         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1422         template, not the function.
1423         (template_guide_p): Adjust.
1425         Support copying local_specializations.
1426         * cp-tree.h (enum lss_policy): New.
1427         (local_specialization_stack): Add policy parameter to default ctor.
1428         * pt.c (local_specialization_stack): Copy local_specializations if
1429         lss_copy.
1431         * constexpr.c (potential_constant_expression_1): Add "now" parm.
1432         (is_constant_expression, require_constant_expression): New.
1433         (is_static_init_expression, is_nondependent_constant_expression)
1434         (is_nondependent_static_init_expression): Drop "potential".
1435         * except.c (build_must_not_throw_expr): Do type conversion on
1436         value-dependent argument.
1437         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1439         Instantiate default arguments/member initializers once.
1440         * init.c (get_nsdmi): Remember NSDMI instantiations.
1441         * parser.c (inject_this_parameter): Be more picky about
1442         current_class_ptr.
1443         * pt.c (tsubst_copy): Simplify 'this' handling.
1444         (tsubst_default_argument): Remember default argument
1445         instantiations.  Take parameter number.
1446         (tsubst_default_arguments): Pass it.
1447         * call.c (convert_default_arg): Likewise.
1449         Fix default argument conversion failure and SFINAE.
1450         * call.c (build_over_call): Check convert_default_arg result for
1451         error_mark_node.
1452         * parser.c (cp_parser_late_parsing_default_args): Remember
1453         error_mark_node.
1455 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1457         * cp-tree.h (lang_type): Replace sorted_fields vector with
1458         bindings map.
1459         (CLASSTYPE_SORTED_FIELDS): Delete.
1460         (CLASSTYPE_BINDINGS): New.
1461         * decl.c (finish_enum_value_list): Swap args of
1462         insert_late_enum_def_bindings.
1463         * name-lookup.c (lookup_field_1): Replace binary search of sorted
1464         fields with map->get.
1465         (sorted_fields_type_new, count_fields,
1466         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1467         (add_class_member, add_class_members): New.
1468         (set_class_bindings): Create map and insert.
1469         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
1470         * ptree.c (cxx_print_type): Delete sorted fields printing.
1472         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1473         Delete.
1474         * name-lookup.h (set_class_bindings,
1475         insert_late_enum_def_bindings): Declare.
1476         * decl.c (finish_enum_value_list): Adjust for
1477         insert_late_enum_def_bindings name change.
1478         * class.c (finish_struct_1): Call set_class_bindings.
1479         (count_fields, add_fields_to_record_type,
1480         add_enum_fields_to_record_type, sorted_fields_type_new,
1481         insert_into_classtype_sorted_fields,
1482         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1483         * name-lookup.h (count_fields, add_fields_to_record_type,
1484         add_enum_fields_to_record_type, sorted_fields_type_new,
1485         set_class_bindings, insert_late_enum_def_bindings): ... here.
1487 2017-08-25  Nathan Sidwell  <nathan@acm.org>
1489         * class.c (method_name_cmp, resort_method_name_cmp): Methods
1490         can never be NULL.
1492         Conversion operators have a special name
1493         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1494         (conv_op_marker, conv_op_identifier): New.
1495         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1496         * decl.c (initialize_predefined_identifiers): Add
1497         conv_op_identifier.
1498         (cxx_init_decl_processing): Create conv_op_marker.
1499         * decl2.c (check_classfn): Lookup conv-ops by name.
1500         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1501         (resort_type_method_vec): Don't skip conv-ops.
1502         (finish_struct_methods, warn_hidden): Likewise.
1503         * name-lookup.h (lookup_all_conversions): Delete.
1504         * name-lookup.c (lookup_conversion_operator): Replace with ...
1505         (extract_conversion_operator): ... this.
1506         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1507         (lookup_all_conversions): Delete.
1508         * pt.c (check_explicit_specialization): Find conv-ops by name.
1509         * search.c (lookup_conversions_r): Likewise.
1511 2017-08-24  Nathan Sidwell  <nathan@acm.org>
1513         Conversion operators kept on single overload set
1514         * class.c (add_method): Keep all conv-ops on one slot.
1515         * name-lookup.c (lookup_conversion_operator): Pull the desired
1516         conv op out of overload set.
1517         * search.c (lookup_conversions_r): Lose template/non-template
1518         distinction.
1519         (lookup_conversions): Likewise.
1521 2017-08-23  Nathan Sidwell  <nathan@acm.org>
1523         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1524         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1525         declatations to ...
1526         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1527         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1528         * search.c (lookup_conversion_operator,
1529         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1530         lookup_all_conversions): Move to ...
1531         * name-lookup.c (lookup_conversion_operator,
1532         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1533         lookup_all_conversions): ... here.
1535         * semantics.c (finish_member_declaration): Move USING_DECL check
1536         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
1537         template decl list insertion.
1539         * cp-tree.h (maybe_version_functions): Declare.
1540         * decl.c (decls_match): Break function versioning check to
1541         separate function.  Call it.
1542         (maybe_version_functions): Broken out of decls_match.
1543         * class.c (add_method): Use maybe_version_functions.
1545         * cp-tree.h (print_search_statistics,
1546         reinit_search_statistics): Don't declare.
1547         * search.c (n_fields_searched, n_calls_lookup_field,
1548         n_calls_lookup_field_1, n_calls_lookup_fnfields,
1549         n_calls_lookup_fnfields_1, n_calls_get_base_type,
1550         n_outer_fields_searched, n_contexts_saved): Delete.
1551         (lookup_field_1, lookup_member,
1552         lookup_fnfields_slot_nolazy): Remove stat gathering.
1553         (print_search_statistics, reinit_search_statistics): Delete.
1554         * tree.c (cxx_print_statistics): Don't print search stats.
1556 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1558         * search.c (lookup_field_r): Remove obsolete code for type-named
1559         field in PoD.
1561         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1562         isn't special.
1563         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1564         (lookup_field_fuzzy_r): Adjust.
1566 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
1568         * call.c (build_over_call): Pass NULL for new parameter to
1569         check_function_arguments.
1570         * typeck.c (cp_build_function_call_vec): Likewise.
1572 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1574         PR c++/81899
1575         * pt.c (instantiate_class_template_1):
1576         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1578 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1580         PR c++/81514
1581         * name-lookup.c (maybe_suggest_missing_header): Convert return
1582         type from void to bool; return true iff a suggestion was offered.
1583         (suggest_alternative_in_explicit_scope): Move call to
1584         maybe_suggest_missing_header to before use of best_match, and
1585         return true if the former offers a suggestion.
1587 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1589         PR c/53037
1590         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1591         * decl2.c (grokbitfield): Don't allow bit-field with
1592         warn_if_not_aligned type.
1594 2017-08-17  Nathan Sidwell  <nathan@acm.org>
1596         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1597         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1598         (TYPE_TEMPLATE_INFO): Simplify.
1599         (SET_TYPE_TEMPLATE_INFO): Simplify.
1601         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1602         don't need lang_type.
1603         (cxx_make_type): Use maybe_add_lang_type_raw return value.
1604         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1605         TYPE_LANG_SPECIFIC.
1607         * cp-tree.h (struct lang_type): Remove template_info field.
1608         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1609         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1611 2017-08-14  Martin Sebor  <msebor@redhat.com>
1613         PR c/81117
1614         * error.c (cp_printer): Handle 'G'.
1616 2017-08-11  Martin Liska  <mliska@suse.cz>
1618         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1619         TARGET_SUPPORTS_ALIASES.
1620         (handle_tls_init): Likewise.
1621         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
1622         both arguments.
1623         * optimize.c (can_alias_cdtor): Likewise.
1625 2017-08-11  Jason Merrill  <jason@redhat.com>
1627         PR c++/81671 - nullptr_t template parameter
1628         * pt.c (convert_nontype_argument): Fix nullptr_t check.
1630 2017-08-10  Jason Merrill  <jason@redhat.com>
1632         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1633         * method.c (synthesized_method_walk): Don't diagnose lack of
1634         operator delete.
1636         PR c++/80452 - Core 1579, implicit move semantics on return/throw
1637         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1638         tentatively changed the lvalue to an rvalue.
1639         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1640         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1641         parameter is an rvalue reference.
1642         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1643         * typeck.c (check_return_expr): Likewise.
1645 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
1647         * parser.c (cp_parser_error): Update for new param to
1648         c_parse_error.
1649         (class token_pair): New class.
1650         (struct matching_paren_traits): New struct.
1651         (matching_parens): New typedef.
1652         (struct matching_brace_traits): New struct.
1653         (matching_braces): New typedef.
1654         (cp_parser_statement_expr): Convert explicit parsing of
1655         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1656         class matching_parens, so that the pertinent open parenthesis is
1657         highlighted when there are problems locating the close
1658         parenthesis.
1659         (cp_parser_primary_expression): Likewise.
1660         (cp_parser_compound_literal_p): Remove consumption of opening
1661         paren.
1662         (cp_parser_postfix_expression): Convert explicit parsing of
1663         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1664         above.  Use it to consume the opening paren previously consumed by
1665         cp_parser_compound_literal_p.
1666         (cp_parser_parenthesized_expression_list): Likewise.
1667         (cp_parser_unary_expression): Likewise.
1668         (cp_parser_new_expression): Likewise.
1669         (cp_parser_cast_expression): Likewise.
1670         (cp_parser_builtin_offsetof): Likewise.
1671         (cp_parser_trait_expr): Likewise.
1672         (cp_parser_lambda_declarator_opt): Likewise.
1673         (cp_parser_lambda_body): Likewise, for matching_braces.
1674         (cp_parser_compound_statement): Likewise.
1675         (cp_parser_selection_statement): Likewise, for matching_parens.
1676         (cp_parser_iteration_statement): Likewise.
1677         (cp_parser_already_scoped_statement): Likewise, for
1678         matching_braces.
1679         (cp_parser_linkage_specification): Likewise.
1680         (cp_parser_static_assert): Likewise, for matching_parens.
1681         (cp_parser_decltype): Likewise.
1682         (cp_parser_operator): Likewise.
1683         (cp_parser_enum_specifier): Likewise.
1684         (cp_parser_namespace_definition): Likewise.
1685         (cp_parser_direct_declarator): Likewise.
1686         (cp_parser_braced_list): Likewise.
1687         (cp_parser_class_specifier_1): Likewise, for matching_braces.
1688         (cp_parser_constant_initializer): Likewise.
1689         (cp_parser_noexcept_specification_opt): Likewise, for
1690         matching_parens.
1691         (cp_parser_exception_specification_opt): Likewise.
1692         (cp_parser_handler): Likewise.
1693         (cp_parser_asm_specification_opt): Likewise.
1694         (cp_parser_asm_operand_list): Likewise.
1695         (cp_parser_gnu_attributes_opt): Likewise.
1696         (cp_parser_std_attribute_spec): Likewise.
1697         (cp_parser_requirement_parameter_list): Likewise.
1698         (cp_parser_requirement_body): Likewise, for matching_braces.
1699         (cp_parser_compound_requirement): Likewise.
1700         (cp_parser_template_introduction): Likewise.
1701         (cp_parser_sizeof_pack): Likewise, for matching_parens.
1702         (cp_parser_sizeof_operand): Likewise; use it to consume the
1703         opening paren previously consumed by cp_parser_compound_literal_p.
1704         (get_matching_symbol): New function.
1705         (cp_parser_required_error): Add param "matching_location".  Remove
1706         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1707         handling it if set by calling c_parse_error, potentially with a
1708         secondary location if matching_location was set.
1709         (cp_parser_require): Add param "matching_location", with a default
1710         value of UNKNOWN_LOCATION.
1711         (cp_parser_require_keyword): Update for new param of
1712         cp_parser_required_error.
1713         (cp_parser_objc_encode_expression): Update to class matching_parens
1714         as above.
1715         (cp_parser_objc_defs_expression): Likewise.
1716         (cp_parser_objc_protocol_expression): Likewise.
1717         (cp_parser_objc_selector_expression): Likewise.
1718         (cp_parser_objc_typename): Likewise.
1719         (cp_parser_objc_superclass_or_category): Likewise.
1720         (cp_parser_objc_try_catch_finally_statement): Likewise.
1721         (cp_parser_objc_synchronized_statement): Likewise.
1722         (cp_parser_objc_at_property_declaration): Likewise.
1723         (cp_parser_oacc_single_int_clause): Likewise.
1724         (cp_parser_oacc_shape_clause): Likewise.
1725         (cp_parser_omp_clause_collapse): Likewise.
1726         (cp_parser_omp_clause_default): Likewise.
1727         (cp_parser_omp_clause_final): Likewise.
1728         (cp_parser_omp_clause_if): Likewise.
1729         (cp_parser_omp_clause_num_threads): Likewise.
1730         (cp_parser_omp_clause_num_tasks): Likewise.
1731         (cp_parser_omp_clause_grainsize): Likewise.
1732         (cp_parser_omp_clause_priority): Likewise.
1733         (cp_parser_omp_clause_hint): Likewise.
1734         (cp_parser_omp_clause_defaultmap): Likewise.
1735         (cp_parser_omp_clause_ordered): Likewise.
1736         (cp_parser_omp_clause_schedule): Likewise.
1737         (cp_parser_omp_clause_num_teams): Likewise.
1738         (cp_parser_omp_clause_thread_limit): Likewise.
1739         (cp_parser_omp_clause_aligned): Likewise.
1740         (cp_parser_omp_clause_linear): Likewise.
1741         (cp_parser_omp_clause_safelen): Likewise.
1742         (cp_parser_omp_clause_simdlen): Likewise.
1743         (cp_parser_omp_clause_depend): Likewise.
1744         (cp_parser_omp_clause_device): Likewise.
1745         (cp_parser_omp_clause_dist_schedule): Likewise.
1746         (cp_parser_oacc_clause_async): Likewise.
1747         (cp_parser_omp_critical): Likewise.
1748         (cp_parser_omp_for_loop): Likewise.
1749         (cp_parser_omp_sections_scope): Likewise.
1750         (cp_parser_omp_declare_reduction_exprs): Likewise.
1751         Update for new param to cp_parser_required_error.
1752         (cp_parser_oacc_routine): Likewise.
1753         (cp_parser_transaction_expression): Likewise.
1754         (cp_parser_cilk_simd_vectorlength): Likewise.
1756 2017-08-09  Jason Merrill  <jason@redhat.com>
1758         PR c++/81525 - wrong constant value with generic lambda
1759         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1760         (tsubst_copy) [VAR_DECL]: Handle auto.
1762         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1763         * init.c (get_nsdmi): Add complain parm.
1764         * typeck2.c (digest_nsdmi_init): Add complain parm.
1765         (process_init_constructor_record): Pass complain to get_nsdmi.
1766         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1767         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
1768         synthesized_method_walk.
1769         (synthesized_method_walk): Adjust.
1770         (walk_field_subobs): Pass complain to get_nsdmi.
1771         (defaulted_late_check): Skip other checks if deleted.
1772         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1773         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1774         * parser.c (defarg_location): New.
1775         * error.c (location_of): Use it.
1777 2017-08-09  Marek Polacek  <polacek@redhat.com>
1779         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1780         * typeck.c (build_binary_op): Change the type of a parameter to bool.
1781         (cp_truthvalue_conversion): Use true instead of 1.
1783 2017-08-08  Marek Polacek  <polacek@redhat.com>
1785         PR c++/81607
1786         * cp-gimplify.c (cp_fold): If folding exposed a branch of
1787         a COND_EXPR, convert it to the original type of the COND_EXPR, if
1788         they differ.               
1790 2017-08-08  Martin Liska  <mliska@suse.cz>
1792         * call.c: Include header files.
1793         * cp-gimplify.c: Likewise.
1794         * cp-ubsan.c: Likewise.
1795         * cvt.c: Likewise.
1796         * init.c: Likewise.
1797         * search.c: Likewise.
1798         * semantics.c: Likewise.
1799         * typeck.c: Likewise.
1801 2017-08-07  Martin Liska  <mliska@suse.cz>
1803         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1804         attribute.
1805         (cp_parser_std_attribute): Likewise.
1806         * tree.c: Add new include.
1808 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
1810         PR c++/79790
1811         * pt.c (do_class_deduction): Handle the case of no viable implicit
1812         deduction guides; simplify the code generating implicit deduction
1813         guides.
1815 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
1817         PR c++/71440
1818         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1819         destructor as expressions.
1821 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
1823         PR c++/81640
1824         * call.c (build_user_type_conversion_1): Only call
1825         lookup_fnfields_slot if totype is CLASS_TYPE_P.
1827 2017-07-31  Jason Merrill  <jason@redhat.com>
1829         * decl.c (declare_global_var): Set DECL_CONTEXT.
1831 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
1832             Martin Liska  <mliska@suse.cz>
1834         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1835         * semantics.c (finish_goto_stmt): Build gimple predict
1836         stament.
1837         * constexpr.c (potential_constant_expression_1): Handle
1838         PREDICT_EXPR.
1840 2017-07-31  Martin Liska  <mliska@suse.cz>
1842         PR sanitize/81530
1843         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1844         also with current_function_decl non-null equality.
1845         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1846         * decl.c (compute_array_index_type): Likewise.
1847         * init.c (finish_length_check): Likewise.
1848         * typeck.c (cp_build_binary_op): Likewise.
1850 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
1852         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1853         DW_AT_export_symbols.
1854         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1855         argument, pass it through to the debug hook.
1856         (finish_namespace_using_directive): Adjust
1857         emit_debug_info_using_namespace caller.
1858         (push_namespace): Likewise.  Call it after setting
1859         DECL_NAMESPACE_INLINE_P.
1860         (cp_emit_debug_info_for_using): Pass false as new argument to
1861         the imported_module_or_decl debug hook.
1863 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
1865         * lex.c (copy_decl): Adjust.
1866         (copy_type): Likewise.
1868 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
1870         PR c++/71570
1871         * lambda.c (add_capture): Early return if we cannot capture by
1872         reference.
1874 2017-07-26  Jason Merrill  <jason@redhat.com>
1876         P0702R1 - List deduction of vector.
1877         * pt.c (do_class_deduction): Special-case deduction from a single
1878         element of related type.
1880 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
1882         PR c++/67054 - Inherited ctor with non-default-constructible members
1883         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
1884         when deducing an inheriting constructor.
1886 2017-07-21  Nathan Sidwell  <nathan@acm.org>
1888         * search.c (lookup_conversion_operator): Return overloads.
1889         (lookup_fnfields_idx_nolazy): Absorb into ...
1890         (lookup_fnfields_slot_nolaxy): ... here.
1891         (lookup_fnfields_1): Absorb into ...
1892         (lookup_fnfields_slot): ... here.
1894         Remove special CDtor METHOD_VEC slots.
1895         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
1896         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
1897         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
1898         (CLASSTYPE_DESTRUCTOR): Likewise.
1899         * class (add_method): Don't use special cdtor slots.
1900         * search.c (lookup_fnfields_idx_nolazy): Likewise.
1901         (look_for_overrides_here): Use lookup_fnfields_slot.
1902         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
1904         * call.c (add_candidates): Move decls to initialization.  Don't
1905         use !!.
1907 2017-07-20  Nathan Sidwell  <nathan@acm.org>
1909         Remove TYPE_METHODS.
1910         * class.c (maybe_warn_about_overly_private_class,
1911         finish_struct_methods, one_inheriting_sig, count_fields,
1912         add_fields_to_record_type, check_field_decls, check_methods,
1913         clone_function_decl, set_method_tm_attributes,
1914         finalize_literal_type_property, check_bases_and_members,
1915         create_vtable_ptr, determine_key_method,
1916         unreverse_member_declarations, finish_struct,
1917         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
1918         * decl.c (fixup_anonymous_aggr): Likewise.
1919         * decl2.c (reset_type_linkage_2): Likewise.
1920         * method.c (after_nsdmi_defaulted_late_checks,
1921         lazily_declare_fn): Likewise.
1922         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1923         * pt.c (instantiate_class_template_1, tsubst_expr,
1924         do_type_instantiation, instantiate_pending_templates): Likewise.
1925         * search.c (lookup_field_1): Likewise.
1926         * semantics.c (finish_member_declaration,
1927         finish_omp_declare_simd_methods): Likewise.
1929 2017-07-19  Nathan Sidwell  <nathan@acm.org>
1931         * class.c (add_implicitly_declared_members): Use
1932         classtype_has_move_assign_or_move_ctor_p.
1933         (classtype_has_move_assign_or_move_ctor,
1934         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
1935         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
1936         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
1937         Replace with ...
1938         (classtype_has_move_assign_or_move_ctor_p): ... this.
1939         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
1940         * tree.c (type_has_nontrivial_copy_init): Adjust.
1942         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
1943         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
1945 2017-07-18  Nathan Sidwell  <nathan@acm.org>
1947         * cp-array-notation.c (build_array_notation_ref): Use
1948         TYPE_{MIN,MAX}_VALUE.
1950         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
1951         (add_implicitly_declared_members): Use it.
1952         (type_has_move_constructor, type_has_move_assign): Merge into ...
1953         (classtype_has_move_assign_or_move_ctor): ... this new function.
1954         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
1956 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
1958         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
1959         friend outside class and obsolete auto as storage-class-specifier.
1961 2017-07-17  Nathan Sidwell  <nathan@acm.org>
1963         * class.c (maybe_warn_about_overly_private_class): Ignore public
1964         copy ctors.
1966         * class.c (type_has_user_declared_move_constructor,
1967         type_has_user_declared_move_assign): Combine into ...
1968         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
1969         * cp-tree.h (type_has_user_declared_move_constructor,
1970         type_has_user_declared_move_assign): Combine into ...
1971         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
1972         * method.c (maybe_explain_implicit_delete): Use it.
1973         (lazily_declare_fn): Use it.
1974         * tree.c (type_has_nontrivial_copy_init): Use it.
1976         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
1977         semantics, simplify implementation.
1979 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
1981         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
1982         in old-style cast diagnostic.
1983         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
1984         in useless cast diagnostic.
1985         * error.c (type_to_string): Remove enum special handling.
1987 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
1989         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
1990         the header names.
1991         (maybe_suggest_missing_header): Update for addition of '<' and '>'
1992         to above.  Provide a fix-it hint.
1993         * pt.c: Include "gcc-rich-location.h"
1994         (listify): Attempt to add fix-it hint for missing
1995         #include <initializer_list>.
1996         * rtti.c: Include "gcc-rich-location.h".
1997         (typeid_ok_p): Attempt to add fix-it hint for missing
1998         #include <typeinfo>.
2000 2017-07-12  Jason Merrill  <jason@redhat.com>
2002         P0512R0 - Deduction from an initializer list.
2003         * pt.c (do_class_deduction): Do list deduction in two phases.
2005 2017-07-12  Nathan Sidwell  <nathan@acm.org>
2007         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2008         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2009         identifier flags.
2010         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2011         DECL_CXX_DESTRUCTOR explicitly.
2012         * decl2.c (grokclassfn): Likewise.
2013         * friend.c (do_friend): Likewise.
2014         * method.c (make_thunk, make_alias_for,
2015         implicitly_declare_fn): Likewise.
2017 2017-07-11  Jason Merrill  <jason@redhat.com>
2019         Core DR 393
2020         * decl.c (grokparms): Downgrade error about array of unknown bound
2021         to pedwarn and disable it for C++17.
2023 2017-07-11  Nathan Sidwell  <nathan@acm.org>
2025         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2027 2017-07-10  Martin Sebor  <msebor@redhat.com>
2029         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2031 2017-07-06  Jason Merrill  <jason@redhat.com>
2033         PR c++/81204 - parse error with dependent template-name
2034         * parser.c (cp_parser_lookup_name): Revert previous change.
2036 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
2038         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2039         selftest::run_cp_tests.
2040         (selftest::run_cp_tests): New function.
2041         * cp-tree.h (selftest::run_cp_tests): New decl.
2043 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
2045         * parser.c (cp_parser_decomposition_declaration): Replace
2046         decomposition declaration with structured binding in diagnostics.
2047         * decl.c (cp_finish_decomp): Likewise.
2048         (grokdeclarator): Likewise.
2050         PR c++/81258
2051         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2052         forms of structured binding initializers.
2054 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
2056         PR c++/65775
2057         * decl.c (grokdeclarator): Move checks on function return type after
2058         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2059         is UNKNOWN_LOCATION fall back to input_location.
2061 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
2063         * parser.c (enum required_token): Fix spelling of
2064         RT_INTERATION to RT_ITERATION.
2065         (cp_parser_iteration_statement): Likewise.
2066         (cp_parser_required_error): Likewise.
2068 2017-06-30  Jason Merrill  <jason@redhat.com>
2070         PR c++/81257 - ICE with invalid ::template.
2071         PR c++/54769 - wrong lookup of dependent template-name.
2072         * parser.c (cp_parser_template_name): Revert part of last change.
2074 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2076         * config-lang.in (gtfiles): Add cp/lex.c.
2077         * cp-tree.h (mangle_convop_name_for_type): Rename ...
2078         (make_conv_op_name): ... here.  Move to lex.
2079         * lambda.c (maybe_add_lambda_conv_op): Update.
2080         * parser.c (cp_parser_conversion_function_id): Update.
2081         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2082         tsubst_copy_and_build): Update.
2083         * semantics.c (apply_deduced_return_type): Update.
2084         * mangle.c (conv_type_hasher, conv_type_names,
2085         mangle_conv_op_name_for_type): Move to ...
2086         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2087         ... here.  Rename.
2089 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
2091         PR c++/80014
2092         * parser.c (cp_parser_postfix_expression): Construct a location
2093         for typeid expressions.
2095 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2097         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2098         declare.
2099         (lookup_all_conversions): Declare.
2100         * class.c (get_basefndecls): Use lookup_fnfields_slot.
2101         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2102         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
2103         diagnostics.
2104         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2105         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2106         lookup_all_conversions.
2107         * search.c (lookup_fnfields_1): Make static.
2108         (lookup_all_conversions): New.
2109         (class_method_index_for_fn): Delete.
2110         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2111         lookup_fnfields_slot.
2113         * call.c (build_new_method_call_1): Use constructo_name to get
2114         ctor name.  Move argument processing earlier to merge cdtor
2115         handling blocks.
2116         * decl.c (grokfndecl): Cdtors have special names.
2117         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2118         * pt.c (check_explicit_specialization): Cdtor name is already
2119         special.
2120         * search.c (class_method_index_for_fn): Likewise.
2122         PR c++/81229
2123         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2124         a matching TYPE_DECL.
2126 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
2128         * class.c (add_method): Change pair of errors to error + inform.
2129         (handle_using_decl): Likewise.
2131 2017-06-29  Jason Merrill  <jason@redhat.com>
2133         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2135         PR c++/81180 - ICE with C++17 deduction of member class template.
2136         * pt.c (build_deduction_guide): Correct member template handling.
2138         PR c++/81188 - matching decltype of member function call.
2139         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2141 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2143         PR c++/81247
2144         * parser.c (cp_parser_namespace_definition): Immediately close the
2145         namespace if there's no open-brace.
2146         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2147         namespace.
2149 2017-06-29  Jason Merrill  <jason@redhat.com>
2151         PR c++/81164 - ICE with invalid inherited constructor.
2152         * search.c (binfo_direct_p): New.
2153         * name-lookup.c (do_class_using_decl): Use it.
2155 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2157         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2158         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2159         * decl.c (initialize_predefined_identifiers): Name cdtor special
2160         names consistently.  Use literals for above deleted defines.
2161         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2163         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2164         flag.
2166         * call.c (check_dtor_name): Use constructor_name for enums too.
2167         (build_new_method_call_1): Use constructor_name for cdtors and
2168         show ~ for dtor.
2169         * class.c (build_self_reference): Use TYPE_NAME to get name of
2170         self reference.
2171         * name-lookup (constructor_name): Use DECL_NAME directly.
2172         (constructor_name_p): Reimplement.
2173         (push_class_level_binding_1): Use TYPE_NAME directly.
2175         * class.c (finish_struct): Use OVL_P.
2176         (get_vfield_name): Measure constructor_name length.
2177         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2178         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2179         * cxx-pretty-print.c (is_destructor_name): Delete.
2180         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2181         * decl.c (grokfndecl): Move cheap checks first when looking for
2182         implicit extern cness.
2184         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2185         indentation. Remove unnecessary assignment of constructor name.
2187         Whitespace cleanups.
2188         * call.c (name_as_c_string): Move CONST_CAST to return.
2189         (build_new_method_call_1): Remove unneeded bracing.
2190         * class.c (include_empty_classes): Unbreak line.
2191         * constraint.cc (tsubst_check_constraint): Add space.
2192         * cp-tree.h (lang_decl_ns): Add comment.
2193         (PTRMEM_CST_MEMBER): Break line.
2194         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2195         (grokdeclarator): Remove lines, move declaration to first use.
2196         * decl2.c (decl_needed_p): Fix indentation.
2197         (c_parse_final_cleanups): Remove blank line.
2198         * method.c (implicitly_declare_fn): Move declaration to first use.
2199         * search.c (current_scope): Add blank lines.
2201 2017-06-28  Jason Merrill  <jason@redhat.com>
2203         PR c++/72764 - ICE with invalid template typename.
2204         * decl.c (build_typename_type): No longer static.
2205         * tree.c (strip_typedefs): Use it instead of make_typename_type.
2207         PR c++/69300 - ICE with self-referential noexcept
2208         * pt.c (maybe_instantiate_noexcept): Check for recursion.
2210         PR c++/61022 - error with variadic template template parm
2211         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2213         PR c++/72801 - ICE with variadic partial specialization
2214         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2216         PR c++/55639 - partial specialization with ::template
2217         * parser.c (cp_parser_class_head): Handle ::template.
2219         PR c++/45976 - error with ::template in declarator.
2220         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2222         PR c++/54769 - wrong lookup of dependent template-name.
2223         * parser.c (cp_parser_template_name): Handle dependent object type.
2224         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2225         parameter.
2226         (cp_parser_id_expression): Pass it.
2227         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2229         * parser.c (cp_parser_template_id): Use the range location on the
2230         TEMPLATE_ID_EXPR.
2232         PR c++/81204 - parse error with dependent template-name
2233         * parser.c (cp_parser_lookup_name): Disqualify function templates
2234         after lookup.
2236 2017-06-27  Nathan Sidwell  <nathan@acm.org>
2238         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2239         initialization point.  Don't unnecessarily check for ctor name.
2241         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2242         (CLASSTYPE_DESTRUCTOR): ... this.
2243         * class.c (accessible_nvdtor_p,
2244         maybe_warn_about_overly_private_class,
2245         add_implicitly_declared_members,
2246         clone_constructors_and_destructors, type_has_virtual_destructor):
2247         Adjust for CLASSTYPE_DESTRUCTOR.
2248         (deduce_noexcept_on_destructors): Absorb into ...
2249         (check_bases_and_members): ... here.
2250         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2251         * init.c (build_delete): Likewise.
2252         * parser.c (cp_parser_lookup_name): Likewise.
2253         * pt.c (check_explicit_specialization): Likewise.
2254         * rtti.c (emit_support_tinfos): Likewise.
2255         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2257         Kill IDENTIFIER_TEMPLATE.
2258         * cp-tree.h (lang_identifier): Remove class_template_info field.
2259         (IDENTIFIER_TEMPLATE): Delete.
2260         * name-lookup.c (constructor_name_full): Subsume into ...
2261         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
2262         (constructor_name_p): Likewise.
2263         * mangle.c (write_source_name): Likewise.
2264         * ptree.c (cxx_print_identifier): Likewise.
2266 2017-06-27  Marek Polacek  <polacek@redhat.com>
2268         PR bootstrap/81216
2269         * parser.c (cp_parser_already_scoped_statement): Initialize
2270         LOC_AFTER_LABELS.
2272 2017-06-26  Jason Merrill  <jason@redhat.com>
2274         PR c++/81215 - deduction failure with variadic TTP.
2275         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2277 2017-06-26  Martin Sebor  <msebor@redhat.com>
2279         PR c++/81169
2280         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2281         to detect casting away cv-qualifiers.
2283 2017-06-26  Nathan Sidwell  <nathan@acm.org>
2285         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2286         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2287         identifier.
2288         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2289         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2290         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2291         * decl.c (grok_op_properties): Adjust identifier checking.
2292         * init.c (expand_default_init): Adjust identifier descision.
2293         * method.c (implicitly_declare_fn): Don't use
2294         DECL_ASSIGNMENT_OPERATOR_P.
2295         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2296         IDENTIFIER_DTOR_P.
2297         * call.c (in_charge_arg_for_name): Reimplement.
2298         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2299         IDENTIFIER_DTOR_P.
2301 2017-06-26  Marek Polacek  <polacek@redhat.com>
2303         PR c/80116
2304         * parser.c (cp_parser_statement): Add a default argument.  Save the
2305         location of the expression-statement after labels have been parsed.
2306         (cp_parser_implicitly_scoped_statement): Set the location of the
2307         body of the conditional after parsing all the labels.  Call
2308         warn_for_multistatement_macros.
2309         (cp_parser_already_scoped_statement): Likewise.
2311 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
2313         PR c++/62315
2314         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2315         'typename' in error messages about missing 'typename'.
2317 2017-06-23  Jason Merrill  <jason@redhat.com>
2319         PR c++/79056 - C++17 ICE with invalid template syntax.
2320         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2321         is a TYPE_DECL.
2322         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2323         * pt.c (template_placeholder_p): New.
2324         * cp-tree.h: Declare it.
2326 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
2328         * decl.c (duplicate_decls): Use builtin_structptr_types.
2330 2017-06-22  Nathan Sidwell  <nathan@acm.org>
2332         Reorder IDENTIFIER flags
2333         gcc/cp/
2334         * cp-tree.h (enum cp_identifier_kind): New.
2335         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2336         IDENTIFIER_KIND_BIT_2): New.
2337         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2338         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2339         (C_IS_RESERVED_WORD): Replace with ...
2340         (IDENTIFIER_KEYWORD_P): ... this.
2341         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2342         (IDENTIFIER_CDTOR_P): ... this.
2343         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2344         (IDENTIFIER_OPNAME_P): Replace with ...
2345         (IDENTIFIER_ANY_OP_P): ... this.
2346         (IDENTIFIER_ASSIGN_OP_P): New.
2347         (IDENTIFIER_TYPENAME_P): Replace with ...
2348         (IDENTIFIER_CONV_OP_P): ... this.
2349         (NEW_DELETE_OPNAME_P): Replace with ...
2350         (IDENTIFIER_NEWDEL_OP_P): ... this.
2351         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2352         (get_identifier_kind_name, set_identifier_kind): Declare.
2353         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2354         (init_operators): Adjust to avoid keywords, use
2355         set_identifier_kind. Copy TYPE_EXPR slot.
2356         (init_reswords): Call set_identifier_kind.
2357         (unqualified_name_lookup_error): Adjust.
2358         * operators.def (TYPE_EXPR): Remove.
2359         * decl.c (struct predefined_identifier): Move into ...
2360         (initialize_predefined_identifiers): ... here.  Call
2361         set_identifier_kind.
2362         (grokfndecl, check_var_type, grokdeclarator): Adjust.
2363         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2364         space.  Adjust.
2365         * call.c (name_as_c_string): Adjust.
2366         (build_new_method_call_1): Likewise.
2367         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2368         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2369         * dump.c (cp_dump_tree): Adjust.
2370         * error.c (dump_decl_name): Adjust.
2371         * mangle.c (write_unqualified_id, write_member_name,
2372         write_expression): Adjust.
2373         (mangle_conv_op_name_for_type): Use set_identifier_kind.
2374         * name-lookup.c (do_class_using_decl): Adjust.
2375         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2376         * parser.c (cp_lexer_get_preprocessor_token,
2377         cp_parser_direct_declarator): Likewise.
2378         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2379         tsubst_copy, tsubst_copy_and_build): Adjust.
2380         * ptree.c (cxx_print_identifier): Print identifier kind.
2381         * search.c (lookup_field_r, lookup_member,
2382         lookup_fnfields_idx_nolazy): Adjust.
2383         * semantics.c (finish_id_expression): Adjust..
2384         * typeck.c (cp_build_addr_expr_1): Adjust.
2386 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
2388         PR c++/81154
2389         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2390         Complain about t not being a variable if t is OVERLOAD even
2391         when processing_template_decl.
2393 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
2395         * parser.c (get_cast_suggestion): New function.
2396         (maybe_add_cast_fixit): New function.
2397         (cp_parser_cast_expression): Capture the location of the closing
2398         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
2399         about old-style casts.
2401 2017-06-20  Jason Merrill  <jason@redhat.com>
2403         PR c++/80972 - C++17 ICE with attribute packed.
2404         * call.c (build_over_call): Allow a TARGET_EXPR from reference
2405         binding.
2407 2017-06-20  Nathan Sidwell  <nathan@acm.org>
2409         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2410         (nelts_identifier): Delete.
2411         * decl.c (initialize_predefined_identifiers): Remove nelts.
2413         PR c++/67074 - namespace aliases
2414         * decl.c (duplicate_decls): Don't error here on mismatched
2415         namespace alias.
2416         * name-lookup.c (name_lookup::add_value): Matching namespaces are
2417         not ambiguous.
2418         (diagnose_name_conflict): Namespaces are never redeclarations.
2419         (update_binding): An alias can match a real namespace.
2421 2017-06-19  Jason Merrill  <jason@redhat.com>
2423         PR c++/80562 - ICE with constexpr if.
2424         * semantics.c (finish_if_stmt_cond): Call
2425         instantiate_non_dependent_expr.
2427         PR c++/80829 - ICE with constexpr copy of base subobject.
2428         * constexpr.c (clear_no_implicit_zero): New.
2429         (cxx_eval_call_expression): Call it.
2431 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2433         PR c++/81124
2434         PR c++/79766
2435         * name-lookup.c (set_decl_namespace): Don't follow using
2436         directives and ignore using decls.  Only check overly-explicit
2437         scope after discovering decl.
2439 2017-06-19  Jason Merrill  <jason@redhat.com>
2441         PR c++/81073 - constexpr and static var in statement-expression.
2442         * typeck2.c (store_init_value): Always call
2443         require_potential_constant_expression.
2444         * pt.c (convert_nontype_argument): Likewise.
2445         * constexpr.c (potential_constant_expression_1): Adjust message.
2446         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2447         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2449 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2451         * pt.c (coerce_template_parms): Fix indentation.
2452         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
2453         in to single block.
2455         PR c++/81119
2456         * name-lookup.c (update_binding): Only warn about constructors
2457         hidden by functions.
2459 2017-06-17  Jason Merrill  <jason@redhat.com>
2461         PR c++/60063 - -Wunused-local-typedefs and templates.
2462         * decl2.c (is_late_template_attribute): Return false for "used".
2464         PR c++/70844 - -Wuseless-cast and inheriting constructor.
2465         * method.c (forward_parm): Suppress warn_useless_cast.
2467 2017-06-16  Jason Merrill  <jason@redhat.com>
2469         PR c++/81045 - Wrong type-dependence with auto return type.
2470         * pt.c (type_dependent_expression_p): An undeduced auto outside the
2471         template isn't dependent.
2472         * call.c (build_over_call): Instantiate undeduced auto even in a
2473         template.
2475         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2476         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2477         set longer for a generic lambda.
2479         PR c++/80614 - Wrong mangling for C++17 noexcept type
2480         * mangle.c (write_type): Put the eh spec back on the function type.
2482         PR c++/81102 - Wrong error with partial specialization.
2483         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2484         types.  Do type deduction later.
2486         PR c++/81074 - ICE with partial specialization of member template.
2487         PR c++/71747
2488         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2490         PR c++/80831 - ICE with -fsyntax-only.
2491         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2493         PR c++/80639 - ICE with invalid PMF initialization.
2494         PR c++/80043 - ICE with -fpermissive
2495         * typeck.c (convert_for_assignment): Recurse when instantiate_type
2496         returns without an error.
2498 2017-06-16  Nathan Sidwell  <nathan@acm.org>
2500         * pt.c (tsubst_baselink): Fix & clarify formatting.
2502         * cp-tree.h (build_this_parm, cp_build_parm_decl,
2503         build_artificial_parm): Add FN parm.
2504         * decl.c (start_cleanup_fn): Adjust.
2505         (build_this_parm): Add FN parm, pass it through.
2506         (grokfndecl): Adjust parm building.
2507         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2508         (build_artificial_parm): Add FN parm, pass through.
2509         (maybe_retrofit_in_chrg): Adjust parm building.
2510         (start_static_storage_duration_function): Likwise.
2511         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2512         * method.c (implicitly_declare_fn): Likewise.
2513         * parser.c (inject_this_parameter): Likewise.
2515         Symbol tables are insert only.
2516         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2517         derive from pointer_hash.  Make undeletable.
2519         * class.c (resort_type_method_vec): Avoid potential unsigned
2520         overflow.
2522         Don't defer noexcept_deferred_spec.
2523         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2524         * decl.c (cxx_init_decl_processing): Initialize
2525         noexcept_deferred_spec.
2526         * except.c (unevaluated_noexcept_spec): Delete.
2527         * class.c (deduce_noexcept_on_destructor): Use
2528         noexcept_deferred_spec directly.
2529         * method.c (implicitly_declare_fn): Likewise.
2531         Make keyed_classes a vector.
2532         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2533         (keyed_classes): Declare as vector.
2534         * decl.c (keyed_classes): Define.
2535         (cxx_init_decl_processing): Allocate it.
2536         (record_key_method_defined): Use vec_safe_push.
2537         * class.c (finish_struct_1): Likewise.
2538         * pt.c (instantiate_class_template_1): Likewise.
2539         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2541         Make rtti lazier
2542         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2543         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
2544         (tinfo_names): New.
2545         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
2546         (get_tinfo_decl): Use get_tinfo_desc.
2547         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2548         (create_pseudo_type_info): Delete.
2549         (get_pseudo_ti_index): Just determine the index.
2550         (get_tinfo_desc): New.  Create all types lazily.
2551         (create_tinfo_types): Just allocate the descriptor array.
2552         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
2553         location.
2555 2017-06-15  Martin Sebor  <msebor@redhat.com>
2557         PR c++/80560
2558         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2559         functions.
2560         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2561         (build_cxx_call): Call maybe_warn_class_memaccess.
2563 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
2565         * cp-gimplify.c (cp_genericize_r): Turn most of the function
2566         into a switch (TREE_CODE (stmt)) statement from long else if
2567         sequence.
2569 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
2571         PR c++/80973
2572         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2573         argument even if it has REFERENCE_TYPE.
2575         PR c++/80984
2576         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2577         BLOCK_VARS (outer) chain.
2578         (cxx_omp_const_qual_no_mutable): Likewise.
2580 2017-06-13  Martin Liska  <mliska@suse.cz>
2582         PR sanitize/78204
2583         * class.c (build_base_path): Use sanitize_flags_p.
2584         * cp-gimplify.c (cp_genericize_r): Likewise.
2585         (cp_genericize_tree): Likewise.
2586         (cp_genericize): Likewise.
2587         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2588         * decl.c (compute_array_index_type): Likewise.
2589         (start_preparsed_function): Likewise.
2590         * decl2.c (one_static_initialization_or_destruction): Likewise.
2591         * init.c (finish_length_check): Likewise.
2592         * lambda.c (maybe_add_lambda_conv_op): Likewise.
2593         * typeck.c (cp_build_binary_op): Likewise.
2594         (build_static_cast_1): Likewise.
2596 2017-06-11  Jason Merrill  <jason@redhat.com>
2598         * error.c (dump_expr): Use is_this_parameter.
2600         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2601         id_equal.
2603 2017-06-09  Jason Merrill  <jason@redhat.com>
2605         Missing bits from N4268, constant evaluation for all non-type args.
2606         * call.c (build_converted_constant_expr): Rename from
2607         build_integral_nontype_arg_conv, handle all types.
2608         * pt.c (convert_nontype_argument): In C++17 call it for all types.
2609         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2610         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2612         Overhaul pointer-to-member conversion and template argument handling.
2613         * call.c (standard_conversion): Avoid creating ck_pmem when the
2614         class type is the same.
2615         * cvt.c (can_convert_qual): Split from
2616         perform_qualification_conversions.
2617         * constexpr.c (cxx_eval_constant_expression): Check it.
2618         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2619         adjustment is necessary.
2620         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2621         (convert_nontype_argument): Avoid redundant error.
2623         * call.c (convert_like_real): Remove "inner" parameter.
2624         Don't replace a constant with its value.
2625         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2627         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2628         nullptr_node.
2630         * parser.c (cp_parser_constant_expression): Check
2631         potential_rvalue_constant_expression after decay_conversion.
2632         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2634         PR c++/80384 - ICE with dependent noexcept-specifier
2635         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2636         noexcept-specifier.
2638         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2640 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
2642         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2643         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2644         (excpet.c): Mark terminate as cold.
2646 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
2648         PR c/81006
2649         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2650         to sizetype before size_binop.
2652         PR c++/81011
2653         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2654         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2655         and OMP_CLAUSE_SHARED_READONLY flags.
2657 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
2659         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2661 2017-06-07  Nathan Sidwell  <nathan@acm.org>
2663         * class.c (layout_class_type): Restructure overlong-bitfield tpe
2664         search.
2666 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
2668         PR c++/80990
2669         * pt.c (do_class_deduction): Build qualified type.
2671 2017-06-06  Nathan Sidwell  <nathan@acm.org>
2673         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2674         sans using directives.  Don't walk into inline namespaces.
2676         PR c++/80979
2677         * name-lookup.c (adl_class_only): Don't add visible friends.
2679 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
2681         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2683 2017-06-02  Nathan Sidwell  <nathan@acm.org>
2685         Remove lang_type_ptrmem.
2686         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2687         into ...
2688         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
2689         (lang_type): ... this.  Delete old definition.
2690         (lang_type_ptrmem): Delete.
2691         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
2692         (LANG_TYPE_PTRMEM_CHECK): Delete.
2693         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2694         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
2695         * decl.c (build_ptrmemfunc_type): Adjust.
2696         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2697         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2698         
2699         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2700         setting.
2701         
2702         Remove cp_binding_level::namespaces
2703         * name-lookup.h (cp_binding_level): Lose namespaces field.
2704         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2705         list.
2706         (suggest_alternatives_for): Adjust for namespace list.  Do
2707         breadth-first search.
2708         * decl2.c (collect_source_refs): Namespaces are on the regulr
2709         list.
2710         (collect_ada_namespace): Likewise.
2712 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2714         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2715         warning.
2717 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
2719         PR c++/80812
2720         * method.c (constructible_expr): Strip array types before calling
2721         build_value_init.
2723 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
2725         PR c++/80896
2726         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2727         for case INDIRECT_REF too in the main switch.
2729 2017-05-31  Jason Merrill  <jason@redhat.com>
2731         PR c++/80840 - ICE with constexpr and reference
2732         * pt.c (convert_nontype_argument): Don't test whether a decl is
2733         value-dependent when binding to a reference.
2735 2017-05-31  Nathan Sidwell  <nathan@acm.org>
2737         * cp-tree.h (lang_decl_slector): New enum.
2738         (lang_decl_base): Make selector an enum.  Drop decomposition_p
2739         field.
2740         (lang_decl): Use enum for discrimination.
2741         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2742         LANG_DECL_DEOMP_CHECK): Use enum.
2743         (DECL_DECOMPOSITION_P): Use selector value.
2744         (SET_DECL_DECOMPOSITION_P): Delete.
2745         (retrofit_lang_decl): Lose SEL parm.
2746         (fit_decomposition_lang_decl): Declare.
2747         * decl.c (cp_finish_decomp, grokdeclarator): Use
2748         fit_decomposition_lang_decl.
2749         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2750         retrofit_lang_decl.
2751         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
2752         (fit_decomposition_lang_decl): Likewise.
2753         (retrofit_lang_decl): Use worker functions.
2754         (cxx_dup_lang_specific_decl): Use selector enum.
2755         (maybe_add_lang_type_raw): New.  Broken out of ...
2756         (cxx_make_type_name): ... here.  Call it.
2758 2017-05-30  Jason Merrill  <jason@redhat.com>
2760         PR c++/80856 - ICE with local extern in template
2761         * semantics.c (finish_call_expr): Replace a local extern overload
2762         set in a template with the IDENTIFIER_NODE.
2764 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
2766         * call.c (perform_implicit_conversion_flags): Convert
2767         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2768         (print_conversion_rejection): Replace pairs of %qT with
2769         %qH and %qI in various places.
2770         (build_user_type_conversion_1): Likewise.
2771         (build_integral_nontype_arg_conv): Likewise.
2772         (build_conditional_expr_1): Likewise.
2773         (convert_like_real): Likewise.
2774         (convert_arg_to_ellipsis): Likewise.
2775         (joust): Likewise.
2776         (initialize_reference): Likewise.
2777         * cvt.c (cp_convert_to_pointer): Likewise.
2778         (cp_convert_to_pointer): Likewise.
2779         (convert_to_reference): Likewise.
2780         (ocp_convert): Likewise.
2781         * error.c (cp_printer): Gain bool and const char ** parameters.
2782         (struct deferred_printed_type): New struct.
2783         (class cxx_format_postprocessor): New class.
2784         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2785         to pp->m_format_postprocessor.
2786         (comparable_template_types_p): New function.
2787         (newline_and_indent): New function.
2788         (arg_to_string): New function.
2789         (print_nonequal_arg): New function.
2790         (print_template_differences): New function.
2791         (type_to_string_with_compare): New function.
2792         (print_template_tree_comparison): New function.
2793         (append_formatted_chunk): New function.
2794         (add_quotes): New function.
2795         (cxx_format_postprocessor::handle): New function.
2796         (defer_phase_2_of_type_diff): New function.
2797         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
2798         %H and %I.
2799         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2800         %qH and %qI in various places.
2801         (convert_member_func_to_ptr): Likewise.
2802         (build_reinterpret_cast_1): Likewise.
2803         (convert_for_assignment): Likewise.
2804         * typeck2.c (check_narrowing): Likewise.
2806 2017-05-30  Nathan Sidwell  <nathan@acm.org>
2808         Kill IDENTIFIER_NAMESPACE_BINDINGS
2809         * cp-tree.h (lang_identifier): Delete namespace_bindings.
2810         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2811         (lang_decl_ns): Add bindings.
2812         (DECL_NAMESPACE_BINDINGS): New.
2813         * lex.c (retrofit_lang_decl): Create namespace hash table.
2814         * name-lookup.c (find_namespace_slot): Change to use hash-map.
2815         * ptree.c (cxx_print_binding): Delete.
2816         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2818         * cp-tree.def (OVERLOAD): Fix comment.
2819         * cp-tree.h: Fix comments and whitespace.
2820         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2821         * name-lookup.c (add_decl_to_level): Assert not class.
2822         (check_local_shadow): Use OVL_P.
2823         (pushdecl_with_scope_1): Rename to ...
2824         (do_pushdecl_with_Scope): ... here.
2825         (do_nonmember_using_decl): Use qualified_namespace_lookup return
2826         value.
2827         (push_class_level_binding_1): Use OVL_P.
2828         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2829         (pushtag_1): Rename to ...
2830         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
2831         (pushtag): Adjust.
2832         (store_class_bindings): Do not time here.
2833         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2834         * pt.c (listify): Declare argvec at point of initialization.
2836         PR c++/80913
2837         * name-lookup.c (add_decl_to_level): Assert not making a circular
2838         chain.
2839         (update_binding): Don't prematurely slide artificial decl.
2841 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
2843         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2845 2017-05-29  Nathan Sidwell  <nathan@acm.org>
2847         PR c++/80891 (#1,#5)
2848         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2849         * name-lookup.c (name_lookup): Add deduping field.
2850         (name_lookup::preserve_state, name_lookup::restore_state): Deal
2851         with deduping.
2852         (name_lookup::add_overload): New.
2853         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2854         (name_lookup::search_adl): Set deduping.  Don't unmark here.
2855         * pt.c (most_specialized_instantiation): Revert previous change,
2856         Assert not given duplicates.
2857         * tree.c (lookup_mark): Just mark the underlying decls.
2858         (lookup_maybe_add): Dedup using marked decls.
2860         PR c++/80891 (#4)
2861         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2862         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2864         Stat hack representation
2865         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2866         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2867         (stat_hack): New.
2868         (find_namespace_binding): Replace with ...
2869         (find_namespace_slot): ... this.
2870         (find_namespace_value): New.
2871         (name_lookup::search_namespace_only,
2872         name_lookup::adl_namespace_only): Adjust.
2873         (update_binding): Add SLOT parameter, adjust.
2874         (check_local_shadow): Use find_namespace_value.
2875         (set_local_extern_decl_linkage): Likewise.
2876         (do_pushdecl): Adjust for namespace slot.
2877         (push_local_binding): Assert not a namespace binding.
2878         (check_for_out_of_scope_variable): Use find_namespace_value.
2879         (set_identifier_type_value_with_scope): Likewise.
2880         (get_namespace_binding): Likewise.
2881         (set_namespace_binding): Delete.
2882         (set_global_binding): Directly update the binding.
2883         (finish_namespace_using_decl): Likewise.
2884         (lookup_type_scope_1): Use find_namespace_slot and update.
2885         (do_push_nested_namespace): Use find_namespace_value.
2887         PR c++/80891 (#1)
2888         * pt.c (most_specialized_instantiation): Cope with duplicate
2889         instantiations.
2891         PR c++/80891 (#3)
2892         * cp-tree.h (build_min_nt_call_vec): Declare.
2893         * decl.c (build_offset_ref_call_from_tree): Call it.
2894         * parser.c (cp_parser_postfix_expression): Likewise.
2895         * pt.c (tsubst_copy_and_build): Likewise.
2896         * semantics.c (finish_call_expr): Likewise.
2897         * tree.c (build_min_nt_loc): Keep unresolved lookups.
2898         (build_min): Likewise.
2899         (build_min_non_dep): Likewise.
2900         (build_min_non_dep_call_vec): Likewise.
2901         (build_min_nt_call_vec): New.
2903         PR c++/80891 (#2)
2904         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
2905         (ovl_used): New.
2906         (lookup_keep): Call it.
2908 2017-05-26  Nathan Sidwell  <nathan@acm.org>
2910         Implement DR2061
2911         * name-lookup.c (push_inline_namespaces): New.
2912         (push_namespace): Look inside inline namespaces.
2914         Inline and using namespace representation change.
2915         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
2916         inlinees as vector.
2917         (DECL_NAMESPACE_USING): Adjust.
2918         (DECL_NAMESPACE_INLINEES): New.
2919         * name-lookup.h (struct cp_binding_level): Change usings
2920         representation.
2921         * name-lookup.c (name_lookup::do_queue_usings,
2922         name_lookup::queue_usings): Adjust.
2923         (name_lookup::search_namespace, name_lookup::search_usings,
2924         name_lookup::queue_namespace): Adjust.
2925         (name_lookup::adl_namespace_only): Adjust.
2926         (add_using_namespace, push_namespace): Push onto vector.
2927         (pop_namespace): Add timing logic.
2929         * call.c (build_operator_new_call): Do namelookup and ADL here.
2930         (build_new_op_1): Likewise.
2931         * name-lookup.h (lookup_function_nonclass): Delete declaration.
2932         (do_using_directive): Likewise.
2933         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
2934         declare early.
2935         (struct scope_binding): Delete.
2936         (EMPTY_SCOPE_BINDING): Delete.
2937         (set_decl_namespace): Use OVL_P.
2938         (finish_local_using_decl): Lose unnecesary checks.
2939         (lookup_function_nonclass): Delete.
2940         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
2942         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
2943         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
2944         unduplicatable.
2945         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
2946         (lkp_iterator): Add outer field.  Adjust ctor.
2947         (lkp_iterator::operator++): New.
2948         (lookup_mark, lookup_maybe_add): Declare.
2949         * name-lookup.c (name_lookup): Delete fn_set member.
2950         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
2951         and mark lookup.
2952         (name_lookup::add_value): Use lookup_add directly.
2953         (name_lookup::add_fns: Use lookup_maybe_add.
2954         (name_lookup::search_adl): Mark and unmark fns.
2955         (pushdecl): Adjust.
2956         * pt.c (check_explicit_specialization): Use lookup_add directly.
2957         * ptree.c (cxx_print_xnode): Show complete overload structure.
2958         * tree.c (lookup_mark, lookup_maybe_add): New.
2960         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
2962 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
2964         * cp-tree.h (struct lang_decl_decomp): New type.
2965         (struct lang_decl): Add u.decomp.
2966         (LANG_DECL_DECOMP_CHECK): Define.
2967         (DECL_DECOMPOSITION_P): Note it is set also on the vars
2968         for user identifiers.
2969         (DECL_DECOMP_BASE): Define.
2970         (retrofit_lang_decl): Add extra int = 0 argument.
2971         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
2972         use it to influence the selector choices and for selector
2973         0 to non-zero transition copy old content.
2974         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
2975         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
2976         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
2977         wording if decl is a structured binding.
2978         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
2979         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
2980         of individual variables for tuple structured bindings.
2981         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
2982         Clear DECL_DECOMP_BASE.
2983         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
2984         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
2985         is expected.
2986         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
2987         DECL_VALUE_EXPR.
2989 2017-05-25  Jason Merrill  <jason@redhat.com>
2991         PR c++/80605 - __is_standard_layout and zero-length array
2992         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
2994 2017-05-25  Nathan Sidwell  <nathan@acm.org>
2996         Kill OVL_CURRENT, OVL_NEXT.
2997         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
2998         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
2999         (consider_binding_level): Use OVL_FIRST.
3000         (cp_emit_debug_info_for_using): Use lkp_iterator.
3001         * pt.c (check_explicit_specialization): Use ovl_iterator.       
3003         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3004         * cp-tree.h (lang_decl_ns): Remove ns_users field.
3005         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3006         (TREE_INDIRECT_USING): Delete.
3007         * name-lookup.h (is_associated_namespace): Delete.
3008         * name-lookup.c (name_lookup::search_usings,
3009         name_lookup::do_queue_usings): Usings are always direct.
3010         (is_associated_namespace): Delete.
3011         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3012         (namespace_ancestor_1, namespace_ancestor): Delete.
3013         (push_using_directive_1, push_using_directive): Delete.
3014         (add_using_namespace_1): Delete.
3015         (add_using_namespace): Reimplement.
3016         (emit_debug_info_using_namespace): New.
3017         (finish_namespace_using_directive, finish_local_using_directive,
3018         push_namespace): Adjust.
3019         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3021 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
3023         * semantics.c (finish_handler_parms): Warn about non-reference type
3024         catch handlers.
3026 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3028         Reimplement unqualified namespace lookup.
3029         * name-lookup.c (name_lookup::using_pair,
3030         name_lookup::using_queue): New typedefs.
3031         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3032         name_lookup::queue_usings): New.
3033         (name_lookup::search_unqualified): New.
3034         (merge_functions, same_entity_p, ambiguous_decl,
3035         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3036         lookup_using_namespace): Delete.
3037         (lookup_name_real_1): Adjust.
3039         Reimplement qualified namespace lookup.
3040         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
3041         (name_lookup::ambiguous, name_lookup::add_value,
3042         name_lookup::add_type, name_lookup::process_binding): New.
3043         (name_lookup::search_namespace_only,
3044         name_lookup::search_namespace, name_lookup::search_usings): New.
3045         (name_lookup::search_qualified): New.
3046         (do_nonmember_using_decl, suggest_alternatives_for,
3047         lookup_qualified_name): Adjust.
3048         (tree_vec_contains): Delete.
3049         (qualified_lookup_using_namespace): Rename to ...
3050         (qualified_namespace_lookup): ... here.  Reimplement.
3052         Reimplement ADL.
3053         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3054         * name-lookup.h (lookup_arg_dependent): Return plain tree.
3055         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3056         arg_assoc_args_vec, arg_assoc_type, add_function,
3057         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3058         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3059         lookup_arg_dependent_1): Delete.
3060         (name_lookup): New lookup object.
3061         (name_lookup::preserve_state, name_lookup::restore_state,
3062         name_lookup::mark_seen, name_lookup::find_and_mark,
3063         name_lookup::add_fns, name_lookup::adl_namespace_only,
3064         name_lookup::adl_namespace, name_lookup::adl_class_only,
3065         name_lookup::adl_bases, name_lookup::adl_class,
3066         name_lookup::adl_expr, name_lookup::adl_type,
3067         name_lookup::adl_template_arg, name_lookup::search_adl): New.
3068         (lookup_arg_dependent): Return a plain tree.  Adjust.
3069         (is_associated_namespace): Move later.
3070         
3071 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3073         * friend.c (do_friend): Remove check for existing decl.
3074         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3075         * name-lookup.c (push_local_binding): Directly look for binding.
3076         (lookup_name_innermost_nonclass_level_1): Delete.
3077         (lookup_name_innermost_nonclass_level): Delete.
3079         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3081         * cp-tree.h (cp_free_lang_data): Add extern.
3082         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3083         ATTRIBUTE_PURE.
3084         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3085         * typeck.c (type_unknown_p): Delete.
3086         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3087         overload management.
3088         (dependent_name): Likewise.
3089         (decl_anon_ns_mem_p): Simplify.
3091 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
3093         PR c++/80544
3094         * tree.c (reshape_init): Use unqualified type for direct enum init.
3095         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3096         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3097         non-class destination types.
3098         (build_const_cast_1): Strip cv-quals from destination types.
3099         (build_static_cast, build_reinterpret_cast, build_const_cast)
3100         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3102 2017-05-24  Martin Sebor  <msebor@redhat.com>
3104         PR c/80731
3105         * call.c (fully_fold_internal): Adjust.
3107 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3109         * cp-tree.h (ovl_skip_hidden): Declare.
3110         * tree.c (ovl_skip_hidden): New.
3111         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3112         (lookup_arg_dependent_1): Likewise.
3113         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3114         (hidden_name_p, remove_hidden_names): Delete.
3115         (lookup_name_real_1): Do not strip hidden names.
3116         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3118         * cp-tree.h (OVL_HIDDEN_P): New.
3119         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3120         (ovl_iterator::reveal_node): Declare.
3121         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3122         (ovl_insert): Order on hiddenness.
3123         (ovl_iterator::reveal_node): New.
3124         * name-lookup.c (anticipated_builtin_p): New.
3125         (supplement_binding_1): Use it.
3126         (set_local_extern_decl_linkage): Use hidden_p.
3127         (do_pushdecl): Deal with unhiding a hidden decl, use
3128         anticipated_builtin_p.
3129         (do_nonmember_using_decl): Use anticipated_decl_p.
3130         (lookup_name_real_1): Use DECL_HIDDEN_P.
3132 2017-05-23  Jason Merrill  <jason@redhat.com>
3134         -Wunused and C++17 structured bindings
3135         * decl.c (poplevel): Don't warn about unused structured bindings,
3136         only real variables.
3137         * error.c (dump_simple_decl): Handle structured bindings.
3138         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3140 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3142         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3143         * name-lookup.c (create_local_binding): New.
3144         (update_binding): New.
3145         (pushdecl_maybe_friend_1): Rename to ...
3146         (do_pushdecl): ... this.  Reimplement.
3147         (pushdecl): Adjust.
3148         (push_overloaded_decl_1, push_overloaded_decl): Delete.
3150 2017-05-23  Jason Merrill  <jason@redhat.com>
3152         PR c++/80396 - built-in for make_integer_sequence.
3153         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3154         (expand_integer_pack, expand_builtin_pack_call): New.
3155         (find_parameter_packs_r): Check builtin_pack_call_p.
3156         (check_for_bare_parameter_packs): Handle it.
3157         (tsubst_pack_expansion): Call expand_builtin_pack_call.
3158         (declare_integer_pack): New.
3159         (init_template_processing): Call it.
3160         * decl2.c (mark_used): Check builtin_pack_fn_p.
3162 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3164         * name-lookup.c (find_namespace_binding): New.
3165         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3166         (set_identifier_type_value_with_scope): Use find_namespace_binding.
3167         (find_binding, cp_binding_level_find_binding_for_name,
3168         binding_for_name, namespace_binding_1): Delete.
3169         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3170         (get_namespace_binding, set_namespace_binding,
3171         finish_namespace_using_decl, unqualified_namespace_lookup_1,
3172         qualified_lookup_using_namespace, lookup_type_scope_1,
3173         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3175         PR c++/80866
3176         * parser.c (cp_parser_template_id): Keep the lookup when stashing
3177         the template_id.
3179         * cp-tree.h (DECL_HIDDEN_P): New.
3180         * name-lookup.c (set_decl_context,
3181         set_local_extern_decl_linkage): New, broken out of ...
3182         (pushdecl_maybe_friend_1): ... here.  Call them.
3184 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
3186         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3187         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3188         "VECTOR_LENGTH".
3190 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3192         * cp-tree.h (OVL_P): New.
3193         * name-lookup.h (push_local_binding): Delete.
3194         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3195         (finish_namespace_using_decl, finish_local_using_decl): ... here
3196         * name-lookup.c (add_decl_to_level): Swap args.
3197         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3198         (diagnose_name_conflict): Check contexts are same for redecl.
3199         (update_local_overload): New.
3200         (compparms_for_decl_and_using): Rename to ...
3201         (matching_fn_p): ... here.
3202         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3203         push_local_bindings call.
3204         (push_local_binding): Make static, replace FLAGS arg with
3205         IS_USING.
3206         (validate_nonmember_using_decl): Use OVL_FIRST.
3207         (do_nonmember_using_decl): Use in/out parameters.  Use
3208         lkp_iterator and simplify.
3209         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3210         (finish_namespace_using_decl, finish_local_using_decl): ... here.
3211         Adjust.
3212         (lookup_type_current_level): Delete.
3213         * parser.c (cp_parser_using_declaration): Adjust.
3214         * pt.c (tsubst_expr): Adjust.
3216 2017-05-22  Nathan Sidwell  <nathan@acm.org>
3218         * name-lookup.h (parse_using_directive): Replace with ...
3219         (finish_namespace_using_directive): ... this and ...
3220         (finish_local_using_directive): ... this.
3221         * name-lookup.c (add_using_namespace_1): Move later.
3222         (add_using_namespace): Move later, add namespace_p arg, remove
3223         indirect arg.
3224         (push_using_directive_1): Directly recurse.
3225         (do_using_directive, parse_using_directive): Delete, split into ...
3226         (finish_namespace_using_directive): ... this and ...
3227         (finish_local_using_directive): ... this.
3228         (push_namespace): Use add_using_namespace.
3229         * parser.c (cp_parser_using_directive): Call
3230         finish_namespace_using_directive or finish_local_using_directive.
3231         * pt.c (tsubst_expr): Call finish_local_using_directive.
3233         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3234         * cp-tree.h (raw_dump_id): Declare.
3235         * decl2.c (raw_dump_id): Define.
3236         (dump_tu): Use raw_dump_id.
3238         * config-lang.in (gtfiles): Sort list, break lines.
3240         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3241         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3242         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3243         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3244         CPTI_RETHROW_FN): New.
3245         (noexcept_deferred_spec): New.
3246         (terminate_node, call_unexpected_node): Rename to ...
3247         (terminate_fn, call_unexpected_fn): ... here.
3248         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3249         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3250         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3251         (init_exception_processing): Adjust.
3252         (declare_library_fn): Create and push the fns here.
3253         (do_get_exception_ptr, do_begin_catch, do_end_catch,
3254         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3255         declare_library_fn use.
3256         (unevaluated_noexcept_spec): Adjust.
3257         * cp-gimplify.c (genericize_eh_spec_block,
3258         gimplify_most_not_throw_expr): Adjust.
3260         * name-lookup.c (pushdecl_top_level,
3261         pushdecl_top_level_and_finish): Move after namespace pushing and
3262         popping functions.
3263         (push_to_top_level): Rename to ...
3264         (do_push_to_top_level): ... here.  Remove timing code.
3265         (pop_from_top_level_1): Rename to ...
3266         (do_pop_from_top_level): ... here.
3267         (do_push_nested_namespace, do_pop_nested_namespace)
3268         (push_to_top_level): New wrapper for do_push_to_top_level.
3269         (pop_from_top_level): Adjust.
3270         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3272 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3274         * config-lang.in (gtfiles): Add c-family/c-format.c,
3275         except.c, init.c, lambda.c and friend.c.
3276         * class.c (dvirt_fn): Move out of function scope,
3277         add GTY attribute.
3278         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3279         * init.c (fn): Likewise.
3280         * lambda.c (ptr_id, max_id): Likewise.
3281         * friend.c (global_friend): Add GTY attribute.
3283 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3285         * call.c (add_list_candidates): Use OVL_FIRST.
3286         (build_new_method_call_1): Likewise.
3287         * cp-tree.h (OVL_SINGLE_P): New.
3288         (TYPE_HIDDEN_P): New.
3289         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3290         * dump.c (cp_tump_tree): Adjust overload dumping.
3291         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3292         printing.
3293         * method.c (lazily_declare_fn): Assert we added it.
3294         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3295         OVL_FIRST.
3296         (cp_parser_template_name): Use lkp_iterator.
3297         * pt.c (begin_template_parm_list): Fixup comment.
3298         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3299         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3300         (ovl_scope): Use lkp_iterator.
3302 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
3304         * parser.c (cp_parser_omp_clause_default): Handle
3305         "OMP_CLAUSE_DEFAULT_PRESENT".
3307         * parser.c (cp_parser_omp_clause_default): Avoid printing more
3308         than one syntax error message.
3310 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3312         * class.c (class_dump_id): Define.
3313         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3314         * cp-objcp-common.c (cp_register_dumps): New.
3315         * cp-objcp-common.h (cp_register_dumps): Declare.
3316         (LANG_HOOKS_REGISTER_DUMPS): Override.
3317         * cp-tree.h (class_dump_id): Declare.
3319 2017-05-18  Nathan Sidwell  <nathan@acm.org>
3321         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3322         (OVL_USED_P): New.
3323         (lookup_keep): Declare.
3324         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3325         * pt.c (tsubst_copy): Assert lookup is persistent.
3326         * semantics.c (finish_call_expr): Use lkp_iterator, call
3327         lookup_keep.
3328         * tree.c (ovl_copy): New.
3329         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3330         (lookup_keep): New.
3332         * cp-tree.h (OVL_USED): Replace with ...
3333         (OVL_USING_P): ... this.
3334         (ovl_iterator::using_p): Adjust.
3335         * name-lookup.c (push_overloaded_decl_1,
3336         do_nonmember_using_decl): Adjust.
3337         * search.c (lookup_field_r): Adjust.
3338         * tree.c (ovl_insert, ovl_scope): Adjust.
3340         * cp-tree.h (lookup_add): Swap args.
3341         (ovl_cons, build_overload): Delete.
3342         * name-lookup.c (add_function, push_overloaded_decl_1,
3343         do_nonmember_using_decl, merge_functions, remove_hidden_names):
3344         Use lookup_add, ovl_insert.
3345         * pt.c (check_explicit_specialization): Use lookup_add.
3346         (do_class_deduction): Likewise. Refactor if.
3347         * tree.c (lookup_add): Swap args.
3348         (ovl_cons, build_overload): Delete.
3350         * name-lookup.c (find_local_binding): New, broken out of ...
3351         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
3352         (set_namespace_binding): Swap scope & name args.
3353         (namespace_binding_1): Likewise.
3354         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3355         (push_overloaded_decl_1): Likewise.
3356         (set_global_binding): Likewise.
3357         (get_namespace_binding): Adjust namespace_binding_1 call.
3359 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3361         * cp-tree.h (default_hash_traits <lang_identifier *>): New
3362         specialization.
3363         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3364         (extern_c_fns): New hash table.
3365         (check_extern_c_conflict): New, broken out of ...
3366         (pushdecl_maybe_friend_1): ... here.  Call it.
3367         (c_linkage_bindings): Just look in hash table.
3369 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
3371         PR c++/80654
3372         PR c++/80682
3373         Implement new C++ intrinsics __is_assignable and __is_constructible.
3374         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3375         (is_xible): New.
3376         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3377         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3378         * method.c (constructible_expr): Set cp_unevaluated.
3379         (is_xible_helper): New.
3380         (is_trivially_xible): Adjust.
3381         (is_xible): New.
3382         * parser.c (cp_parser_primary_expression): Handle
3383         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3384         (cp_parser_trait_expr): Likewise.
3385         * semantics.c (trait_expr_value): Handle
3386         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3388 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3390         * cp-tree.h (ovl_iterator::using_p): New predicate.
3391         (ovl_iterator::remove_node): New worker.
3392         (ovl_insert): Declare.
3393         * tree.c (ovl_insert): New.
3394         (ovl_iterator::remove_node): New.
3395         * class.c (add_method): Use ovl_iterator, ovl_insert.
3396         (clone_function_decl): Fix description.
3397         (clone_constructors_and_destructors): Use ovl_iterator.
3399         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3400         (maybe_warn_about_overly_private_class): Use ovl_iterator.
3401         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3402         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3403         (get_base_fndecls): Use ovl_iterator.
3404         (warn_hidden): Use OVL_NAME, ovl_iterator.
3405         (add_implicitly_declared_members): Use ovl_iterator.
3406         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3407         flatten nested if.
3408         (finish_shorthand_constraint): Simplify, use ovl_make.
3409         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
3410         * search.c (shared_member_p): Use ovl_iterator.
3411         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3412         (lookup_conversion_operator): Use OVL_FIRST.
3413         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3414         (look_for_overrides_here): Use ovl_iterator.
3415         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3416         * typeck.c (build_x_unary_op): Use ovl_make.
3418 2017-05-17  Martin Liska  <mliska@suse.cz>
3420         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3421         use it instead of int type.
3422         (dump_vtable): Likewise.
3423         (dump_vtt): Likewise.
3424         * decl2.c (dump_tu): Likewise.
3426 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
3428         * call.c (enforce_access): Add access_failure_info * param and use
3429         it to record access failures.
3430         * cp-tree.h (class access_failure_info): New class.
3431         (enforce_access): Add access_failure_info * param, defaulting to
3432         NULL.
3433         (lookup_member): Likewise.
3434         (locate_field_accessor): New function decl.
3435         (perform_or_defer_access_check): Add access_failure_info * param,
3436         defaulting to NULL.
3437         * search.c (lookup_member): Add access_failure_info * param and
3438         pass it on to call to perform_or_defer_access_check.
3439         (matches_code_and_type_p): New function.
3440         (field_access_p): New function.
3441         (direct_accessor_p): New function.
3442         (reference_accessor_p): New function.
3443         (field_accessor_p): New function.
3444         (struct locate_field_data): New struct.
3445         (dfs_locate_field_accessor_pre): New function.
3446         (locate_field_accessor): New function.
3447         * semantics.c (perform_or_defer_access_check): Add
3448         access_failure_info * param, and pass it on to call to
3449         enforce_access.
3450         * typeck.c (access_failure_info::record_access_failure): New method.
3451         (access_failure_info::maybe_suggest_accessor): New method.
3452         (finish_class_member_access_expr): Pass an access_failure_info
3453         instance to the lookup_member call, and call its
3454         maybe_suggest_accessor method afterwards.
3456 2017-05-16  Marek Polacek  <polacek@redhat.com>
3458         PR sanitizer/80536
3459         PR sanitizer/80386
3460         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3462 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3464         * name-lookup.c (check_local_shadow): New, broke out of ...
3465         (pushdecl_maybe_friend_1): ... here.  Call it.
3467         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3468         (ovl_first): Move inline definition to end of file.
3469         (ovl_make, lookup_add): Declare.
3470         (get_fns, get_first_fn): Make pure.
3471         * tree.c (ovl_cache): New.
3472         (ovl_make, lookup_add): New.
3473         * pt.c (do_class_deduction): Don't add candidates that will be
3474         elided.
3476         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3477         (print_error_for_call_failure): Use OVL_NAME.
3478         (build_op_call_1): Use ovl_iterator.
3479         (add_candidates): Use OVL_FIRST & lkp_iterator.
3480         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3481         lkp_iterator.
3482         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3483         (type_has_user_nondefault_constructor,
3484         in_class_defaulted_default_constructor,
3485         type_has_user_provided_constructor,
3486         type_has_user_provided_or_explicit_constructor,
3487         type_has_non_user_provided_default_constructor,
3488         vbase_has_user_provided_move_assign,
3489         type_has_move_constructor, type_has_move_assign,
3490         type_has_user_declared_move_constructor,
3491         type_has_user_declared_move_assign,
3492         type_build_ctor_call, type_build_dtor_call,
3493         type_requires_array_cookie, explain_non_literal_class): Likewise.
3494         (finish_struct): Use lkp_iterator.
3495         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3496         (note_name_declared_in_class): Use OVL_NAME.
3497         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3498         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3499         cxx_pretty_printer::expression): Likewise.
3500         * decl2.c (check_classfn): Use ovl_iterator.
3501         * pt.c (retrieve_specialization): Use ovl_iterator.
3502         * tree.c (cp_tree_equal): Use lkp_iterator.
3503         (type_has_nontrivial_copy_init): Use ovl_iterator.
3505         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3506         check is_overloaded_fn.
3508 2017-05-16  Martin Liska  <mliska@suse.cz>
3510         * parser.c (cp_lexer_print_token): Add default value for flags
3511         argument of print_gimple_stmt, print_gimple_expr,
3512         print_generic_stmt and print_generic_expr.
3514 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3516         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3517         iterators.
3518         (MAYBE_BASELINK_FUNCTIONS): New.
3519         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3520         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3521         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3522         * method.c (inherited_ctor_binfo): Use ovl_iterator.
3523         (binfo_inherited_from): Likewise.
3524         * parser.c (lookup_literal_operator): Use lkp_iterator.
3525         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3526         (print_candidates_1): Likewise.
3527         (determine_specialization): Likewise.
3528         (resolve_overloaded_unification): Likewise.
3529         (resolve_nondeduced_context): Likewise.
3530         (type_dependent_expression_p): Likewise.
3531         (dependent_template_p): Likewise.
3532         * ptree.c (cxx_print_xnode): Likewise.
3533         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3534         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3535         * typeck.c (check_template_keyword): Use lkp_iterator.
3537         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3538         (ovl_first): New.
3539         * constexpr.c (function_concept_check): Use OVL_FIRST.
3540         * cvt.c (build_expr_type_conversion): Likewise.
3541         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3542         * decl2.c (mark_used): Use OVL_FIRST.
3543         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3544         (dump_expr, location_of): Use OVL_FIRST.
3545         * friend.c (do_friend): Use OVL_NAME.
3546         * init.c (build_offset_ref): Use OVL_FIRST.
3547         * mangle.c (write_member_name): Likewise.
3548         (write_expression): Use OVL_NAME.
3549         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3550         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3551         * pt.c (check_explicit_specialization): Use OVL_FIRST.
3552         (check_template_shadow): Likewise.
3553         (tsubst_template_args): Use OVL_NAME.
3554         (tsubst_baselink): Use OVL_FIRST.
3555         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3556         * tree.c (get_first_fn): Use OVL_FIRST.
3557         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3558         (cp_build_addr_expr_1): Use OVL_FIRST.
3560         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3561         peeking.
3562         * semantics.c (finish_id_expression): Directly init local var.
3563         (finish_omp_reduction_clause): Use really_overloaded_fn.
3564         * tree.c (get_fns): Document.  Assert we got an overload.
3565         (get_first_fn) Document.
3566         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3567         really_overloaded_fn.
3568         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3570         * cp-tree.h (SCOPE_DEPTH): New.
3571         * name-lookup.h (is_nested_namespace): Declare.
3572         * name-lookup.c (is_nested_namespace): New.
3573         (is_ancestor): Use it.
3574         (set_decl_namespace): Likewise.
3575         (push_namespace): Set SCOPE_DEPTH.
3576         * pt.c (check_specialization_namespace): Use is_nested_namespace.
3577         (check_unqualigied_spec_or_inst): Likewise.
3579 2017-05-15  Nathan Sidwell  <nathan@acm.org>
3581         PR c++/79369
3582         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3583         * name-lookup.h (push_namespace): Return int, add make_inline arg.
3584         * name-lookup.c (push_namespace): Deal with inline directly.
3585         Return pushed count.
3586         * parser.c (cp_parser_namespace_definition): Adjust for
3587         push_namespace change.
3589 2017-05-11  Nathan Sidwell  <nathan@acm.org>
3591         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3592         LANG_HOOKS_PUSHDECL): Move to ...
3593         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3594         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3595         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3597         * name-lookup.h (pushdecl): Add default friend parm.
3598         (pushdecl_maybe_friend): Delete.
3599         (pushdecl_top_level): Add default friend parm.
3600         (pushdecl_top_level_maybe_friend): Delete.
3601         * name-lookup.c (pushdecl_maybe_friend): Delete.
3602         (pushdecl): Add is_friend parm.
3603         (pushdecl_top_level): Add is friend_parm.
3604         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3605         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3606         * friend.c (do_friend): Adjust.
3607         * pt.c (tsubst_friend_class): Adjust.
3609         Revert pushdecl_top_level_and_finish name change.
3610         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3611         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3612         * decl.c (cp_make_fname_decl): Adjust.
3613         * decl2.c (get_guard, handle_tls_init):  Adjust.
3614         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
3616         * name-lookup.c (pushdecl_outermost_localscope): Always
3617         conditionally stop timer.
3619         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3620         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3622         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3623         pushtag_top_level_maybe_friend,
3624         pushdecl_top_level_and_finish): Move declarations to ...
3625         * name-lookup.h: ... here.  Group pushdecl variants.
3626         (pushdecl_top_level_and_finish): Rename to ...
3627         (pushdecl_top_level_with_init): ... here.
3628         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3629         * decl2.c (get_guard, handle_tls_init): Likewise.
3630         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3631         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3632         * method.c (implicitly_declare_fn): Likewise.
3633         * searchc (node_debug_info_needed): Likewise.
3634         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3635         (pushdecl_top_level_with_init): ... here.
3636         (pop_everything): Use namespace_bindings_p.
3638         * name-lookup.h (pop_binding): Rename to pop_local_binding.
3639         (getdecls): Rename to get_local_decls.
3640         * name-lookup.c (pop_binding): Rename to ...
3641         (pop_local_binding): ... here.
3642         (pop_bindings_and_leave_scope): Adjust.
3643         (getdecls): Rename to ...
3644         (get_local_decls): ... here.  Assert local scope.
3645         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
3646         logic.
3647         (store_parm_decls): Adjust get_local_decls call.
3648         (parser.c (synthesize_implicit_template_parm): Likewise.
3650 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
3652         PR c++/80682
3653         * method.c (is_trivially_xible): Reject void types.
3655 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3657         * class.c (handle_using_decl): Always use OVL_CURRENT.
3658         (resolve_address_of_overloaded_function): Move iterator decl into
3659         for scope.  Don't strip anticipated decls here.
3661         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3662         printing.
3663         (print_candidates): Adjust.
3665         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
3666         line breaking.
3667         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
3668         koenig_p handling here.
3669         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3670         (tsubst_omp_clauses): Likewise.
3671         (do_class_deduction): Adjust buld_new_function_call calls.
3672         * semantics.c (finish_call_expr): Likewise.
3674 2017-05-10  Jason Merrill  <jason@redhat.com>
3676         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3677         (unify_type_mismatch, unify_parameter_pack_mismatch)
3678         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3679         (unify_parameter_pack_inconsistent, unify_inconsistency)
3680         (unify_vla_arg, unify_method_type_error, unify_arity)
3681         (unify_arg_conversion, unify_no_common_base)
3682         (unify_inconsistent_template_template_parameters)
3683         (unify_template_deduction_failure)
3684         (unify_template_argument_mismatch)
3685         (unify_overload_resolution_failure): Call unify_invalid.
3687         CWG 1847 - Clarifying compatibility during partial ordering
3688         * pt.c (more_specialized_fn): No order between two non-deducible
3689         parameters.
3691         * pt.c (dependent_type_p): Make sure we aren't called with
3692         global_type_node.
3694         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3695         * pt.c (convert_template_argument): Just return an argument pack.
3696         (coerce_template_parameter_pack, template_parm_to_arg)
3697         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3698         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3699         Don't set the type of a NONTYPE_ARGUMENT_PACK.
3700         * parser.c (make_char_string_pack, make_string_pack): Likewise.
3702 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3704         * cp-tree.h (add_method, clone_function_decl): Change last arg to
3705         bool.
3706         * class.c (add_method): Change third arg to bool.  Adjust.
3707         (one_inheriting_sig, one_inherited_ctor): Adjust.
3708         (clone_function_decl): Change 2nd arg to bool.  Adjust.
3709         (clone_constructors_and_destructors): Adjust.
3710         * lambda.c (maybe_add_lambda_conv_op): Adjust.
3711         * method.c (lazily_declare_fn): Adjust.
3712         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3713         * semantics.c (finish_member_declaration): Adjust.
3715 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
3717         PR c++/80145
3718         * decl.c (finish_function): To improve error recovery, change the
3719         logic for calling apply_deduced_return_type.
3721 2017-05-09  Jason Merrill  <jason@redhat.com>
3723         PR c++/80605 - __is_standard_layout and empty base
3724         * class.c (check_bases): Ignore empty bases.
3726         PR c++/70979 - literal class and closure types
3727         * class.c (finalize_literal_type_property): Handle closures
3728         specifically.
3729         (explain_non_literal_class): Likewise.
3731         PR c++/66297, DR 1684 - literal class and constexpr member fns
3732         * constexpr.c (is_valid_constexpr_fn): Only complain about
3733         non-literal enclosing class in C++11.
3734         * class.c (finalize_literal_type_property): Likewise.
3736 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
3738         PR c++/80186
3739         * pt.c (tsubst_decl): Early return error_mark_node if
3740         grok_ctor_properties returns false.
3742 2017-05-09  Jason Merrill  <jason@redhat.com>
3744         PR c++/70167 - array prvalue treated as lvalue
3745         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3746         (enum fcl_t): New.
3747         * semantics.c (finish_compound_literal): Add fcl_context parameter.
3748         Only make a static variable for C99 syntax.
3749         * parser.c (cp_parser_postfix_expression): Pass it.
3750         * pt.c (tsubst_copy_and_build): Likewise.
3751         * call.c (extend_ref_init_temps): Set
3752         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3754 2017-05-09  Nathan Sidwell  <nathan@acm.org>
3756         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3757         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3758         * name-lookup.h (pushdecl_top_level): Declare.
3760 2017-05-08  Jason Merrill  <jason@redhat.com>
3762         PR c++/80178 - parameter passing for uncopyable classes
3763         * tree.c (type_has_nontrivial_copy_init): True for classes with only
3764         deleted copy/move ctors.
3765         (remember_deleted_copy, maybe_warn_parm_abi): New.
3766         * decl.c (require_complete_types_for_parms, check_function_type):
3767         Call maybe_warn_parm_abi.
3768         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3770 2017-05-08  Nathan Sidwell  <nathan@acm.org>
3772         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3773         (start_preparsed_function): Do decl pushing before setting
3774         current_funciton_decl and announcing it.
3776         * name-lookup.h (pushdecl_with_scope): Replace with ...
3777         (pushdecl_outermost_localscope): ... this.
3778         * name-lookup.c (pushdecl_with_scope): Replace with ...
3779         (pushdecl_outermost_localscope): ... this.
3780         (pushdecl_namespace_level): Adjust.
3781         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3782         * lambda.c (insert_capture_proxy): Likewise.
3784         * class.c (build_vtbl_initializer): Don't shadow outer variable
3785         with static var.
3787         Revert _binding -> _value change.
3788         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3789         (get_namespace_binding, set_global_binding): ... these.
3790         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3791         (get_namespace_binding, set_global_binding): ... these.
3792         (arg_assoc_namespace, pushdecl_maybe_friend_1,
3793         check_for_out_of_scope_variable, push_overloaded_decl_1,
3794         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3795         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3796         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3797         * decl.c (poplevel): Adjust.
3798         * pt.c (make_constrained_auto): Likewise.
3800 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
3802         PR translation/80280
3803         * call.c (print_z_candidate): Fix quoting.
3805 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
3807         * error.c (pedwarn_cxx98): Replace report_diagnostic
3808         with diagnostic_report_diagnostic.
3810 2017-05-05  Nathan Sidwell  <nathan@acm.org>
3812         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3813         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3814         (IDENTIFIER_NAMESPACE_VALUE): Delete.
3815         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3816         with ...
3817         (get_namespace_value, set_global_value): ... these.
3818         (get_global_value_if_present, is_typename_at_global_scope): Delete.
3819         * decl.c (poplevel): Use get_namespace_value.
3820         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3821         * class.c (build_vtbl_initializer): Stash library decl in
3822         static var. Use IDENTIFIER_GLOBAL_VALUE.
3823         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3824         do_allocate_exception, do_free_exception, build_throw): Likewise.
3825         * init.c (throw_bad_array_new_length): Likewise.
3826         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3827         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3828         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3829         get_namespace_value.
3830         (set_namespace_binding_1): Rename to
3831         (set_namespace_binding): ... here.
3832         (set_global_value): New.
3833         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3834         get_namespace_value.
3835         * pt.c (listify): Use get_namespace_value.
3837         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3838         current scope.
3839         * lex.c (unqualified_name_lookup_error): Likewise.
3841         * class.c (alter_class): Use retrofit_lang_decl directly.
3842         * decl.c (push_local_name, dupliate_decls): Likewise.
3843         * semantics.c (omp_privatize_field): Likewise.
3845         Kill walk_namespaces.
3846         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3847         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3849         Kill per-namespace static_decls.
3850         * cp-tree.h (static_decls): Declare.
3851         (wrapup_globals_for_namespace,
3852         diagnose_inline_vars_for_namespace): Replace with ...
3853         (wrapup_namespace_globals): ... this.
3854         * decl.c (static_decls): Define.
3855         (wrapup_globals_for_namespace,
3856         diagnose_inline_vars_for_namespace): Replace with ...
3857         (wrapup_namespace_globals): ... this.
3858         (cxx_init_decl_processing): Initialize static_decls.
3859         * decl2.c (c_parse_final_cleanups): Adjust.
3860         * name-lookup.h (cp_binding_level): Remove static_decls member.
3861         * name-lookup.c (add_decl_to_level): Adjust.
3862         (begin_scope): Adjust.
3864 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
3866         PR c++/71577
3867         * decl.c (reshape_init): Unconditionally return error_mark_node
3868         upon error about too many initializers.
3870 2017-05-04  Nathan Sidwell  <nathan@acm.org>
3872         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
3874 2017-05-04  Martin Sebor  <msebor@redhat.com>
3876         PR translation/80280
3877         * call.c (print_z_candidate): Add missing quoting to %D and other
3878         like directives.
3879         (build_op_call_1): Same.
3880         * constraint.cc (diagnose_check_constraint): Same.
3881         * mangle.c (mangle_decl): Same.
3882         * name-lookup.c (cp_binding_level_debug): Same.
3883         (set_decl_namespace): Same.
3884         * parser.c (cp_parser_tx_qualifier_opt): Same.
3885         * pt.c (print_candidates_1): Same.
3886         (check_template_variable): Same.
3887         (tsubst_default_argument): Same.
3888         (most_specialized_partial_spec): Same.
3889         * semantics.c (omp_reduction_lookup): Same.
3890         * tree.c (check_abi_tag_redeclaration): Same.
3891         * typeck.c (comptypes): Same.
3892         * typeck2.c (abstract_virtuals_error_sfinae): Same.
3894 2017-05-04  Nathan Sidwell  <nathan@acm.org>
3896         More global trees.
3897         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
3898         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
3899         CPTI_INIT_LIST_IDENTIFIER.
3900         (global_namespace, global_type_node, global_identifier,
3901         anon_identifier, init_list_identifier): New.
3902         * decl.c (global_type_node, global_scope_name): Delete.
3903         (initialize_predefined_identifiers): Add new identifiers.
3904         (cxx_init_decl_processing): Adjust.
3905         * name-lookup.h (global_namespace, global_type_node): Delete.
3906         * name-lookup.c (global_namespace, anonymous_namespace_name,
3907         get_anonymous_namespace_name): Delete.
3908         (namespace_scope_ht_size, begin_scope, pushtag_1,
3909         push_namespace): Adjust,
3910         * call.c (type_has_extended_temps): Use init_list_identifier.
3911         * pt.c (listify): Likewise.
3913         * name-lookup.c: Reorder functions to make merging from modules
3914         branch simpler.
3916 2017-05-03  Jason Merrill  <jason@redhat.com>
3918         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
3920 2017-05-03  Nathan Sidwell  <nathan@acm.org>
3922         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
3923         along with #defines, to before name-lookup include.
3925 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
3927         * pt.c (is_auto_or_concept): Remove.
3928         (type_uses_auto_or_concept): Remove, unused.
3929         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
3930         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
3931         * cp-tree.h (is_auto_or_concept): Remove.
3933 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
3935         PR c++/80038
3936         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
3937         add pedigree operation and detach call here.
3938         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
3939         cilk_cp_gimplify_call_params_in_spawned_fn.
3940         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
3941         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
3943 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
3945         * parser.c (cp_parser_member_declaration): Add fix-it hints for
3946         stray comma and missing semicolon at end of member declaration.
3948 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
3950         * parser.c (cp_parser_cast_expression): Add target type of cast to
3951         diagnostic.
3952         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
3954 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
3956         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
3957         return type to bool.
3958         * cp-tree.h (grok_ctor_properties): Update.
3960 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
3962         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
3963         information to diagnostic of invalid colon in nested-name-specifier.
3965 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
3967         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
3968         diagnostic of invalid class/struct keyword after enum.
3970 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3972         * parser.c (cp_parser_member_declaration): Add fix-it hint
3973         for removing stray semicolons.
3975 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3977         * name-lookup.c (get_std_name_hint): New function.
3978         (maybe_suggest_missing_header): New function.
3979         (suggest_alternative_in_explicit_scope): Call
3980         maybe_suggest_missing_header.
3982 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
3984         PR c++/80177
3985         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
3986         candidate type of bm from tree to const char *.
3987         (consider_binding_level): Likewise.
3988         (lookup_name_fuzzy): Likewise, using this to merge the best
3989         result from the preprocessor into bm, rather than immediately
3990         returning, so that better matches from reserved words can "win".
3991         Guard the rejection of keywords that don't start decl-specifiers
3992         so it only happens for FUZZY_LOOKUP_TYPENAME.
3994 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
3996         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
3997         (start_enum): Likewise.
3998         (build_enumerator): Likewise. Use %qE instead of plain %E.
3999         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4000         %<%D%> in diagnostics.
4001         (cp_parser_elaborated_type_specifier): Likewise.
4002         * pt.c (make_pack_expansion): Use %qT and %qE instead of
4003         %<%T%> and %<%E%> in diagnostics.
4004         (tsubst_pack_expansion): Likewise.
4006 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
4008         PR c++/80016
4009         * parser.c (cp_parser_unary_expression):  Generate a location
4010         range for alignof and sizeof expressions.
4012 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4014         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4015         error message.
4016         (cp_parser_virt_specifier_seq_opt): Likewise.
4017         (set_and_check_decl_spec_loc): Likewise twice.
4019 2017-04-21  Jason Merrill  <jason@redhat.com>
4021         PR c++/80179 - ICE with initialized flexible array member.
4022         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4024 2017-04-21  Richard Biener  <rguenther@suse.de>
4026         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4027         (copy_type): Likewise.
4028         * lex.c (copy_decl): Pass down mem-stat info.
4029         (copy_type): Likewise.
4031 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
4033         PR c++/80473
4034         * init.c (build_new_1): Suppress notes about over-aligned new when
4035         the warning is suppressed.
4037 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
4039         * parser.c (cp_parser_member_declaration): Add warning with fixit
4040         information for extra semicolon after in-class function definition.
4042 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
4044         PR middle-end/80423
4045         * tree.c (build_cplus_array_type): Call build_array_type
4046         with the intended TYPE_TYPELESS_STORAGE flag value, instead
4047         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4048         on the shared type.
4050 2017-04-18  Marek Polacek  <polacek@redhat.com>
4052         PR c++/80244 - ICE with attribute in template alias.
4053         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4055         PR c++/80241 - ICE with alignas pack expansion.
4056         * error.c (dump_expr): Handle TREE_LIST.
4057         * parser.c (cp_parser_std_attribute_list): Return error_mark if
4058         make_pack_expansion returns an error.
4060 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
4062         PR c++/80287
4063         * class.c (fixup_may_alias): Fix all type variants.
4065 2017-04-17  Jason Merrill  <jason@redhat.com>
4067         PR c++/80415 - wrong error with default arg and array reference.
4068         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4070         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4072 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
4074         * decl.c (name_unnamed_type): Split out of...
4075         (grokdeclarator): ... this.
4076         * decl.h (name_unnamed_type): Declare.
4078 2017-04-12  Richard Biener  <rguenther@suse.de>
4079         Bernd Edlinger  <bernd.edlinger@hotmail.de>
4081         PR middle-end/79671
4082         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4083         for arrays of character or std::byte type.
4085 2017-04-11  Jason Merrill  <jason@redhat.com>
4087         PR c++/80294 - ICE with constexpr and inheritance.
4088         * constexpr.c (reduced_constant_expression_p):
4089         A null constructor element is non-constant.
4090         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4091         returning an empty base.
4093 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4095         PR c++/80370
4096         * decl.c (cp_finish_decomp): If processing_template_decl on
4097         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4098         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
4099         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4100         processing.
4101         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4102         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4103         dependent.
4105 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4107         PR c++/80363
4108         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4110 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
4112         PR c++/80176
4113         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4114         operand, if it is a static member function, recurse on the
4115         BASELINK.
4117 2017-04-10  Marek Polacek  <polacek@redhat.com>
4119         PR sanitizer/80348
4120         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
4121         ORIG_TYPE earlier and not only when shortening.
4123 2017-04-07  Jason Merrill  <jason@redhat.com>
4125         PR c++/80356 - ICE with reference to function template argument.
4126         PR c++/79294
4127         * pt.c (convert_nontype_argument_function): Adjust type even with a
4128         value-dependent argument.
4130         PR c++/80267 - ICE with nested capture of reference
4131         PR c++/60992
4132         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4134 2017-04-07  Marek Polacek  <polacek@redhat.com>
4136         PR sanitizer/80348
4137         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4139         PR c++/80095
4140         * call.c (build_over_call): Don't check cxx_dialect.
4141         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4142         whether SUB is a CONSTRUCTOR.
4143         * init.c (build_new_1): Don't check cxx_dialect.
4144         * tree.c (replace_placeholders): Add a function comment.  Return if
4145         not in C++14, or if the object isn't a (member of a) class.
4146         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4147         TYPE is CLASS_TYPE_P.
4149 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
4151         PR c++/80309
4152         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4153         of a loop doing vec_safe_push of NULL.  Formatting fixes.
4154         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4155         to newidx before calling canonical_type_parameter on newtype.
4157 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
4159         PR c++/80296
4160         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4161         UNARY_PLUS_EXPR case.
4163 2017-04-03  Jason Merrill  <jason@redhat.com>
4165         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4167 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
4169         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4170         * decl2.c (one_static_initialization_or_destruction): Likewise.
4171         * name-lookup.c (store_bindings): Likewise.
4172         * parser.c (make_call_declarator): Likewise.
4173         * pt.c (check_explicit_specialization): Likewise.
4175 2017-04-03  Jason Merrill  <jason@redhat.com>
4177         PR sanitizer/79993 - ICE with VLA initialization from string
4178         PR c++/69487 - wrong VLA initialization from string
4179         * init.c (finish_length_check): Split out from build_vec_init.
4180         (build_vec_init): Handle STRING_CST.
4181         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4182         (digest_init_r): Don't give a STRING_CST VLA type.
4184 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
4186         PR c++/79572
4187         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4188         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
4189         for NOP_EXPR to REFERENCE_TYPE.
4191         PR libstdc++/80251
4192         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4193         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4194         CPTK_IS_AGGREGATE.
4195         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4196         Remove extraneous parens.
4197         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4198         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4199         (cp_parser_trait_expr): Likewise.
4201 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
4203         PR middle-end/80162
4204         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4205         * typeck.c (cxx_mark_addressable): Likewise.  Look through
4206         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4207         to ARRAY_TYPE.
4208         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4210 2017-03-24  Jason Merrill  <jason@redhat.com>
4212         PR c++/77339 - ICE with invalid use of alias template.
4213         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4214         alias template.
4216 2017-03-24  Marek Polacek  <polacek@redhat.com>
4218         PR c++/80119
4219         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4220         doesn't have side effects.
4222 2017-03-23  Jason Merrill  <jason@redhat.com>
4224         PR c++/80150 - ICE with overloaded variadic deduction.
4225         * pt.c (try_one_overload): Remove asserts.
4227         PR c++/77563 - missing ambiguous conversion error.
4228         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4230 2017-03-23  Marek Polacek  <polacek@redhat.com>
4232         * cp-tree.h: Remove a C_RID_YYCODE reference.
4234 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
4236         PR c++/80141
4237         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4238         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4239         processing_template_decl.
4241 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
4243         PR c++/77752
4244         * name-lookup.c (pushtag_1): Add check for bogus, non template,
4245         std::initializer_list.
4247 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
4249         PR c++/35878
4250         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4252 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
4254         PR c++/35878
4255         * init.c (std_placement_new_fn_p): New.
4256         (build_new_1): Call it.
4258 2017-03-20  Jason Merrill  <jason@redhat.com>
4260         PR c++/80096 - ICE with C++17 non-type auto.
4261         * pt.c (tsubst): Delay tsubst of type of template non-type
4262         parameter.
4264         PR c++/79519 - ICE with deleted template friend.
4265         * decl.c (grokdeclarator): Complain about misplaced function
4266         definition using =, as well.
4268         PR c++/79640 - infinite recursion with generic lambda.
4269         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4270         before substituting its initializer.
4272 2017-03-20  Marek Polacek  <polacek@redhat.com>
4273             Paolo Carlini  <paolo.carlini@oracle.com>
4275         PR c++/80059 - ICE with noexcept and __transaction_atomic
4276         * except.c (build_must_not_throw_expr): Call
4277         instantiate_non_dependent_expr.
4279 2017-03-19  Jason Merrill  <jason@redhat.com>
4281         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4282         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4283         reference decomposition.
4285         PR c++/80077 - error with constexpr and -fno-elide-constructors.
4286         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4287         expanding trivial constructor.
4289 2017-03-17  Jason Merrill  <jason@redhat.com>
4291         PR c++/78345 - ICE initializing array from lambda.
4292         * init.c (build_aggr_init): Check array initializer.
4293         (build_vec_init): Check the type of a CONSTRUCTOR.
4295         PR c++/80073 - C++17 ICE with virtual base.
4296         * decl.c (xref_basetypes): Also check for indirect vbases.
4298 2017-03-16  Jason Merrill  <jason@redhat.com>
4300         * decl.c (start_enum): std::byte aliases anything.
4302         PR c++/79797
4303         * constexpr.c (lookup_placeholder): Tweak.
4305 2017-03-15  Jason Merrill  <jason@redhat.com>
4307         PR c++/80043 - ICE with -fpermissive
4308         * typeck.c (convert_for_assignment): Handle instantiate_type
4309         not giving an error.
4311 2017-03-14  Nathan Sidwell  <nathan@acm.org>
4313         PR c++/79393 DR 1658 workaround
4314         * method.c (synthesized_method_base_walk): Inihibit abstract class
4315         virtual base access check here.
4316         (synthesized_method_walk): Not here.
4318 2017-03-13  Nathan Sidwell  <nathan@acm.org>
4320         PR c++/79393 DR 1658 workaround
4321         * method.c (synthesized_method_walk): Check vbases of abstract
4322         classes for dtor walk.
4324 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
4326         PR translation/79848
4327         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4329 2017-03-10  Jason Merrill  <jason@redhat.com>
4331         PR c++/79960 - alias templates and partial ordering
4332         * pt.c (comp_template_args): Add partial_order parm.
4333         (template_args_equal): Likewise.
4334         (comp_template_args_porder): New.
4335         (get_partial_spec_bindings): Use it.
4337 2017-03-10  Marek Polacek  <polacek@redhat.com>
4339         PR c++/79967
4340         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4342 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
4344         PR c++/79899
4345         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4346         Use XALLOCAVEC macro.
4348         PR c++/79896
4349         * decl.c (finish_enum_value_list): If value is error_mark_node,
4350         don't copy it and change its type.
4351         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4352         of CONST_DECL is error_mark_node.
4354 2017-03-09  Marek Polacek  <polacek@redhat.com>
4356         PR c++/79900 - ICE in strip_typedefs
4357         * tree.c (strip_typedefs): Skip the attribute handling if T is
4358         a variant type which hasn't been updated yet.
4360         PR c++/79687 - wrong code with pointer-to-member
4361         * init.c (constant_value_1): Break if the variable has a dynamic
4362         initializer.
4364 2017-03-08  Jason Merrill  <jason@redhat.com>
4366         PR c++/79797 - ICE with self-reference in array DMI.
4367         * constexpr.c (lookup_placeholder): Split out...
4368         (cxx_eval_constant_expression): ...from here.
4370 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
4372         PR c/79834
4373         * parser.c (cp_parser_omp_cancellation_point,
4374         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4375         cp_parser_omp_target_update): Change "may only be used in compound
4376         statements" diagnostics, such that the same translatable string is
4377         used for all pragmas.
4378         (cp_parser_pragma): Likewise.  Use error_at instead of
4379         cp_parser_error for that diagnostics.
4381 2017-03-06  Marek Polacek  <polacek@redhat.com>
4383         PR c++/79796 - ICE with NSDMI and this pointer
4384         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4385         replace_placeholders.
4387 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
4389         PR c++/79822
4390         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4391         ({ (void) 0; }).
4393 2017-03-06  Jason Merrill  <jason@redhat.com>
4395         Revert "Allow deduction guides to look into primary template."
4396         * cp-tree.h, parser.c, pt.c, search.c: Revert.
4398 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
4400         PR c++/70266
4401         * except.c (build_must_not_throw_expr): Perform the implicit
4402         conversions on the condition.
4404 2017-03-03  Jason Merrill  <jason@redhat.com>
4406         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4407         -Wc++1z-compat.
4409         Core issues 2273 and 2277
4410         * call.c (joust): Adjust using-declaration tiebreaker to handle
4411         the intermediate base case.
4412         * method.c (strip_inheriting_ctors): Just return the argument if
4413         !flag_new_inheriting_ctors.
4415 2017-03-03  Richard Biener  <rguenther@suse.de>
4417         PR c++/79825
4418         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4420 2017-03-03  Marek Polacek  <polacek@redhat.com>
4422         PR c++/79791
4423         * typeck.c (string_conv_p): In C++11, always call pedwarn with
4424         OPT_Wwrite_strings.
4426 2017-03-02  Jason Merrill  <jason@redhat.com>
4428         Update overload resolution with deduction guides.
4429         * pt.c (do_class_deduction): Always build the copy guide.
4430         (copy_guide_p, template_guide_p): New.
4431         (build_deduction_guide): Remember the original constructor.
4432         * call.c (joust): Prefer the copy guide and non-template guides.
4434         Allow deduction guides to look into primary template.
4435         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4436         (struct cp_decl_specifier_seq): Add constructor_p.
4437         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4438         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
4439         Clear deduction_guide_type.  Don't handle deduction guide names.
4440         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4441         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
4442         (cp_parser_member_declaration, cp_parser_cache_defarg)
4443         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4444         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4445         (build_deduction_guide): Set deduction_guide_type.
4446         (dependent_scope_p): Check deduction_guide_type.
4447         * search.c (lookup_member): Likewise.
4449 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
4451         PR c++/79782
4452         * init.c (mark_exp_read_r): New function.
4453         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4454         whole arguments instead of plain mark_exp_read on TREE_LIST values.
4456 2017-03-01  Jason Merrill  <jason@redhat.com>
4458         Class template argument deduction in new-expression
4459         * init.c (build_new): Handle deduction from no initializer.
4460         * parser.c (cp_parser_new_expression): Don't require a single
4461         expression for class template deduction.
4462         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4463         class template placeholder.
4464         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4465         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4466         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4468 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
4470         PR c++/79746
4471         * init.c (emit_mem_initializers): When not constructing vbases of
4472         abstract classes, mark arguments as read for
4473         -Wunused-but-set-parameter.
4475 2017-02-28  Jason Merrill  <jason@redhat.com>
4477         Class template argument deduction refinements
4478         * call.c (joust): Move deduction guide tiebreaker down.
4479         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4480         deduction with no initializer.
4481         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4482         (do_class_deduction): Use that rather than special case.
4483         (do_auto_deduction): Handle null initializer.
4485 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
4487         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4488         instead of just cond ? "..." : "...".
4489         (grokdeclarator): Likewise.
4490         (build_enumerator): Likewise.
4491         * init.c (build_new_1): Likewise.
4492         * call.c (build_new_method_call_1): Likewise.
4493         * parser.c: Include intl.h.
4494         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4495         "enter"/"exit" keyword.
4496         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4497         message.
4499 2017-02-27  Jason Merrill  <jason@redhat.com>
4501         PR c++/71568 - SFINAE forming pointer to member function
4502         * init.c (build_offset_ref): Check the return value of
4503         perform_or_defer_access_check.
4505 2017-02-27  Marek Polacek  <polacek@redhat.com>
4507         * decl.c (expand_static_init): Add missing } in a comment.
4509 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
4511         * init.c: Include intl.h.
4512         (build_new_1): Move message strings into pedwarn to make them
4513         -Wformat-security friendly. Mark string for translation.
4514         * pt.c (tsubst_copy_and_build): Mark string for translation.
4515         Make the pointer const.
4516         * semantics.c (finish_id_expression): Mark strings for translation.
4518 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
4520         * call.c (build_op_delete_call): Make msg1 and msg2 const.
4522 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
4524         PR c++/79588
4525         * call.c (build_over_call): Call check_function_arguments even for
4526         -Wrestrict, adjust check_function_arguments caller.
4527         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4528         here.
4529         * typeck.c (cp_build_function_call_vec): Adjust
4530         check_function_arguments caller.
4532 2017-02-24  Marek Polacek  <polacek@redhat.com>
4534         PR translation/79705
4535         * decl.c (check_redeclaration_exception_specification): Mark a string
4536         for translation.  Make the pointer const.
4538 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
4540         PR c++/79361
4541         * pt.c (register_specialization): Check duplicate_decls return value
4542         for error_mark_node and pass it back.
4544 2017-02-22  Jason Merrill  <jason@redhat.com>
4546         PR c++/79679 - missing destructor for argument
4547         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4548         conversions.
4550         * pt.c (do_class_deduction): Handle 0 argument case.
4552 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
4554         PR c++/79664
4555         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4556         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4557         * constexpr.c (potential_constant_expression_1): Handle
4558         OMP_*, OACC_* and CILK_* trees.  Use error_at with
4559         EXPR_LOC_OR_LOC (t, input_location) computed early
4560         instead of error, or error_at with location_of (t).
4562 2017-02-22  Marek Polacek  <polacek@redhat.com>
4564         PR c++/79653
4565         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4566         if the alignas expression is erroneous.
4567         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4568         error_mark_node.
4570         PR c++/79657
4571         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4573 2017-02-21  Jason Merrill  <jason@redhat.com>
4575         PR c++/50308 - wrong deprecated warning with ADL
4576         PR c++/17729 - duplicate deprecated warning
4577         * semantics.c (finish_id_expression): Only call mark_used on a
4578         function if we aren't building a call.
4580         PR c++/41727 - ICE with partial spec of partial instantiation
4581         * pt.c (process_partial_specialization): For now, don't check more
4582         specialized if there is more than one level of args.
4584 2017-02-21  Marek Polacek  <polacek@redhat.com>
4586         PR c++/79535
4587         * cp-tree.h (maybe_reject_flexarray_init): Declare.
4588         * init.c (maybe_reject_flexarray_init): No longer static.
4589         Add check for current_function_decl.
4590         * parser.c (cp_parser_late_parse_one_default_arg): Reject
4591         a default mem-initializer for a flexible array.
4593 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4594             Paolo Carlini  <paolo.carlini@oracle.com>
4596         PR c++/79654
4597         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4598         on error.
4599         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4600         decl after the decomposition artificial decl has error_mark_node.
4601         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4602         instead of just == error_mark_node comparison.
4604 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4606         PR sanitizer/79589
4607         * decl.c: Include gimplify.h.
4608         (cp_finish_decomp): Make sure there is no sharing of trees
4609         in between DECL_VALUE_EXPR of decomposition decls.
4611         PR c++/79655
4612         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4614         PR c++/79639
4615         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4616         call cplus_expand_constant on it first.
4618 2017-02-19  Jason Merrill  <jason@redhat.com>
4620         PR c++/78139 - destructor needed by new-expression
4621         * call.c (build_special_member_call): Use tf_no_cleanup.
4623         PR c++/78282 - auto template and pack expansion
4624         * pt.c (find_parameter_packs_r): Don't walk into the type of
4625         templates other than template template-parameters.
4627         PR c++/79606 - ICE with this->base_member in NSDMI
4628         * class.c (build_base_path): Check processing_template_decl.
4630         PR c++/79607 - ICE with T{} initializer
4631         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4633         PR c++/79566 - elaborated-type-specifier in range for
4634         * parser.c (cp_parser_simple_declaration): Fix check for type
4635         definition.
4637         PR c++/79400 - confusing suggestion of 'noexcept'
4638         * parser.c (cp_parser_exception_specification_opt): Remove
4639         suggestion for deprecated dynamic exception-specification.
4641         PR c++/79470 - partial ordering with reference parameters
4642         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4644         PR c++/79500 - ICE with non-template deduction guide
4645         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4646         DECL_TEMPLATE_RESULT.
4648         PR c++/79580 - ICE with compound literal
4649         * parser.c (cp_parser_class_head): If we're in the middle of an
4650         expression, use ts_within_enclosing_non_class.
4652         PR c++/79503 - inherited ctor taking base class
4653         * call.c (add_function_candidate): Also check that
4654         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4656 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
4658         PR c++/79380
4659         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4660         argument.
4662 2017-02-19  Eric Fiselier  <eric@efcs.ca>
4663             Jonathan Wakely  <jwakely@redhat.com>
4665         PR c++/69523
4666         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4667         control warning about literal suffix identifiers without a leading
4668         underscore.
4670 2017-02-17  Jason Merrill  <jason@redhat.com>
4672         PR c++/79508 - lookup error with member template
4673         * parser.c (cp_parser_template_name): Clear
4674         parser->context->object_type if we aren't doing lookup.
4676         PR c++/78690 - ICE with using and global type with same name
4677         * pt.c (type_dependent_object_expression_p): True for
4678         IDENTIFIER_NODE.
4680         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4681         * pt.c (convert_template_argument): Just return an auto arg pack.
4682         (tsubst_template_args): Don't tsubst an auto pack type.
4684         PR c++/79556 - C++17 ICE with non-type auto
4685         * pt.c (do_auto_deduction): Don't try to deduce from null type.
4687         PR c++/79533 - C++17 ICE with temporary cast to reference
4688         * call.c (build_over_call): Conversion to a reference prevents copy
4689         elision.
4691 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4692             Jason Merrill  <jason@redhat.com>
4694         PR c++/79502 - lost nodiscard attribute
4695         * pt.c (apply_late_template_attributes): Do apply non-dependent
4696         attributes to types.
4698 2017-02-16  Jason Merrill  <jason@redhat.com>
4700         PR c++/78572 - ICE with self-modifying array initializer
4701         * constexpr.c (cxx_eval_store_expression): The object we're
4702         initializing is outside the constant-expression.
4703         (cxx_eval_call_expression): Set ctx->call.
4705         PR c++/79050 - ICE with undeduced auto and LTO
4706         * decl.c (poplevel): Remove undeduced auto decls.
4708 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4710         PR c++/79512
4711         * parser.c (cp_parser_omp_target): For -fopenmp-simd
4712         ignore #pragma omp target even when not followed by identifier.
4714 2017-02-15  Jason Merrill  <jason@redhat.com>
4715             Jakub Jelinek  <jakub@redhat.com>
4717         PR c++/79464 - ICE in IPA with omitted constructor parms
4718         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4719         (adjust_clone_args): Adjust.
4720         (add_method): Remember omitted parms.
4721         * call.c (add_function_candidate): Likewise.
4722         * mangle.c (write_method_parms): Likewise.
4723         * method.c (ctor_omit_inherited_parms): Return false if there are no
4724         parms to omit.
4726 2017-02-15  Martin Sebor  <msebor@redhat.com>
4728         PR c++/79363
4729         * init.c (maybe_reject_flexarray_init): New function.
4730         (perform_member_init): Call it.
4732 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
4734         PR c++/79301
4735         * parser.c (cp_parser_std_attribute): Don't pedwarn about
4736         [[deprecated]] with -std=c++11 and [[fallthrough]] with
4737         -std=c++11 and -std=c++14.
4739         PR c++/79288
4740         * decl.c (grokdeclarator): For static data members, handle thread_p
4741         only after handling inline.
4743 2017-02-14  Marek Polacek  <polacek@redhat.com>
4745         PR c++/79420
4746         PR c++/79463
4747         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4748         clobbering if the postfix expression isn't an EXPR_P.
4750 2017-02-13  Jason Merrill  <jason@redhat.com>
4752         PR c++/79461 - ICE with lambda in constexpr constructor
4753         * constexpr.c (build_data_member_initialization): Ignore
4754         initialization of a local variable.
4756 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
4758         * init.c (warn_placement_new_too_small): Add missing space in
4759         diagnostics.
4760         * parser.c (cp_parser_oacc_declare): Likewise.
4761         * mangle.c (maybe_check_abi_tags): Likewise.
4763         PR c++/79232
4764         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4765         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4766         in the rightmost operand.
4768 2017-02-13  Nathan Sidwell  <nathan@acm.org>
4770         PR c++/79296 - ICE mangling localized template instantiation
4771         * decl2.c (determine_visibility): Use template fn context for
4772         local class instantiations.
4774 2017-02-11  Jason Merrill  <jason@redhat.com>
4776         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4777         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4778         (build_new_1): Use replace_placeholders.
4779         * tree.c (replace_placeholders_t): Also track whether we've seen a
4780         placeholder.
4781         (replace_placeholders, replace_placeholders_r): Adjust.
4782         * cp-tree.h: Adjust.
4784         PR c++/77790 - ICE with auto function in C++11 mode
4785         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4786         (require_deduced_type): Add complain parm, return bool.
4787         * cp-tree.h: Adjust.
4788         * decl2.c (mark_used): Use require_deduced_type.
4790 2017-02-10  Jason Merrill  <jason@redhat.com>
4792         PR c++/78908 - template ops and bitfields
4793         * tree.c (build_min_non_dep): Use unlowered_expr_type.
4795         PR c++/78897 - constexpr union
4796         * constexpr.c (cxx_eval_store_expression): A store to a union member
4797         erases a previous store to another member.
4799         PR c++/71285 - member of fold-expression
4800         * semantics.c (finish_unary_fold_expr)
4801         (finish_binary_fold_expr): Use null type for fold-expressions.
4803         PR c++/79401 - protected inherited constructor
4804         * call.c (enforce_access): For inheriting constructor, find a base
4805         binfo in the path we already have.
4807 2017-02-10  Marek Polacek  <polacek@redhat.com>
4809         PR c++/79435
4810         * pt.c (type_dependent_expression_p): Check if the expression type
4811         is null.
4813         PR c++/79184
4814         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4815         if warnings shouldn't be given.
4817 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
4819         PR c++/71737
4820         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4821         an error_mark_node as type.
4823 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4824             Jason Merrill  <jason@redhat.com>
4826         PR c++/79143
4827         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4828         from pattern to type.
4830 2017-02-09  Jason Merrill  <jason@redhat.com>
4832         PR c++/79316 - default argument in deduction guide
4833         PR c++/79350 - explicit deduction guide
4834         * parser.c (cp_parser_constructor_declarator_p)
4835         (cp_parser_direct_declarator): Parse deduction guides more like
4836         constructors.
4837         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4838         * tree.c (special_function_p): Return it.
4839         * decl.c (check_special_function_return_type): Handle it.
4840         (grokdeclarator, grokfndecl): Adjust.
4841         (cp_finish_decl): Pass flags to do_auto_deduction.
4842         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4843         * pt.c (dguide_name_p): Take a const_tree.
4844         (do_class_deduction): Handle explicit.
4845         (do_auto_deduction): Pass flags through.
4846         (build_deduction_guide): Copy explicit flag.
4848 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4850         PR c++/79429
4851         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4852         non-pragma_compound context here.
4853         (cp_parser_omp_target): Likewise.
4854         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4855         parsing for ordered and target omp pragmas in non-pragma_stmt
4856         non-pragma_compound contexts.
4858         PR c/79431
4859         * parser.c (cp_parser_oacc_declare): Formatting fix.
4860         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4861         automatic variables.
4863 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
4864             Chung-Lin Tang  <cltang@codesourcery.com>
4866         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
4867         parsing.  Parse constant expression. Remove semantic checking.
4868         (cp_parser_omp_clause_collapse): Disallow tile.
4869         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
4870         error about missing for after already emitting one.  Use more
4871         conventional for idiom for unbounded loop.
4872         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
4873         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
4874         (finish_omp_for): Deal with tile clause.
4876 2017-02-07  Nathan Sidwell  <nathan@acm.org>
4878         * method.c (synthesized_method_base_walk): New.  Broken out of ...
4879         (synthesized_method_walk): ... here.  Call it.  Cleanup
4880         initializations.
4882 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
4884         PR c++/79360
4885         * typeck2.c (process_init_constructor_union): Consider only
4886         FIELD_DECLs when looking for an NSDMI.
4888 2017-02-06  Jason Merrill  <jason@redhat.com>
4890         PR c++/71193 - incomplete types in templates
4891         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
4892         handle incomplete type by pedwarning and then treating as dependent.
4894 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
4896         PR c++/79379
4897         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
4898         (potential_constant_expression_1): Likewise.
4900         PR c++/79377
4901         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
4902         allow one fewer than expected arguments if flag_permissive.
4904         PR c++/79372
4905         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
4906         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
4907         with error_mark_node type.
4909 2017-02-03  Jason Merrill  <jason@redhat.com>
4911         PR c++/78689 - ICE on constructor with label
4912         * optimize.c (maybe_clone_body): Replace omitted parameters with
4913         null lvalues.
4914         * class.c (build_clone): Fix logic for omitting inherited parms.
4916         PR c++/12245 - excessive memory use
4917         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
4918         back in.  Don't cache constants.
4919         (maybe_constant_init): Don't cache constants.
4921         PR c++/79294 - ICE with invalid template argument
4922         * pt.c (convert_nontype_argument_function): Check value-dependence.
4923         (convert_nontype_argument): Don't check it here for function ptrs.
4925 2017-02-02  Richard Biener  <rguenther@suse.de>
4927         PR cp/14179
4928         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
4929         it lazily on the first changed element only and copy it
4930         fully upfront, only storing changed elements.
4932 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
4934         PR c++/69637
4935         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
4936         to the width.
4938 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
4940         PR c++/79304
4941         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
4942         after ARROW_EXPR.
4944 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
4946         PR c++/79298
4947         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
4948         any namespace aliases.
4950 2017-01-31  Nathan Sidwell  <nathan@acm.org>
4952         PR c++/79290
4953         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
4955         PR c++/67273
4956         PR c++/79253
4957         * pt.c: (instantiate_decl): Push to top level when current
4958         function scope doesn't match.  Only push lmabda scope stack when
4959         pushing to top.
4961         * cp-tree.h (instantiate_decl): Make defer_ok bool.
4962         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
4963         (instantiate_decl): Simplify and reorder state saving and restoration.
4965         PR c++/79264
4966         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
4967         * semantics.c (finish_member_declaration): Assert class is being
4968         defined.
4970 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
4972         Introduce C++ support in libcc1.
4973         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
4974         (ansi_opname): Rename to...
4975         (cp_operator_id): ... this.  Adjust all callers.
4976         (ansi_assopname): Rename to...
4977         (cp_assignment_operator_id): ... this.  Adjust all callers.
4978         (cp_literal_operator_id): Declare.
4979         (set_global_friend): Declare.
4980         (is_global_friend): Declare.
4981         (enum cp_oracle_request): New type.
4982         (cp_binding_oracle_function): New type.
4983         (cp_binding_oracle): Declare.
4984         (cp_finish_injected_record_type): Declare.
4985         * friend.c (global_friend): New var.
4986         (set_global_friend): New fn.
4987         (is_global_friend): New fn.
4988         (is_friend): Call is_global_friend.
4989         * name-lookup.c (cp_binding_oracle): New var.
4990         (query_oracle): New fn.
4991         (qualified_lookup_using_namespace): Call query_oracle.
4992         (lookup_name_real_1): Likewise.
4993         * parser.c (cp_literal_operator_id): Drop static.
4994         * search.c (friend_accessible_p): Call is_global_friend.
4995         * semantics.c (is_this_parameter): Accept a variable if the
4996         binding oracle is enabled.
4998 2017-01-27  Jason Merrill  <jason@redhat.com>
5000         PR c++/78771 - ICE with inherited constructor.
5001         * call.c (build_over_call): Call deduce_inheriting_ctor here.
5002         * pt.c (tsubst_decl): Not here.
5003         * class.c (add_method): Or here.
5004         * method.c (deduce_inheriting_ctor): Handle clones.
5005         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5007 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
5009         PR c++/64382
5010         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5011         New function.
5012         * cp/cp-tree.h: Declare it.
5013         * cp/semantics.c (finish_id_expression): Resolve names within a default
5014         capturing generic lambda defined within a template prior to
5015         instantiation to allow for captures to be added to the closure type.
5017 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
5019         PR c++/68727
5020         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5021         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5022         * parser.c (cp_parser_builtin_offsetof): Pass result of
5023         build_static_cast of null_pointer_node to finish_offsetof.
5024         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5025         it for -Winvalid-offsetof pedwarn instead of trying to guess
5026         original offsetof type from EXPR.  Save OBJECT_PTR as a new
5027         second operand to OFFSETOF_EXPR.
5028         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5029         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5030         as OBJECT_PTR.
5032 2017-01-26  Jason Merrill  <jason@redhat.com>
5034         * name-lookup.c (parse_using_directive): Deprecate strong using.
5036         PR c++/79176 - lambda ICE with -flto -Os
5037         * decl2.c (vague_linkage_p): Handle decloned 'tors.
5038         * tree.c (decl_linkage): Likewise.
5040 2017-01-25  Martin Sebor  <msebor@redhat.com>
5042         * decl.c (grokdeclarator): Fix a typo in a comment.
5044 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
5046         PR c++/78896
5047         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5048         lambda expressions.
5050         PR c++/77914
5051         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5052         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5054 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
5056         PR lto/79061
5057         * decl.c (cxx_init_decl_processing): Pass main_input_filename
5058         to build_translation_unit_decl.
5060 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
5062         PR c++/79205
5063         * cp-gimplify.c (cp_genericize_r): Add result of
5064         convert_from_reference on invisiref parm to p_set.
5066 2017-01-24  Nathan Sidwell  <nathan@acm.org>
5068         PR c++/78469 - defaulted ctor and inaccessible dtor
5069         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5070         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5071         * tree.c (build_target_expr): Check tf_no_cleanup.
5073         PR c++/79118 - anon-members and constexpr
5074         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5075         ctor decl.  Recursively check anonymous members.
5076         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5077         call.
5078         (explain_invalid_constexpr_fn): Likewise.
5080 2017-01-23  Nathan Sidwell  <nathan@acm.org>
5082         PR c++/71710 - template using directive of field
5083         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5084         check earlier.
5086         PR c++/71406 - ICE with scope-ref'd template id exprs
5087         PR c++/77508
5088         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5089         before breaking up TEMPLATE_ID_EXPR.
5091 2017-01-20  Nathan Sidwell  <nathan@acm.org>
5093         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5094         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5096 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
5098         PR c++/77829
5099         PR c++/78656
5100         * cp-tree.h (suggest_alternatives_for): Add bool param.
5101         (suggest_alternative_in_explicit_scope): New decl.
5102         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5103         that isn't the global one, call new function
5104         suggest_alternative_in_explicit_scope, only calling
5105         suggest_alternatives_for if it fails, and disabling near match
5106         searches fort that case.  When SCOPE is the global namespace,
5107         pass true for new param to suggest_alternatives_for to allow for
5108         fuzzy name lookups.
5109         * lex.c (unqualified_name_lookup_error): Pass true for new param
5110         to suggest_alternatives_for.
5111         * name-lookup.c (consider_binding_level): Add forward decl.
5112         (suggest_alternatives_for): Add "suggest_misspellings" param,
5113         using it to conditionalize the fuzzy name-lookup code.
5114         (suggest_alternative_in_explicit_scope): New function.
5115         * parser.c (cp_parser_primary_expression): When calling
5116         finish_id_expression, pass location of id_expression rather
5117         than that of id_expr_token.
5118         (cp_parser_id_expression): Convert local "unqualified_id" from
5119         tree to cp_expr to avoid implicitly dropping location information.
5121 2017-01-20  Marek Polacek  <polacek@redhat.com>
5123         PR c/64279
5124         * call.c (build_conditional_expr_1): Warn about duplicated branches.
5125         * semantics.c (finish_expr_stmt): Build statement using the proper
5126         location.
5128 2017-01-19  Jason Merrill  <jason@redhat.com>
5130         US 20 - forwarding references and class template argument deduction
5131         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5132         * pt.c (push_template_decl_real): Set it.
5133         (maybe_adjust_types_for_deduction): Check it.
5134         (rewrite_template_parm): Copy it.
5136         US 19 - deduction guides and constructors
5137         * call.c (joust): Prefer deduction guides to constructors.
5138         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5139         (deduction_guide_p): Check DECL_P.
5141         * decl.c (check_initializer): Always use build_aggr_init for array
5142         decomposition.
5144         PR c++/79130 - decomposition and direct-initialization
5145         * init.c (build_aggr_init): Communicate direct-initialization to
5146         build_vec_init.
5147         (build_vec_init): Check for array copy sooner.
5148         * parser.c (cp_parser_decomposition_declaration): Remove call to
5149         build_x_compound_expr_from_list.
5151 2017-01-18  Jason Merrill  <jason@redhat.com>
5153         PR c++/68666 - member variable template-id
5154         * typeck.c (finish_class_member_access_expr): Handle variable
5155         template-id.
5156         * pt.c (lookup_and_finish_template_variable): No longer static.
5157         * cp-tree.h: Declare it.
5159 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5161         PR c++/78488
5162         * call.c (build_over_call): When checking ellipsis conversions for
5163         an inherited ctor, make sure there is at least one conversion.
5165 2017-01-18  Jason Merrill  <jason@redhat.com>
5167         PR c++/78894 - ICE with class deduction and default arg
5168         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5170 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5172         PR c++/77489
5173         * mangle.c (write_discriminator): Reorganize abi warning check.
5175 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5177         * cp-tree.h: Clarify exception spec node comment.
5178         * except.c (nothrow_spec_p): Simplify by checking node-equality.
5180         PR c++/79091
5181         * mangle.c (write_exception_spec): Check nothrow explicitly.
5182         (write_encoding): Don't increment processing_template_decl around
5183         encoding.
5185 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5187         PR c++/70182
5188         * mangle.c (write_template_args): Add "on" for operator names.
5190 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5192         PR c++/77489
5193         * mangle.c (write_discriminator): Handle discriminator >= 10.
5195 2017-01-17  Nathan Sidwell  <nathan@acm.org>
5197         PR c++/61636
5198         * cp-tree.h (maybe_generic_this_capture): Declare.
5199         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5200         (maybe_resolve_dummy): ... here.  Call it.
5201         (maybe_generic_this_capture): New.
5202         * parser.c (cp_parser_postfix_expression): Speculatively capture
5203         this in generic lambda in unresolved member function call.
5204         * pt.c (tsubst_copy_and_build): Force hard error from failed
5205         member function lookup in generic lambda.
5207 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
5209         PR c++/70565
5210         * cp-array-notation.c (expand_array_notation_exprs): Handle
5211         OMP_PARALLEL.
5213 2017-01-11  Jason Merrill  <jason@redhat.com>
5215         PR c++/78337 - ICE on invalid with generic lambda
5216         * semantics.c (process_outer_var_ref): Check if containing_function
5217         is null.  Move inform call under complain test.
5219 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5221         PR c++/77812
5222         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5223         is a new overload.
5225 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5227         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5229 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
5231         PR c++/78341
5232         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5233         assertion.  Formatting fix.
5235         PR c++/72813
5236         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5237         writing PCH file.
5239 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
5241         PR c++/77949
5242         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5243         a missing semicolon if we have a valid insertion location for
5244         the fix-it hint.
5246 2017-01-10  Jason Merrill  <jason@redhat.com>
5248         FI 20, decomposition declaration with parenthesized initializer.
5249         * parser.c (cp_parser_decomposition_declaration): Use
5250         cp_parser_initializer.
5252 2017-01-09  Jason Merrill  <jason@redhat.com>
5254         Implement P0195R2, C++17 variadic using.
5255         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5256         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5257         * error.c (dump_decl): Likewise.
5259 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
5261         PR translation/79019
5262         PR translation/79020
5263         * semantics.c (finish_omp_clauses): Add missing whitespace to
5264         translatable strings.
5265         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5267 2017-01-07  Jason Merrill  <jason@redhat.com>
5269         PR c++/78948 - instantiation from discarded statement
5270         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5271         * cp-tree.h (in_discarded_stmt): Declare it.
5272         (struct saved_scope): Add discarded_stmt bitfield.
5273         (in_discarded_stmt): New macro.
5274         * decl2.c (mark_used): Check it.
5275         * parser.c (cp_parser_selection_statement): Adjust.
5276         (cp_parser_jump_statement): Adjust.
5278 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
5280         PR c++/78931
5281         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5282         REFERENCE_REF_P, set tt to its operand.
5284         PR c++/78890
5285         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5286         unions even for C++11 and later.
5288 2017-01-05  Nathan Sidwell  <nathan@acm.org>
5290         PR c++/78765
5291         * pt.c (convert_nontype_argument): Don't try and see if integral
5292         or enum expressions are constants prematurely.
5294 2017-01-04  Marek Polacek  <polacek@redhat.com>
5296         PR c++/64767
5297         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5298         a zero character literal.
5300 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
5302         PR c++/78949
5303         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5304         vector type.
5306         PR c++/78693
5307         * parser.c (cp_parser_simple_declaration): Only complain about
5308         inconsistent auto deduction if auto_result doesn't use auto.
5310         * parser.c (cp_parser_simple_declaration): Diagnose function
5311         declaration among more than one init-declarators with auto
5312         specifier.
5314         PR c++/71182
5315         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5316         assertion, as lexer->buffer may be NULL.
5318 2017-01-04  Marek Polacek  <polacek@redhat.com>
5320         PR c++/77545
5321         PR c++/77284
5322         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5324 2017-01-04  Nathan Sidwell  <nathan@acm.org>
5326         PR c++/66735
5327         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5328         (lambda_capture_field_type): Update prototype.
5329         * lambda.c (lambda_capture_field_type): Add is_reference parm.
5330         Add referenceness here.
5331         (add_capture): Adjust lambda_capture_field_type call, refactor
5332         error checking.
5333         * pt.c (tsubst): Adjust lambda_capture_field_type call.
5335 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
5337         Update copyright years.
5339 Copyright (C) 2017 Free Software Foundation, Inc.
5341 Copying and distribution of this file, with or without modification,
5342 are permitted in any medium without royalty provided the copyright
5343 notice and this notice are preserved.