PR c++/82760 - memory corruption with aligned new.
[official-gcc.git] / gcc / cp / ChangeLog
blob1bc460002ddf5fe76500ee294ac2b8e753aa8671
1 2017-11-29  Jason Merrill  <jason@redhat.com>
3         PR c++/82760 - memory corruption with aligned new.
4         * call.c (build_operator_new_call): Update *args if we add the
5         align_arg.
7 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
9         PR sanitizer/81275
10         * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
11         (SWITCH_STMT_NO_BREAK_P): Define.
12         (note_break_stmt, note_iteration_stmt_body_start,
13         note_iteration_stmt_body_end): Declare.
14         * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
15         and in_loop_body_p fields. 
16         (push_switch): Clear them.
17         (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
18         and !break_stmt_seen_p.  Assert in_loop_body_p is false.
19         (note_break_stmt, note_iteration_stmt_body_start,
20         note_iteration_stmt_body_end): New functions.
21         (finish_case_label): Set has_default_p when both low and high
22         are NULL_TREE.
23         * parser.c (cp_parser_iteration_statement): Use
24         note_iteration_stmt_body_start and note_iteration_stmt_body_end
25         around parsing iteration body.
26         * pt.c (tsubst_expr): Likewise.
27         * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
28         SWITCH_STMT which contains no BREAK_STMTs, contains a default:
29         CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
30         can't fallthru.
31         * semantics.c (finish_break_stmt): Call note_break_stmt.
32         * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
33         bit to SWITCH_ALL_CASES_P.  Assert that if SWITCH_STMT_NO_BREAK_P then
34         the break label is not TREE_USED.
36 2017-11-28  Julia Koval  <julia.koval@intel.com>
37             Sebastian Peryt  <sebastian.peryt@intel.com>
39         * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
40         * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
41         * constexpr.c (potential_constant_expression_1): Ditto.
42         * cp-array-notation.c: Delete.
43         * cp-cilkplus.c: Ditto.
44         * cp-cilkplus.h: Ditto.
45         * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
46         cilkplus condition.
47         * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
48         * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
49         * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
50         * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
51         * lambda.c (cp-cilkplus.h): Remove.
52         * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
53         cp_parser_cilk_simd_vectorlength): Delete.
54         (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
55         cp_parser_postfix_expression,
56         cp_parser_postfix_open_square_expression,
57         cp_parser_statement, cp_parser_jump_statement,
58         cp_parser_direct_declarator,
59         cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
60         cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
61         cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
62         cp_parser_omp_flush,
63         cp_parser_omp_for_cond, cp_parser_omp_for_incr,
64         cp_parser_omp_for_loop_init,
65         cp_parser_omp_for_loop,
66         cp_parser_omp_declare_simd): Remove cilkplus support.
67         (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
68         cp_parser_cilk_grainsize): Remove.
69         (cp_parser_pragma, c_parse_file): Remove cilkplus support.
70         (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
71         cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
72         cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
73         * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
74         * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
75         cilkplus support.
76         * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
77         finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
78         finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
79         cilkplus
80         support.
81         * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
82         * typeck.c (cp_build_array_ref, cp_build_compound_expr,
83         check_return_expr): Remove cilkplus support.
85 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
87         * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
88         build2_loc instead of build3_loc.
90 2017-11-27  Martin Sebor  <msebor@redhat.com>
92         PR c++/83058
93         * init.c (warn_placement_new_too_small): Use offset_int instead of
94         HOST_WIDE_INT.
96 2017-11-27  Jakub Jelinek  <jakub@redhat.com>
98         PR c++/81888
99         * parser.c (cp_parser_decomposition_declaration): Reject just
100         BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
101         than all such CONSTRUCTORs, and only if is_direct_init is true.
103 2017-11-27  Jason Merrill  <jason@redhat.com>
105         * pt.c (primary_template_specialization_p): Rename from
106         primary_template_instantiation_p.  Don't check
107         DECL_TEMPLATE_INSTANTIATION.
108         * call.c, cp-tree.h, decl2.c: Adjust.
110 2017-11-27  Jakub Jelinek  <jakub@redhat.com>
112         PR c++/81675
113         * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
114         for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
115         INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
116         through into normal folding, otherwise just rebuild x if any op
117         changed.
119         * g++.dg/warn/pr81675.C: New test.
121 2017-11-14  Boris Kolpackov  <boris@codesynthesis.com>
123         * Make-lang.in (c++.install-plugin): Install backend import library.
125 2017-11-23  Jakub Jelinek  <jakub@redhat.com>
127         * parser.c (cp_parser_omp_declare): Change return type to bool from
128         void, return true for declare simd.
129         (cp_parser_pragma): Return cp_parser_omp_declare returned value
130         rather than always false.
132 2017-11-23  Mike Stump  <mikestump@comcast.net>
133             Eric Botcazou  <ebotcazou@adacore.com>
135         * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
136         * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
137         ANNOTATE_EXPR.
138         (finish_do_stmt): Likewise.
139         (finish_for_cond): Likewise.
141 2017-11-22  Jakub Jelinek  <jakub@redhat.com>
143         PR c++/82401
144         * name-lookup.c (member_name_cmp): Return 0 if a == b.
146 2017-11-22  David Malcolm  <dmalcolm@redhat.com>
148         PR c++/62170
149         * error.c (type_to_string): Add leading comment.  Add params
150         "postprocessed", "quote", and "show_color", using them to fix
151         quoting of the "aka" for types involving typedefs.
152         (arg_to_string): Update for new params to type_to_string.
153         (cxx_format_postprocessor::handle): Likewise.
154         (cp_printer): Convert penultimate param from bool to bool *.
155         Update call to type_to_string and calls to
156         defer_phase_2_of_type_diff.
158 2017-11-22  Marek Polacek  <polacek@redhat.com>
160         PR c++/60336
161         PR middle-end/67239
162         PR target/68355
163         * class.c (layout_class_type): Set DECL_PADDING_P on padding.
164         * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
165         (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
167 2017-11-21  Martin Liska  <mliska@suse.cz>
169         * class.c (finalize_literal_type_property): Add quotes for
170         constexpr keyword.
171         (explain_non_literal_class): Likewise.
172         * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
173         (is_valid_constexpr_fn): Likewise.
174         (check_constexpr_ctor_body): Likewise.
175         (register_constexpr_fundef): Likewise.
176         (explain_invalid_constexpr_fn): Likewise.
177         (cxx_eval_builtin_function_call): Likewise.
178         (cxx_eval_call_expression): Likewise.
179         (cxx_eval_loop_expr): Likewise.
180         (potential_constant_expression_1): Likewise.
181         * decl.c (check_previous_goto_1): Likewise.
182         (check_goto): Likewise.
183         (grokfndecl): Likewise.
184         (grokdeclarator): Likewise.
185         * error.c (maybe_print_constexpr_context): Likewise.
186         * method.c (process_subob_fn): Likewise.
187         (defaulted_late_check): Likewise.
188         * parser.c (cp_parser_compound_statement): Likewise.
190 2017-11-21  Marc Glisse  <marc.glisse@inria.fr>
192         * constexpr.c (cxx_eval_constant_expression,
193         potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
194         * cp-gimplify.c (cp_fold): Likewise.
195         * error.c (dump_expr): Likewise.
196         * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
198 2017-11-21  Jakub Jelinek  <jakub@redhat.com>
200         P0428R2 - familiar template syntax for generic lambdas
201         * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
202         for cxx2a and above, reword pedwarn for C++14/C++17.
204 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
206         PR c/81404
207         * name-lookup.c: Include "c-family/known-headers.h"
208         (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
209         potentially return a new suggest_missing_header hint.
211 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
213         PR c++/72786
214         * name-lookup.c (class macro_use_before_def): New class.
215         (lookup_name_fuzzy): Detect macro that were used before being
216         defined, and report them as such.
218 2017-11-20  Jason Merrill  <jason@redhat.com>
220         * decl2.c (constrain_class_visibility): Don't warn about artificial
221         fields.
223 2017-11-20  Jakub Jelinek  <jakub@redhat.com>
225         P0329R4: Designated Initialization
226         * parser.c (cp_parser_initializer_clause): List in comment grammar
227         designated-initializer-list.
228         (cp_parser_initializer_list): Allow .identifier = without pedwarn for
229         C++2A, parse .identifier { ... }.  Improve location_t argument to
230         pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
231         designated initializer list.  Diagnose mixing designated and
232         non-designated initializer clauses for C++2A.  Diagnose duplicated
233         identifiers in designators.
234         * name-lookup.h (search_anon_aggr): New declaration.
235         * name-lookup.c (fields_linear_search): Use search_anon_aggr.
236         (search_anon_aggr): New function.
237         * typeck2.c (process_init_constructor_record): Allow designator
238         to skip over some non-static data members.  Handle anonymous
239         aggregates.  Add diagnostics for designator order not matching
240         member declaration order.
242 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
244         * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
245         Include "c-family/name-hint.h"
246         (suggest_alternatives_for): Convert "fuzzy_name" from const char *
247         to name_hint, and rename to "hint".  Pass location to
248         lookup_name_fuzzy.
249         (lookup_name_fuzzy): Convert return type from const char *
250         to name_hint.  Add location_t param.
251         * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
252         Include "c-family/name-hint.h"
253         (cp_parser_diagnose_invalid_type_name): Convert
254         "suggestion" from const char * to name_hint, and rename to "hint".
255         Pass location to lookup_name_fuzzy.
257 2017-11-20  Nathan Sidwell  <nathan@acm.org>
259         PR c++/82878
260         PR c++/78495
261         * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
262         ctor.
263         * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
264         inhibibition check removed in previous c++/78495 change.
266 2017-11-20   Jakub Jelinek  <jakub@redhat.com>
268         PR c++/82781
269         * constexpr.c (cxx_eval_vector_conditional_expression): New function.
270         (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
271         of cxx_eval_conditional_expression.
273 2017-11-19  Jakub Jelinek  <jakub@redhat.com>
275         PR c/66618
276         PR c/69960
277         * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
278         cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
280 2017-11-16  Jason Merrill  <jason@redhat.com>
282         PR c++/79092 - non-type args of different types are different
283         * tree.c (cp_tree_equal): Check the type of constants.
284         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
285         when comparing to previously deduced argument.
286         (maybe_convert_nontype_argument): New.
287         (convert_nontype_argument): Call it.
288         (tsubst_copy_and_build): Handle partial instantiation of
289         IMPLICIT_CONV_EXPR.
290         (unify): Ignore type when deducing from array bound.
291         (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
292         (value_dependent_expression_p): Any type-dependent expression is
293         value-dependent.  Handle IMPLICIT_CONV_EXPR.
294         * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
295         * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
297 2017-11-16  Nathan Sidwell  <nathan@acm.org>
299         PR c++/82836
300         PR c++/82737
301         * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
302         Override.
303         * cp-tree.h (overwrite_mangling): Declare.
304         * decl2.c (struct mangled_decl_hash): Entries are deletable.
305         (overwrite_mangling): New.
307         PR c++/81060
308         * decl.c (xref_tag_1): Push lambda into current scope.
309         * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
311 2017-11-15  Nathan Sidwell  <nathan@acm.org>
313         PR c++/81574
314         * lambda.c (lambda_capture_field_type): Function references are
315         always catured by reference.
317 2017-11-15  Martin Liska  <mliska@suse.cz>
319         * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
320         instead of cp_build_indirect_ref.
322 2017-11-15  Martin Liska  <mliska@suse.cz>
324         * decl.c (begin_destructor_body): In case of VPTR sanitization
325         (with disabled recovery), zero vptr in order to catch virtual calls
326         after lifetime of an object.
328 2017-11-14  Jason Merrill  <jason@redhat.com>
330         Use GTY((cache)) on some hash tables.
331         * decl.c (decomp_type_table): Use tree_cache_map.
332         * init.c (nsdmi_inst): Likewise.
333         * pt.c (defarg_ints): Likewise.
334         * cp-objcp-common.c (cp_get_debug_type): Likewise.
336 2017-11-13  Jason Merrill  <jason@redhat.com>
338         Capture adjustments for P0588R1.
339         * semantics.c (process_outer_var_ref): Capture variables when
340         they are named; complain about non-capture uses when odr-used.
341         * expr.c (mark_use): Rvalue use looks through capture proxy.
342         * constexpr.c (potential_constant_expression_1): Improve error about
343         use of captured variable.
344         * lambda.c (need_generic_capture, dependent_capture_r)
345         (do_dependent_capture, processing_nonlambda_template): Remove.
346         * call.c (build_this): Remove uses of the above.
347         * decl.c (cp_finish_decl): Likewise.
348         * semantics.c (maybe_cleanup_point_expr)
349         (maybe_cleanup_point_expr_void, finish_goto_stmt)
350         (maybe_convert_cond): Likewise.
351         * typeck.c (check_return_expr): Likewise.
353         Defer folding of *&.
354         * typeck.c (cp_build_fold_indirect_ref): New.
355         (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
356         Add 'fold' parameter.
357         * cp-tree.h: Declare cp_build_fold_indirect_ref.
358         * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
359         parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
360         * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
361         (cp_convert_range_for): Likewise.
362         * typeck2.c (build_x_arrow): Use RO_ARROW.
364         * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
365         INDIRECT_REF of ADDR_EXPR.
367         PR c++/82360 - ICE with static_cast in template.
368         * call.c (perform_direct_initialization_if_possible): Check
369         processing_template_decl.
370         * typeck.c (build_static_cast_1): Likewise.
372 2017-11-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
374         Remove the null check from placement new in all modes
375         * init.c (build_new_1): Don't do a null check for
376         a namespace-scope non-replaceable placement new
377         in any mode unless -fcheck-new is provided.
379 2017-11-07 Boris Kolpackov  <boris@codesynthesis.com>
381         * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
382         in cp-tree.h.
384 2017-11-07  Jakub Jelinek  <jakub@redhat.com>
386         PR c++/82835
387         * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
388         convert_default_arg instead of i.
390 2017-11-06  Jason Merrill  <jason@redhat.com>
392         P0704R1 - fixing const-qualified pointers to members
393         * typeck2.c (build_m_component_ref): Also accept in lower stds with
394         a pedwarn.
396 2017-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
398         PR c++/65579
399         * decl2.c (finish_static_data_member_decl): If there's an initializer,
400         complete the type and re-apply the quals.
402 2017-11-06  Martin Liska  <mliska@suse.cz>
404         PR middle-end/82404
405         * constexpr.c (cxx_eval_builtin_function_call): Handle
406         __builtin_unreachable call.
407         (get_function_named_in_call): Declare function earlier.
408         (constexpr_fn_retval): Skip __builtin_unreachable.
409         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
410         ...
411         (cp_maybe_instrument_return): ... this.
412         (cp_genericize): Call the function unconditionally.
414 2017-11-03  Nathan Sidwell  <nathan@acm.org>
416         PR c++/82710
417         * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
418         warning too.
420 2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
422         PR c++/81957
423         * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
424         (expand_integer_pack, convert_template_argument, coerce_template_parms,
425         gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
426         unify): Adjust calls.
427         * tree.c (cp_build_qualified_type_real): Likewise.
428         * cp-tree.h (make_pack_expansion): Adjust declaration.
430 2017-11-02  Nathan Sidwell  <nathan@acm.org>
432         * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
433         (IDENTIFIER_NEW_OP_P): New.
434         * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
435         * pt.c (push_template_decl_real): Likewise.
436         * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
438         PR c++/82710
439         * decl.c (grokdeclarator): Don't warn when parens protect a return
440         type from a qualified name.
442 2017-11-01  Nathan Sidwell  <nathan@acm.org>
444         * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
445         Renumber and reserve udlit value.
446         (IDENTIFIER_NEWDEL_OP_P): Delete.
447         (IDENTIFIER_OVL_OP_P): New.
448         (IDENTIFIER_ASSIGN_OP_P): Adjust.
449         (IDENTIFIER_CONV_OP_P): Adjust.
450         (IDENTIFIER_OVL_OP_INFO): Adjust.
451         (IDENTIFIER_OVL_OP_FLAGS): New.
452         * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
453         * lex.c (get_identifier_kind_name): Adjust.
454         (init_operators): Don't special case new/delete ops.
455         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
456         * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
457         * typeck.c (check_return_expr): Likewise.
459         * cp-tree.h (assign_op_identifier, call_op_identifier): Use
460         compressed code.
461         (struct lang_decl_fn): Use compressed operator code.
462         (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
463         (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
464         (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
465         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
466         (build_library_fn): Likewise.
467         (grok_op_properties): Likewise.
468         * mangle.c (write_unqualified_name): Likewise.
469         * method.c (implicitly_declare_fn): Likewise.
470         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
472         * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
473         (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
474         (enum ovl_op_code): New.
475         (struct ovl_op_info): Add ovl_op_code field.
476         (ovl_op_info): Size by OVL_OP_MAX.
477         (ovl_op_mapping, ovl_op_alternate): Declare.
478         (OVL_OP_INFO): Adjust for mapping array.
479         (IDENTIFIER_OVL_OP_INFO): New.
480         * decl.c (ambi_op_p, unary_op_p): Delete.
481         (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
482         ovl_op_alternate.
483         * lex.c (ovl_op_info): Adjust and static initialize.
484         (ovl_op_mappings, ovl_op_alternate): Define.
485         (init_operators): Iterate over ovl_op_info array and init mappings
486         & alternate arrays.
487         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
488         * operators.def (DEF_OPERATOR): Remove KIND parm.
489         (DEF_SIMPLE_OPERATOR): Delete.
490         (OPERATOR_TRANSITION): Expand if defined.
492 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
494         * pt.c (listify): Use %< and %> for description of #include.
496 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
498         * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
499         than 0.
500         * name-lookup.c (suggest_alternatives_for): Update for renaming of
501         inform_at_rich_loc.
502         (maybe_suggest_missing_header): Likewise.
503         (suggest_alternative_in_explicit_scope): Likewise.
504         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
505         renaming of error_at_rich_loc.
506         (cp_parser_string_literal): Likewise.
507         (cp_parser_nested_name_specifier_opt): Likewise.
508         (cp_parser_cast_expression): Likewise for renaming of
509         warning_at_rich_loc.
510         (cp_parser_decl_specifier_seq): Likewise for renaming of
511         error_at_rich_loc and warning_at_rich_loc.
512         (cp_parser_elaborated_type_specifier): Likewise for renaming of
513         pedwarn_at_rich_loc.
514         (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
515         error_at_rich_loc.
516         (cp_parser_virt_specifier_seq_opt): Likewise.
517         (cp_parser_class_specifier_1): Likewise.
518         (cp_parser_class_head): Likewise.
519         (cp_parser_member_declaration): Likewise for renaming of
520         pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
521         (cp_parser_enclosed_template_argument_list): Likewise for renaming
522         of error_at_rich_loc.
523         (set_and_check_decl_spec_loc): Likewise.
524         * pt.c (listify): Likewise.
525         * rtti.c (typeid_ok_p): Likewise.
526         * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
527         than 0.
528         * typeck.c (access_failure_info::maybe_suggest_accessor): Update
529         for renaming of inform_at_rich_loc.
530         (finish_class_member_access_expr): Likewise for renaming of
531         error_at_rich_loc.
533 2017-10-31  Nathan Sidwell  <nathan@acm.org>
535         * cp-tree.h (struct operator_name_info_t): Rename to ...
536         (struct ovl_op_info_t): ... here.  Add tree_code field.
537         (operator_name_info, assignment_operator_name_info): Delete.
538         (ovl_op_info): Declare.
539         (OVL_OP_INFO): Adjust.
540         * decl.c (grok_op_properties): Use ovl_op_flags.
541         * lex.c (operator_name_info, assignment_operator_name_info):
542         Delete.
543         (ovl_op_info): Define.
544         (set_operator_ident): Adjust.
545         (init_operators): Set tree_code.
546         * mangle.c (write_unqualified_id): Adjust operator array scan.
548         * lex.c (init_operators): Allow NULL operator name.  Don't add
549         special cases.
550         * operators.def: Use NULL for mangling only operators.  Move to
551         after regular operators but move assignment operators last.
553         * cp-tree.h (enum ovl_op_flags): New.
554         (struct operator_name_info_t): Rename arity to flags.
555         * lex.c (set_operator_ident): New.
556         (init_operators): Use it.  Adjust for flags.
557         * mangle.c (write_unqualified_id): Adjust for flags.
558         * operators.def: Replace arity with flags.
560         * cp-tree.h (ovl_op_identifier): New.
561         (assign_op_identifier, call_op_identifier): Adjust.
562         (cp_operator_id, cp_assignment_operator_ide): Delete.
563         (SET_OVERLOADED_OPERATOR_CODE): Delete.
564         (OVL_OP_INFO): New.
565         * call.c (op_error): Use OVL_OP_INFO.
566         (build_conditional_expr_1): Use ovl_op_identifier.
567         (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
568         (build_op_delete_call): Likewise.
569         * class.c (type_requires_array_cookie): Use ovl_op_identifier.
570         * decl.c (duplicate_decls): Directly copy operator code.
571         (builtin_function_1): Do not set operator code.
572         (build_library_fn): Directly set operator code.
573         (push_cp_library_fn): Use ovl_op_identifier.
574         (grok_op_properties): Directly set operator code.
575         * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
576         * error.c (dump_expr): Use OVL_OP_INFO.
577         (op_to_string): Add assop arg. Use OVL_OP_INFO.
578         (assop_to_string): Delete.
579         (args_to_string): Adjust.
580         * init.c (build_new_1): Use ovl_op_identifier.
581         * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
582         (write_expression): Likewise.
583         * method.c (synthesized_method_walk): Use ovl_op_identifier.
584         (implicitly_declare_fn): Use assign_op_identifier. Directly set
585         operator code.
586         * name-lookup.c (get_class_binding): Use assign_op_identifier.
587         * parser.c (cp_parser_operator): Use ovl_op_identifier.
588         (cp_parser_omp_clause_reduction): Likewise.
589         * semantics.c (omp_reduction_id): Likewise.
590         * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
592         * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
593         (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
594         (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
595         (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
596         * call.c (add_function_candidate): Use
597         DECL_OVERLOADED_OPERATOR_IS.
598         (build_op_call_1): Use call_op_identifier &
599         DECL_OVERLOADED_OPERATOR_IS.
600         (build_over_call): Likewise.
601         (has_trivial_copy_assign_p): Use assign_op_identifier.
602         (build_special_member_call): Likewise.
603         * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
604         (vbase_has_user_provided_move_assign,
605         classtype_has_move_assign_or_move_ctor_p): Likewise.
606         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
607         (grok_special_member_properties): Use assign_op_identifier.
608         (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
609         * decl2.c (mark_used): Use DECL_CONV_FN_P.
610         * dump.c (dump_access): Delete prototype.
611         (dump_op): Delete.
612         (cp_dump_tree): Don't call it.
613         * lambda.c (lambda_function): Use call_op_identifier.
614         (maybe_add_lambda_conv_op): Not an overloaded operator.  Remove
615         unneeded braces.
616         * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
617         * method.c (do_build_copy_assign): Use assign_op_identifier.
618         (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
619         (get_copy_assign): Use assign_op_identifier.
620         (synthesized_method_walk): Likewise.
621         (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
622         * parser.c (cp_parser_lambda_declarator_opt): Use
623         call_op_identifier.
624         * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
625         assign_op_identifier.
626         * tree.c (special_function_p):  Use DECL_OVERLOADED_OPERATOR_IS.
627         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
628         (check_return_expr): Use assign_op_identifier.
630 2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
632         PR c++/82085
633         * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
634         unconditionally call convert_from_reference.
636 2017-10-30  Nathan Sidwell  <nathan@acm.org>
638         * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
639         as a few lines earlier.
640         * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
641         * decl.c (grokfndecl): Fix indentation.
642         (compute_array_index_type): Use processing_template_decl_sentinel.
643         (grok_op_properties): Move warnings to end.  Reorder other checks
644         to group similar entities.  Tweak diagnostics.
645         * lex.c (unqualified_name_lookup_error): No need to check name is
646         not ERROR_MARK operator.
647         * parser.c (cp_parser_operator): Select operator code before
648         looking it up.
649         * typeck.c (check_return_expr): Fix indentation and line wrapping.
651 2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>
653         * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
655 2017-10-26  Nathan Sidwell  <nathan@acm.org>
657         * decl.c (sort_labels): Restore function.
658         (pop_labels): Sort labels
659         (identify_goto): Add translation markup.
661 2017-10-25  Nathan Sidwell  <nathan@acm.org>
663         Kill IDENTIFIER_LABEL_VALUE.
664         * cp-tree.h (lang_identifier): Delete label_value slot.
665         (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
666         (struct named_label_hasher): Rename to ...
667         (struct named_label_hash): ... here.  Reimplement.
668         (struct language_function): Adjust x_named_labels.
669         * name-lookup.h (struct cp_label_binding): Delete.
670         (struct cp_binding_level): Delete shadowed_labels slot.
671         * decl.c (struct named_label_entry): Add name and outer slots.
672         (pop_label): Rename to ...
673         (check_label_used): ... here.  Don't pop.
674         (note_label, sort_labels): Delete.
675         (pop_labels, pop_local_label): Reimplement.
676         (poplevel): Pop local labels as any other decl. Remove
677         shadowed_labels handling.
678         (named_label_hash::hash, named_label_hash::equal): New.
679         (make_label_decl): Absorb into ...
680         (lookup_label_1): ... here.  Add making_local_p arg, reimplement.
681         (lookup_label, declare_local_label): Adjust.
682         (check_goto, define_label): Adjust.
683         * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
684         * ptree.c (cxx_print_identifier): Don't print identifier binding.
686         * decl.c (identifier_goto): Reduce duplication.
687         (check_previous_goto_1): Likewise.
688         (check_goto): Move var decls to initialization.
689         (check_omp_return, define_label_1, define_label): Likewise.
691 2017-10-25  Jakub Jelinek  <jakub@redhat.com>
693         PR libstdc++/81706
694         * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
695         newdecl to corresponding __builtin_ if any.
697 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
699         PR c++/82466
700         * decl.c (duplicate_decls): Warn for built-in functions declared as
701         non-function, use OPT_Wbuiltin_declaration_mismatch.
703         * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
705 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
707         PR c++/80991
708         * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
709         a TREE_LIST as TRAIT_EXPR_TYPE2.
711 2017-10-24  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
712             Paolo Carlini  <paolo.carlini@oracle.com>
714         PR c++/82307
715         * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
716         enumeration type whose underlying type is fixed.
718 2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
720         PR c++/80449
721         * semantics.c (finish_compound_literal): Check do_auto_deduction
722         return value for error_mark_node.
724 2017-10-23  Jason Merrill  <jason@redhat.com>
726         PR c++/77369 - wrong noexcept handling in C++14 and below
727         * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
729 2017-10-20  Nathan Sidwell  <nathan@acm.org>
731         * class.c (layout_class_type): Cleanup as-base creation, determine
732         mode here.
733         (finish_struct_1): ... not here.
735 2017-10-19  Jakub Jelinek  <jakub@redhat.com>
737         PR c++/82600
738         * typeck.c (check_return_expr): Don't call
739         maybe_warn_about_returning_address_of_local in templates.
741 2017-10-17  Nathan Sidwell  <nathan@acm.org>
743         PR c++/82560
744         * call.c (build_over_call): Don't pass tf_no_cleanup to nested
745         calls.
747         PR middle-end/82546
748         * cp-objcp-common.c (cp_tree_size): Reformat.  Adjust returns size
749         of TYPE nodes.
751 2017-10-13  Jason Merrill  <jason@redhat.com>
753         PR c++/82357 - bit-field in template
754         * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
756 2017-10-13  David Malcolm  <dmalcolm@redhat.com>
758         * cp-tree.h (maybe_show_extern_c_location): New decl.
759         * decl.c (grokfndecl): When complaining about literal operators
760         with C linkage, issue a note giving the location of the
761         extern "C".
762         * parser.c (cp_parser_new): Initialize new field
763         "innermost_linkage_specification_location".
764         (cp_parser_linkage_specification): Store the location
765         of the linkage specification within the cp_parser.
766         (cp_parser_explicit_specialization): When complaining about
767         template specializations with C linkage, issue a note giving the
768         location of the extern "C".
769         (cp_parser_explicit_template_declaration): Likewise for templates.
770         (maybe_show_extern_c_location): New function.
771         * parser.h (struct cp_parser): New field
772         "innermost_linkage_specification_location".
774 2017-10-12  Nathan Sidwell  <nathan@acm.org>
776         * cp-tree.h (cp_expr): Add const operator * and operator->
777         accessors.
778         (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
779         TS_CP_WRAPPER, LAST_TS_CP_ENUM.
781 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
783         * parser.c (get_required_cpp_ttype): New function.
784         (cp_parser_error_1): Call it, using the result to call
785         maybe_suggest_missing_token_insertion.
787 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
789         * parser.c (get_matching_symbol): Move to before...
790         (cp_parser_error): Split out into...
791         (cp_parser_error_1): ...this new function, merging in content
792         from...
793         (cp_parser_required_error): ...here.  Eliminate partial duplicate
794         of body of cp_parser_error in favor of a call to the new
795         cp_parser_error_1 helper function.
797 2017-10-11  Nathan Sidwell  <nathan@acm.org>
799         * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
800         (record_mangling): Likewise.
802 2017-10-10  Nathan Sidwell  <nathan@acm.org>
804         * name-lookup.c (extern_c_fns): Rename to ...
805         (extern_c_decls): ... here.
806         (check_extern_c_conflict, extern_c_linkage_bindings): Update.
807         (do_pushdecl): Check extern-c fns and vars.
809         * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
810         specialization.
812         * decl2.c (struct mangled_decl_hash): New hash traits.
813         (mangled_decls): Make hash_table<mangled_decl_hash>.
814         (generate_mangling_alias, record_mangling): Adjust.
816 2017-10-10  Jason Merrill  <jason@redhat.com>
818         More delayed lambda capture fixes.
819         * call.c (add_function_candidate): Use build_address.
820         (build_op_call_1): Call mark_lvalue_use early.
821         (build_over_call): Handle error from build_this.
822         * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
823         (cxx_eval_increment_expression): Don't use rvalue().
824         * cvt.c (convert_to_void): Use mark_discarded_use.
825         * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR.  Fix
826         reference handling.  Don't copy the expression.
827         (mark_discarded_use): New.
828         * lambda.c (insert_capture_proxy): Add some sanity checking.
829         (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
830         * pt.c (register_local_specialization): Add sanity check.
831         * semantics.c (process_outer_var_ref): Fix check for existing proxy.
832         * typeck.c (cp_build_addr_expr_1): Handle error from
833         mark_lvalue_use.
834         (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
835         from rvalue.
837         Handle generic lambda capture in dependent expressions.
838         * lambda.c (need_generic_capture, dependent_capture_r)
839         (do_dependent_capture): New.
840         * pt.c (processing_nonlambda_template): Use need_generic_capture.
841         * semantics.c (maybe_cleanup_point_expr)
842         (maybe_cleanup_point_expr_void, finish_goto_stmt)
843         (maybe_convert_cond): Call do_dependent_capture.
844         * typeck.c (build_static_cast): Remove dependent capture handling.
846         * typeck.c (condition_conversion): Assert !processing_template_decl.
847         * semantics.c (finish_omp_clauses): Don't
848         fold_build_cleanup_point_expr if processing_template_decl.
849         (outer_var_p): A temporary can't be from an outer scope.
850         * pt.c (type_dependent_expression_p): Fix dependency checking of
851         functions without DECL_TEMPLATE_INFO.
852         (instantiate_decl): Use lss_copy.
853         * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
855         * typeck.c (check_return_expr): Check non-dependent conversion in
856         templates.
857         * constraint.cc (check_function_concept): Don't complain about an
858         empty concept if seen_error.
860 2017-10-10  Richard Sandiford  <richard.sandiford@linaro.org>
862         * cvt.c (ignore_overflows): Use wi::to_wide when
863         operating on trees as wide_ints.
864         * decl.c (check_array_designated_initializer): Likewise.
865         * mangle.c (write_integer_cst): Likewise.
866         * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
868 2017-10-10  Nathan Sidwell  <nathan@acm.org>
870         * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
872 2017-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
874         PR c++/47791
875         * decl.c (finish_function): Take a bool intead of an int; adjust.
876         * cp-tree.h (finish_function): Adjust declaration.
877         * decl2.c (generate_tls_wrapper, finish_objects,
878         finish_static_storage_duration_function): Adjust calls.
879         * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
880         Likewise.
881         * method.c (synthesize_method): Likewise.
882         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
883         * pt.c (instantiate_decl): Likewise.
884         * parser.c (cp_parser_function_definition_after_declarator,
885         cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
886         Likewise.
887         (cp_parser_ctor_initializer_opt,
888         cp_parser_ctor_initializer_opt_and_function_body,
889         cp_parser_function_try_block,
890         cp_parser_function_definition_after_declarator,
891         cp_parser_function_transaction): Return void; adjust declarations.
893 2017-10-06  Nathan Sidwell  <nathan@acm.org>
895         PR c++/82424
896         * name-lookup.c (check_local_shadow): Don't try and convert
897         dependent types.
899 2017-10-06  Jakub Jelinek  <jakub@redhat.com>
901         PR c++/82299
902         * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
903         init.
904         * typeck.c (convert_for_assignment): Likewise.
906         P0704R1 - fixing const-qualified pointers to members
907         * typeck2.c (build_m_component_ref): For -std=c++2a allow
908         pointer to const & qualified method on rvalue.
910 2017-10-06  Nathan Sidwell  <nathan@acm.org>
912         Use hash_table for extern "C" names
913         * name-lookup.c (extern_c_fns): Use hash_table.
914         (check_extern_c_conflict): Adjust.
915         (c_linkage_bindings): Adjust.
917         Use hash_table for namespace bindings
918         * cp-tree.h (struct named_decl_hash): New.
919         (lang_decl_ns): Change type of bindings field.
920         * lex.c (maybe_add_lang_decl_raw): Adjust.
921         * name-lookup.c (find_namespace_slot): Adjust.
922         (do_pushdecl): Push NULL-named namespace.
923         (do_push_nested_namespace): Adjust.
924         (push_namespace): Push anonymous namespace as NULL name.
926 2017-10-05  Jason Merrill  <jason@redhat.com>
928         Pass variadic class objects exactly like named by-value args.
929         * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
931 2017-10-05  Nathan Sidwell  <nathan@acm.org>
933         Warn on MVP declarations
934         * cp-tree.h (struct cp_declarator): Add parenthesized field.
935         * decl.c (grokdeclarator): Warn about unnecessary parens.
936         * parser.c (make_declarator): Init parenthesized field.
937         (cp_parser_direct_declarator): Set parenthesized field.
939         Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
940         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
941         SET_IDENTIFIER_GLOBAL_VALUE): Delete.
942         * name-lookup.h (set_global_binding): Remove NAME parm.
943         (get_global_binding): New inline fn.
944         * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
945         (identifier_global_value): Move to ...
946         * cp-objcp-common.c (identifier_global_value): ... here.
947         * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
948         * decl.c (record_builtin_type, expand_static_init,
949         grokdeclarator): Adjust.
950         * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
951         get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
952         * except.c (declare_library_fn, build_throw): Adjust.
953         * init.c (throw_bad_array_length): Adjust.
954         * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
956         * decl2.c (record_mangling): Fix spello and formatting from
957         previous patch.
959 2017-10-04  Nathan Sidwell  <nathan@acm.org>
961         Give builtin types the correct name.
962         * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
963         * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
964         rname.
966 2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
967             Andrew Pinski  <apinski@cavium.com>
969         PR c++/71946
970         * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
972 2017-10-04  Nathan Sidwell  <nathan@acm.org>
974         Move mangling aliases out of global namespace.
975         * cp-tree.h (record_mangling): New.
976         (maybe_remove_implicit_alias): Delete.
977         * decl2.c (mangled_decls): New hash map.
978         (generate_mangling_alias): Reimplement using mangled_decls.
979         (record_mangling): New.
980         * mangle.c (decl_implicit_alias_p,
981         maybe_remove_implicit_alias): Delete.
982         (mangle_decl): Use record_mangling.
983         * name-lookup.c (supplement_binding_1): Remove
984         maybe_remove_implicit_alias check.
986 2017-10-04  Jakub Jelinek  <jakub@redhat.com>
988         PR c++/82373
989         * error.c (dump_function_decl): If show_return, call dump_type_suffix
990         on the same return type dump_type_prefix has been called on.
992 2017-10-04  Jason Merrill  <jason@redhat.com>
994         PR c++/81525 - broken handling of auto in generic lambda.
995         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
997 2017-10-04  Nathan Sidwell  <nathan@acm.org>
999         * call.c (convert_arg_to_ellipsis): Correct comment about passing
1000         by reference.
1002 2017-10-02  Richard Sandiford  <richard.sandiford@linaro.org>
1004         * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1005         when comparing the array bounds with an ARRAY_REF index.
1007 2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
1009         PR c++/68754
1010         * method.c (defaulted_late_check): Early return if the defaulted
1011         declaration does not match the expected signature.
1013 2017-09-29  Jakub Jelinek  <jakub@redhat.com>
1015         P0683R1 - default member initializers for bit-fields
1016         * cp-tree.h (grokbitfield): Add INIT parameter.
1017         * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1018         if true, parse a conditional-expression rather than
1019         assignment-expression.
1020         (cp_parser_member_declaration): For C++11 and later pass true
1021         as STRICT_P to cp_parser_constant_expression.  Parse C++2A bitfield
1022         NSDMIs.  Adjust grokbitfield caller.  Handle DECL_INITIAL also for
1023         DECL_C_BIT_FIELDs.
1024         (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1025         * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1026         (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1027         * decl2.c (grokbitfield): Add INIT parameter, pass it to
1028         cp_finish_decl.
1029         * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1030         just non-bitfields.
1032         * class.c (check_bitfield_decl): Retrieve and clear width from
1033         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1034         (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1035         DECL_INITIAL.
1036         (remove_zero_width_bit_fields): Adjust comment.
1037         * decl2.c (grokbitfield): Stash width into
1038         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1039         * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1040         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1042         * parser.c (cp_parser_member_declaration): Parse attributes before
1043         colon of a bitfield in addition to after colon.
1045         * Make-lang.in (check-c++-all): Test also c++2a.
1047 2017-09-28  Jason Merrill  <jason@redhat.com>
1049         PR c++/56973, DR 696 - capture constant variables only as needed.
1050         * expr.c (mark_use): Split out from mark_rvalue_use and
1051         mark_lvalue_use.  Handle lambda capture of constant variables.
1052         (mark_lvalue_use_nonread): New.
1053         * semantics.c (process_outer_var_ref): Don't capture a constant
1054         variable until forced.
1055         * pt.c (processing_nonlambda_template): New.
1056         * call.c (build_this): Check it.
1057         * decl2.c (grok_array_decl): Call mark_rvalue_use and
1058         mark_lvalue_use_nonread.
1059         * init.c (constant_value_1): Don't call mark_rvalue_use.
1060         * typeck.c (build_static_cast): Handle lambda capture.
1062         Use local_specializations to find capture proxies.
1063         * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1064         * lambda.c (build_capture_proxy): Set it.
1065         (add_capture): Pass initializer to build_capture_proxy.
1066         (start_lambda_function): Likewise.
1067         (insert_capture_proxy): Use register_local_specialization.
1068         (is_lambda_ignored_entity): Always ignore proxies.
1069         * name-lookup.c (qualify_lookup): Don't check
1070         is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1071         * semantics.c (process_outer_var_ref): Use
1072         retrieve_local_specialization.
1073         * parser.c (cp_parser_lambda_body): Push local_specializations.
1074         * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1075         (tsubst_lambda_expr): Push local_specializations sooner.
1076         (tsubst_copy_and_build): Don't register_local_specialization.
1078         * call.c (build_special_member_call): Use the return value of
1079         mark_lvalue_use.
1080         * decl.c (compute_array_index_type): Likewise.
1081         * parser.c (cp_parser_oacc_wait_list): Likewise.
1082         * lambda.c (is_normal_capture_proxy): Handle *this capture.
1083         (add_capture): Clarify internal_error message.
1085 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
1087         PR bootstrap/81926
1088         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1090 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
1092         PR sanitizer/81929
1093         * tree.c (struct replace_placeholders_t): Add pset field.
1094         (replace_placeholders_r): Call cp_walk_tree with d->pset as
1095         last argument instead of NULL.  Formatting fix.
1096         (replace_placeholders): Add pset variable, add its address
1097         into data.  Pass &pset instead of NULL to cp_walk_tree.
1099 2017-09-22  David Malcolm  <dmalcolm@redhat.com>
1101         * call.c (get_fndecl_argument_location): New function.
1102         (convert_like_real): Use it  when complaining about argument type
1103         mismatches.
1104         * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1105         * parser.c (make_parameter_declarator): Add "loc" param and use
1106         it to initialize the new field.
1107         (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1108         the "no_parameters" parameter.
1109         (cp_parser_parameter_declaration_list): Set the location of the
1110         result of grokdeclarator to be the parameter's loc, assuming no
1111         errors.
1112         (cp_parser_parameter_declaration): Generate a location for the
1113         parameter and pass to make_parameter_declarator.
1115 2017-09-20  Nathan Sidwell  <nathan@acm.org>
1117         * name-lookup.c (member_name_cmp): Use DECL_UID for final
1118         ordering.
1120 2017-09-20  Jakub Jelinek  <jakub@redhat.com>
1122         P0409R2 - allow lambda capture [=, this]
1123         * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1124         redundant [=, this].
1126 2017-09-18  Jason Merrill  <jason@redhat.com>
1128         PR c++/82069 - ICE with lambda in template
1129         * semantics.c (process_outer_var_ref): Check uses_template_parms
1130         instead of any_dependent_template_arguments_p.
1132 2017-09-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1133             Paolo Carlini  <paolo.carlini@oracle.com>
1135         PR c++/64644
1136         * decl2.c (finish_anon_union): Complain about "anonymous union with
1137         no members" with a pedwarn.
1139 2017-09-15  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1141         * typeck.c (build_reinterpret_cast_1,
1142         build_const_cast_1): Implement -Wcast-align=strict.
1144 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
1146         * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1147         adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1148         to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
1149         (cxx_init_decl_processing, next_initializable_field,
1150         is_direct_enum_init, check_initializer, cp_finish_decl,
1151         mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1152         finish_function): Likewise.
1153         * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1154         * pt.c (mark_template_parm, convert_nontype_argument,
1155         instantiate_class_template_1, type_unification_real, unify,
1156         get_partial_spec_bindings, dependent_type_p_r): Likewise.
1157         * typeck.c (cp_build_unary_op): Likewise.
1158         * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1159         * call.c (build_user_type_conversion_1, build_over_call,
1160         build_special_member_call): Likewise.
1161         * lambda.c (begin_lambda_type): Likewise.
1162         * typeck2.c (process_init_constructor_record): Likewise.
1163         * class.c (build_base_field, finalize_literal_type_property,
1164         explain_non_literal_class): Likewise.
1165         * parser.c (cp_parser_diagnose_invalid_type_name,
1166         cp_parser_primary_expression, cp_parser_lambda_introducer,
1167         cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1168         cp_convert_range_for, cp_parser_perform_range_for_lookup,
1169         cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1170         cp_parser_static_assert, cp_parser_simple_type_specifier,
1171         cp_parser_namespace_definition, cp_parser_using_declaration,
1172         cp_parser_init_declarator, cp_parser_type_parameter_key,
1173         cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1174         cp_parser_constructor_declarator_p): Likewise.
1175         * mangle.c (struct globals): Rename need_cxx1z_warning to
1176         need_cxx17_warning.
1177         (write_exception_spec, start_mangling, mangle_decl): Likewise.
1178         * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1179         it.
1180         (check-c++17): New goal.  Use 17 instead of 1z.
1181         (check-c++-all): Use 17 instead of 1z.
1183 2017-09-14  Jakub Jelinek  <jakub@redhat.com>
1185         PR c++/81314
1186         * cp-gimplify.c (omp_var_to_track): Look through references.
1187         (omp_cxx_notice_variable): Likewise.
1189 2017-09-13  Nathan Sidwell  <nathan@acm.org>
1191         Conv-op identifers not in identifier hash table
1192         * lex.c (conv_type_hasher): Make member fns inline.
1193         (make_conv_op_name): Directly clone conv_op_identifier.
1195         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1196         * cp-tree.h (struct lang_type): Rename methods to members.
1197         (CLASSTYPE_METHOD_VEC): Rename to ...
1198         (CLASSTYPE_MEMBER_VEC): ... this.
1199         * name-lookup.h (get_method_slot): Rename to ...
1200         (get_member_slot): ... this.
1201         (resort_type_method_vec): Rename to ...
1202         (resort_type_member_vec): ... this.
1203         * class.c (add_method, warn_hidden): Adjust.
1204         * search.c (dfs_locate_field_accessor_pre): Adjust.
1205         * name-lookup.c (method_vec_binary_search): Rename to ...
1206         (member_vec_binary_search): ... this and adjust.
1207         (method_vec_linear_search): Rename to ...
1208         (member_vec_linear_search): ... this and adjust.
1209         (fields_linear_search, get_class_binding_direct): Adjust.
1210         (get_method_slot): Rename to ...
1211         (get_member_slot): ... this and adjust.
1212         (method_name_slot): Rename to ...
1213         (member_name_slot): ... this and adjust.
1214         (resort_type_method_vec): Rename to ...
1215         (resort_type_member_vec): ... this and adjust.
1216         (method_vec_append_class_fields): Rename to ...
1217         (member_vec_append_class_fields): ... this and adjust.
1218         (method_vec_append_enum_values): Rename to ...
1219         (member_vec_append_enum_values): ... this and adjust.
1220         (method_vec_dedup): Rename to ...
1221         (member_vec_dedup): ... this and adjust.
1222         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1223         
1224 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
1226         PR c++/70621
1227         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1228         returns it; avoid misleading error message.
1230 2017-09-12  Nathan Sidwell  <nathan@acm.org>
1232         Kill CLASSTYPE_SORTED_FIELDS.
1233         * cp-tree.h (struct lang_type): Lose sorted_fields member.
1234         (CLASSTYPE_SORTED_FIELDS): Delete.
1235         * name-lookup.h (set_class_bindings): Add EXTRA arg.
1236         * name-lookup.c (fields_linear_search): New, broken out of ...
1237         (lookup_field_1): ... here.  Delete remainder of function.
1238         (get_class_binding_direct): Reimplement without sorted_fields.
1239         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1240         (get_method_slot): Call set_class_binding when creating method_vec
1241         on complete type.
1242         (method_name_cmp): Order identically named slots.
1243         (sorted_fields_type_new): Delete.
1244         (field_vc_append_class_fields): Rename to ...
1245         (method_vec_append_class_fields): ... here.  Adjust.
1246         (field_vec_append_enum_values): Renme to ...
1247         (method_vec_append_enum_values): ... here. Adjust.
1248         (method_vec_dedup): New.
1249         (set_class_bindings): Reimplement.
1250         (insert_late_enum_def_bindings): Reimplement.
1252         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1253         consistency.
1254         (restort_data): Move later.
1255         (method_name_cmp, resort_method_name_cmp): Simplify.
1256         (resort_type_method_vec): Reformat.
1258 2017-09-09  Jason Merrill  <jason@redhat.com>
1260         * constexpr.c (reduced_constant_expression_p): If
1261         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1263 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
1265         PR bootstrap/81926
1266         * cp-objcp-common.c (struct debug_type_hasher): New class.
1267         (debug_type_hash): New variable.
1268         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1270 2017-09-08  Jason Merrill  <jason@redhat.com>
1272         PR c++/70029 - ICE with ref-qualifier and -flto
1273         * tree.c (cxx_copy_lang_qualifiers): New.
1274         * cp-tree.h: Declare it.
1275         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1277 2017-09-06  Jason Merrill  <jason@redhat.com>
1279         PR c++/82053 - ICE with default argument in lambda in template
1280         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1281         in templates.
1282         (retrieve_specialization): Use lambda_fn_in_template_p.
1283         * cp-tree.h: Declare it.
1285         PR c++/82070 - error with nested lambda capture
1286         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1287         register_local_specialization.
1289 2017-09-06  Nathan Sidwell  <nathan@acm.org>
1291         * name-lookup.h (lookup_field_1): Delete.
1292         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1293         * name-lookup.c (lookup_field_1): make static
1294         (method_vec_binary_search, method_vec_linear_search): New.  Broken
1295         out of ...
1296         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
1297         Do complete search of this level.
1298         (get_class_binding): Adjust.
1299         * decl.c (reshape_init_class): Call get_class_binding.
1300         * search.c (lookup_field_r): Move field searching into
1301         get_class_binding_direct.
1303         * class.c (warn_hidden): Don't barf on non-functions.
1304         * decl2.c (check_classfn): Likewise.  Check template match earlier.
1306         * name-lookup.c (count_fields): Rename to ...
1307         (count_class_fields): ... here.  Take a class, don't count
1308         NULL-named fields.
1309         (add_fields_to_record_type): Rename to ...
1310         (field_vec_append_class_fields): ... here.  Take a class, don't
1311         add NULL-named fields.
1312         (add_enum_fields_to_record_type): Rename to ...
1313         (field_vec_append_enum_values): ... here.
1314         (set_class_bindings): Adjust, assert we added expected number.
1315         (insert_late_enum_def_bindings): Reimplement.  Create vector if
1316         there are now sufficient entries.
1318         * name-lookup.h (lookup_fnfields_slot_nolazy,
1319         lookup_fnfields_slot): Rename to ...
1320         (get_class_binding_direct, get_class_binding): ... here.
1321         * name-lookup.c (lookup_fnfields_slot_nolazy,
1322         lookup_fnfields_slot): Rename to ...
1323         (get_class_binding_direct, get_class_binding): ... here.
1324         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1325         * call.c (build_user_type_conversion_1): Adjust.
1326         (has_trivial_copy_assign_p): Adjust.
1327         (has_trivial_copy_p): Adjust.
1328         * class.c (get_basefndecls) Adjust.
1329         (vbase_has_user_provided_move_assign) Adjust.
1330         (classtype_has_move_assign_or_move_ctor_p): Adjust.
1331         (type_build_ctor_call, type_build_dtor_call): Adjust.
1332         * decl.c (register_dtor_fn): Adjust.
1333         * decl2.c (check_classfn): Adjust.
1334         * pt.c (retrieve_specialization): Adjust.
1335         (check_explicit_specialization): Adjust.
1336         (do_class_deduction): Adjust.
1337         * search.c (lookup_field_r): Adjust.
1338         (look_for_overrides_here, lookup_conversions_r): Adjust.
1339         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1340         * tree.c (type_has_nontrivial_copy_init): Adjust.
1341         * method.c (lazily_declare_fn): Adjust comment.
1343 2017-09-05  Nathan Sidwell  <nathan@acm.org>
1345         * name-lookup.c (do_class_using_decl): Elide read-once temps.
1346         Move declarations to initializations.
1348         * class.c (add_method): Move slot search and insertion to ...
1349         * name-lookup.c (get_method_slot): ... this new function.
1350         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1351         * name-lookup.h (get_method_slot): Declare.
1352         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1353         realistic type.
1354         (grok_special_member_properties): Set
1355         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1356         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
1358         * cp-tree.h (lang_decl_base): Rename template_conv_p to
1359         unknown_bound_p.
1360         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1361         (DECL_CONV_FN_TYPE): FN must be conv op.
1362         (DECL_TEMPLATE_CONV_FN_P): Delete.
1363         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1364         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1365         setting.
1367         * class.c (unreverse_member_declarations): Remove extraneous if.
1368         * pt.c (push_template_decl_real): Use string concatenation, not
1369         \<newline>.  Add %<..%>.
1371 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
1373         PR c++/81942
1374         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1375         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1376         creating cdtor_label.
1377         * constexpr.c (returns): Add the case of a constructor/destructor
1378         returning via a LABEL_DECL_CDTOR label.
1379         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1381 2017-09-01  Nathan Sidwell  <nathan@acm.org>
1383         * cp-tree.h (resort_type_method_vec): Move declaration to ...
1384         * name-lookup.h (resort_type_method_vec): ... here.
1385         (set_class_bindings): Lose 2nd arg.
1386         * class.c (finish_struct_1, finish_struct): Adjust
1387         set_class_bindings call.  Don't call finish_struct_methods.
1388         (resort_data, method_name_cmp, resort_method_name_cmp,
1389         resort_type_method_vec, finish_struct_methods): Move to ...
1390         * name-lookup.c (resort_data, method_name_cmp,
1391         resort_method_name_cmp, resort_type_method_vec): ... here.
1392         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
1394         * class.c (finish_struct): Call set_class_bindings for the
1395         template case too.
1397         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1398         Don't call maybe_warn_about_overly_private_class here.
1399         (warn_hidden): Cleanup declarations and comments.
1400         (type_has_user_provided_constructor): No need to check
1401         CLASSTYPE_METHOD_VEC.
1402         (type_has_user_provided_or_explicit_constructor): Likewise.
1403         (classtype_has_move_assign_or_move_ctor_p): Likewise.
1404         (check_bases_and_members): Don't call finish_struct_methods here.
1405         (finish_struct_1): Call finish_struct_methods and
1406         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
1407         here.
1408         (finish_struct): For templates process USING_DECLS and clear
1409         DECL_IN_AGGR_P before calling finish_struct_methods. Call
1410         maybe_warn_about_overly_private_class here.
1412         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1413         Restore sorted_fields vector.
1414         * cp-tree.h (lang_type): Restore sorted_fields vector.
1415         (CLASSTYPE_SORTED_FIELDS): Restore.
1416         (CLASSTYPE_BINDINGS): Delete.
1417         * name-lookup.c (lookup_field_1): Restore binary search.
1418         (sorted_fields_type_new, count_fields,
1419         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1420         (set_class_bindings): Revert.
1421         (insert_late_enum_def_binding): Restore field_vec insertion.
1423 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
1425         PR c/81887
1426         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1428 2017-09-01  Marek Polacek  <polacek@redhat.com>
1430         PR c++/82040
1431         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1433 2017-08-30  Jason Merrill  <jason@redhat.com>
1435         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1436         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1437         (regenerated_lambda_fn_p): New.
1438         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1439         (tsubst_copy) [VAR_DECL]: Likewise.
1441         PR c++/82030 - ICE inheriting from multiple lambdas
1442         PR c++/80767
1443         * call.c (compare_ics): Handle null candidate.
1445 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
1447         Make taking the address of an overloaded function a non-deduced context
1449         * pt.c (unify_overload_resolution_failure): Remove.
1450         (unify_one_argument): Adjust.
1452 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1453             Alan Hayward  <alan.hayward@arm.com>
1454             David Sherwood  <david.sherwood@arm.com>
1456         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1458 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1459             Alan Hayward  <alan.hayward@arm.com>
1460             David Sherwood  <david.sherwood@arm.com>
1462         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1464 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1465             Alan Hayward  <alan.hayward@arm.com>
1466             David Sherwood  <david.sherwood@arm.com>
1468         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1469         instead of TYPE_MODE.
1471 2017-08-29  Jason Merrill  <jason@redhat.com>
1473         PR c++/81236 - ICE with template-id in generic lambda
1474         * semantics.c (finish_id_expression): Remove special dependent case.
1475         Avoid some later pieces when dependent.
1476         (finish_qualified_id_expr): Do normal BASELINK handling in a
1477         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1478         (parsing_default_capturing_generic_lambda_in_template): Remove.
1479         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1480         error for types that will never be complete.
1481         * mangle.c (write_expression): Add sanity check.
1482         * tree.c (build_qualified_name): Add sanity check.
1483         (cp_walk_subtrees): Walk into the class context of a BASELINK.
1484         * lambda.c (add_capture): Improve diagnostic for generic lambda
1485         capture failure.
1486         * call.c (build_new_method_call_1): Print the right constructor
1487         name.
1489         Reimplement handling of lambdas in templates.
1490         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1491         * decl.c (start_preparsed_function): Call start_lambda_scope.
1492         (finish_function): Call finish_lambda_scope.
1493         * init.c (get_nsdmi): Call start/finish_lambda_scope.
1494         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1495         * parser.c (cp_parser_function_definition_after_declarator): Don't
1496         call start/finish_lambda_scope.
1497         * pt.c (retrieve_specialization): Ignore lambda functions in
1498         templates.
1499         (find_parameter_packs_r): Ignore capture proxies.  Look into
1500         lambdas.
1501         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1502         (tsubst_default_argument): Call start/finish_lambda_scope.
1503         (tsubst_function_decl): Handle lambda functions differently.
1504         (tsubst_template_decl): Likewise.
1505         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1506         proxies.
1507         (tsubst_lambda_expr): Create a new closure rather than instantiate
1508         the one from the template.
1509         (tsubst_copy_and_build): Don't register a specialization of a pack.
1510         (regenerate_decl_from_template): Call start/finish_lambda_scope.
1511         (instantiate_decl): Remove special lambda function handling.
1512         * semantics.c (process_outer_var_ref): Remove special generic lambda
1513         handling.  Don't implicitly capture in a lambda in a template.  Look
1514         for an existing proxy.
1515         * class.c (current_nonlambda_class_type): Use decl_type_context.
1517         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1518         (LAMBDA_EXPR_RETURN_TYPE): Remove.
1519         (struct tree_lambda_expr): Remove closure and return_type fields.
1520         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1521         * pt.c (tsubst_copy_and_build): Likewise.
1522         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1523         (cp_parser_lambda_body): Adjust unspecified return type check.
1524         * ptree.c (cxx_print_lambda_node): Don't print closure or
1525         return type.
1527         PR c++/80935 - wrong C++17 error with lambda
1528         * decl.c (check_for_uninitialized_const_var): Check
1529         is_instantiation_of_constexpr.
1530         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1531         is_instantiation_of_constexpr.
1532         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1534         * lambda.c (build_lambda_object): Check for error_mark_node.
1535         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1536         pack as well.
1537         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1538         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1540         PR c++/80767 - unnecessary instantiation of generic lambda
1541         * call.c (convert_like_real): Call build_user_type_conversion_1 if
1542         cand is null.
1543         (add_conv_candidate): Build a ck_user conversion with no candidate.
1545         Fix lambdas in template default argument of inherited ctor.
1546         * method.c (synthesized_method_base_walk): Replace an inherited
1547         template with its specialization.
1548         (synthesized_method_walk): Make inheriting_ctor a pointer.
1549         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1550         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1552         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1553         template, not the function.
1554         (template_guide_p): Adjust.
1556         Support copying local_specializations.
1557         * cp-tree.h (enum lss_policy): New.
1558         (local_specialization_stack): Add policy parameter to default ctor.
1559         * pt.c (local_specialization_stack): Copy local_specializations if
1560         lss_copy.
1562         * constexpr.c (potential_constant_expression_1): Add "now" parm.
1563         (is_constant_expression, require_constant_expression): New.
1564         (is_static_init_expression, is_nondependent_constant_expression)
1565         (is_nondependent_static_init_expression): Drop "potential".
1566         * except.c (build_must_not_throw_expr): Do type conversion on
1567         value-dependent argument.
1568         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1570         Instantiate default arguments/member initializers once.
1571         * init.c (get_nsdmi): Remember NSDMI instantiations.
1572         * parser.c (inject_this_parameter): Be more picky about
1573         current_class_ptr.
1574         * pt.c (tsubst_copy): Simplify 'this' handling.
1575         (tsubst_default_argument): Remember default argument
1576         instantiations.  Take parameter number.
1577         (tsubst_default_arguments): Pass it.
1578         * call.c (convert_default_arg): Likewise.
1580         Fix default argument conversion failure and SFINAE.
1581         * call.c (build_over_call): Check convert_default_arg result for
1582         error_mark_node.
1583         * parser.c (cp_parser_late_parsing_default_args): Remember
1584         error_mark_node.
1586 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1588         * cp-tree.h (lang_type): Replace sorted_fields vector with
1589         bindings map.
1590         (CLASSTYPE_SORTED_FIELDS): Delete.
1591         (CLASSTYPE_BINDINGS): New.
1592         * decl.c (finish_enum_value_list): Swap args of
1593         insert_late_enum_def_bindings.
1594         * name-lookup.c (lookup_field_1): Replace binary search of sorted
1595         fields with map->get.
1596         (sorted_fields_type_new, count_fields,
1597         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1598         (add_class_member, add_class_members): New.
1599         (set_class_bindings): Create map and insert.
1600         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
1601         * ptree.c (cxx_print_type): Delete sorted fields printing.
1603         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1604         Delete.
1605         * name-lookup.h (set_class_bindings,
1606         insert_late_enum_def_bindings): Declare.
1607         * decl.c (finish_enum_value_list): Adjust for
1608         insert_late_enum_def_bindings name change.
1609         * class.c (finish_struct_1): Call set_class_bindings.
1610         (count_fields, add_fields_to_record_type,
1611         add_enum_fields_to_record_type, sorted_fields_type_new,
1612         insert_into_classtype_sorted_fields,
1613         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1614         * name-lookup.h (count_fields, add_fields_to_record_type,
1615         add_enum_fields_to_record_type, sorted_fields_type_new,
1616         set_class_bindings, insert_late_enum_def_bindings): ... here.
1618 2017-08-25  Nathan Sidwell  <nathan@acm.org>
1620         * class.c (method_name_cmp, resort_method_name_cmp): Methods
1621         can never be NULL.
1623         Conversion operators have a special name
1624         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1625         (conv_op_marker, conv_op_identifier): New.
1626         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1627         * decl.c (initialize_predefined_identifiers): Add
1628         conv_op_identifier.
1629         (cxx_init_decl_processing): Create conv_op_marker.
1630         * decl2.c (check_classfn): Lookup conv-ops by name.
1631         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1632         (resort_type_method_vec): Don't skip conv-ops.
1633         (finish_struct_methods, warn_hidden): Likewise.
1634         * name-lookup.h (lookup_all_conversions): Delete.
1635         * name-lookup.c (lookup_conversion_operator): Replace with ...
1636         (extract_conversion_operator): ... this.
1637         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1638         (lookup_all_conversions): Delete.
1639         * pt.c (check_explicit_specialization): Find conv-ops by name.
1640         * search.c (lookup_conversions_r): Likewise.
1642 2017-08-24  Nathan Sidwell  <nathan@acm.org>
1644         Conversion operators kept on single overload set
1645         * class.c (add_method): Keep all conv-ops on one slot.
1646         * name-lookup.c (lookup_conversion_operator): Pull the desired
1647         conv op out of overload set.
1648         * search.c (lookup_conversions_r): Lose template/non-template
1649         distinction.
1650         (lookup_conversions): Likewise.
1652 2017-08-23  Nathan Sidwell  <nathan@acm.org>
1654         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1655         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1656         declatations to ...
1657         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1658         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1659         * search.c (lookup_conversion_operator,
1660         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1661         lookup_all_conversions): Move to ...
1662         * name-lookup.c (lookup_conversion_operator,
1663         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1664         lookup_all_conversions): ... here.
1666         * semantics.c (finish_member_declaration): Move USING_DECL check
1667         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
1668         template decl list insertion.
1670         * cp-tree.h (maybe_version_functions): Declare.
1671         * decl.c (decls_match): Break function versioning check to
1672         separate function.  Call it.
1673         (maybe_version_functions): Broken out of decls_match.
1674         * class.c (add_method): Use maybe_version_functions.
1676         * cp-tree.h (print_search_statistics,
1677         reinit_search_statistics): Don't declare.
1678         * search.c (n_fields_searched, n_calls_lookup_field,
1679         n_calls_lookup_field_1, n_calls_lookup_fnfields,
1680         n_calls_lookup_fnfields_1, n_calls_get_base_type,
1681         n_outer_fields_searched, n_contexts_saved): Delete.
1682         (lookup_field_1, lookup_member,
1683         lookup_fnfields_slot_nolazy): Remove stat gathering.
1684         (print_search_statistics, reinit_search_statistics): Delete.
1685         * tree.c (cxx_print_statistics): Don't print search stats.
1687 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1689         * search.c (lookup_field_r): Remove obsolete code for type-named
1690         field in PoD.
1692         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1693         isn't special.
1694         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1695         (lookup_field_fuzzy_r): Adjust.
1697 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
1699         * call.c (build_over_call): Pass NULL for new parameter to
1700         check_function_arguments.
1701         * typeck.c (cp_build_function_call_vec): Likewise.
1703 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1705         PR c++/81899
1706         * pt.c (instantiate_class_template_1):
1707         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1709 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1711         PR c++/81514
1712         * name-lookup.c (maybe_suggest_missing_header): Convert return
1713         type from void to bool; return true iff a suggestion was offered.
1714         (suggest_alternative_in_explicit_scope): Move call to
1715         maybe_suggest_missing_header to before use of best_match, and
1716         return true if the former offers a suggestion.
1718 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1720         PR c/53037
1721         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1722         * decl2.c (grokbitfield): Don't allow bit-field with
1723         warn_if_not_aligned type.
1725 2017-08-17  Nathan Sidwell  <nathan@acm.org>
1727         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1728         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1729         (TYPE_TEMPLATE_INFO): Simplify.
1730         (SET_TYPE_TEMPLATE_INFO): Simplify.
1732         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1733         don't need lang_type.
1734         (cxx_make_type): Use maybe_add_lang_type_raw return value.
1735         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1736         TYPE_LANG_SPECIFIC.
1738         * cp-tree.h (struct lang_type): Remove template_info field.
1739         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1740         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1742 2017-08-14  Martin Sebor  <msebor@redhat.com>
1744         PR c/81117
1745         * error.c (cp_printer): Handle 'G'.
1747 2017-08-11  Martin Liska  <mliska@suse.cz>
1749         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1750         TARGET_SUPPORTS_ALIASES.
1751         (handle_tls_init): Likewise.
1752         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
1753         both arguments.
1754         * optimize.c (can_alias_cdtor): Likewise.
1756 2017-08-11  Jason Merrill  <jason@redhat.com>
1758         PR c++/81671 - nullptr_t template parameter
1759         * pt.c (convert_nontype_argument): Fix nullptr_t check.
1761 2017-08-10  Jason Merrill  <jason@redhat.com>
1763         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1764         * method.c (synthesized_method_walk): Don't diagnose lack of
1765         operator delete.
1767         PR c++/80452 - Core 1579, implicit move semantics on return/throw
1768         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1769         tentatively changed the lvalue to an rvalue.
1770         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1771         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1772         parameter is an rvalue reference.
1773         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1774         * typeck.c (check_return_expr): Likewise.
1776 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
1778         * parser.c (cp_parser_error): Update for new param to
1779         c_parse_error.
1780         (class token_pair): New class.
1781         (struct matching_paren_traits): New struct.
1782         (matching_parens): New typedef.
1783         (struct matching_brace_traits): New struct.
1784         (matching_braces): New typedef.
1785         (cp_parser_statement_expr): Convert explicit parsing of
1786         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1787         class matching_parens, so that the pertinent open parenthesis is
1788         highlighted when there are problems locating the close
1789         parenthesis.
1790         (cp_parser_primary_expression): Likewise.
1791         (cp_parser_compound_literal_p): Remove consumption of opening
1792         paren.
1793         (cp_parser_postfix_expression): Convert explicit parsing of
1794         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1795         above.  Use it to consume the opening paren previously consumed by
1796         cp_parser_compound_literal_p.
1797         (cp_parser_parenthesized_expression_list): Likewise.
1798         (cp_parser_unary_expression): Likewise.
1799         (cp_parser_new_expression): Likewise.
1800         (cp_parser_cast_expression): Likewise.
1801         (cp_parser_builtin_offsetof): Likewise.
1802         (cp_parser_trait_expr): Likewise.
1803         (cp_parser_lambda_declarator_opt): Likewise.
1804         (cp_parser_lambda_body): Likewise, for matching_braces.
1805         (cp_parser_compound_statement): Likewise.
1806         (cp_parser_selection_statement): Likewise, for matching_parens.
1807         (cp_parser_iteration_statement): Likewise.
1808         (cp_parser_already_scoped_statement): Likewise, for
1809         matching_braces.
1810         (cp_parser_linkage_specification): Likewise.
1811         (cp_parser_static_assert): Likewise, for matching_parens.
1812         (cp_parser_decltype): Likewise.
1813         (cp_parser_operator): Likewise.
1814         (cp_parser_enum_specifier): Likewise.
1815         (cp_parser_namespace_definition): Likewise.
1816         (cp_parser_direct_declarator): Likewise.
1817         (cp_parser_braced_list): Likewise.
1818         (cp_parser_class_specifier_1): Likewise, for matching_braces.
1819         (cp_parser_constant_initializer): Likewise.
1820         (cp_parser_noexcept_specification_opt): Likewise, for
1821         matching_parens.
1822         (cp_parser_exception_specification_opt): Likewise.
1823         (cp_parser_handler): Likewise.
1824         (cp_parser_asm_specification_opt): Likewise.
1825         (cp_parser_asm_operand_list): Likewise.
1826         (cp_parser_gnu_attributes_opt): Likewise.
1827         (cp_parser_std_attribute_spec): Likewise.
1828         (cp_parser_requirement_parameter_list): Likewise.
1829         (cp_parser_requirement_body): Likewise, for matching_braces.
1830         (cp_parser_compound_requirement): Likewise.
1831         (cp_parser_template_introduction): Likewise.
1832         (cp_parser_sizeof_pack): Likewise, for matching_parens.
1833         (cp_parser_sizeof_operand): Likewise; use it to consume the
1834         opening paren previously consumed by cp_parser_compound_literal_p.
1835         (get_matching_symbol): New function.
1836         (cp_parser_required_error): Add param "matching_location".  Remove
1837         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
1838         handling it if set by calling c_parse_error, potentially with a
1839         secondary location if matching_location was set.
1840         (cp_parser_require): Add param "matching_location", with a default
1841         value of UNKNOWN_LOCATION.
1842         (cp_parser_require_keyword): Update for new param of
1843         cp_parser_required_error.
1844         (cp_parser_objc_encode_expression): Update to class matching_parens
1845         as above.
1846         (cp_parser_objc_defs_expression): Likewise.
1847         (cp_parser_objc_protocol_expression): Likewise.
1848         (cp_parser_objc_selector_expression): Likewise.
1849         (cp_parser_objc_typename): Likewise.
1850         (cp_parser_objc_superclass_or_category): Likewise.
1851         (cp_parser_objc_try_catch_finally_statement): Likewise.
1852         (cp_parser_objc_synchronized_statement): Likewise.
1853         (cp_parser_objc_at_property_declaration): Likewise.
1854         (cp_parser_oacc_single_int_clause): Likewise.
1855         (cp_parser_oacc_shape_clause): Likewise.
1856         (cp_parser_omp_clause_collapse): Likewise.
1857         (cp_parser_omp_clause_default): Likewise.
1858         (cp_parser_omp_clause_final): Likewise.
1859         (cp_parser_omp_clause_if): Likewise.
1860         (cp_parser_omp_clause_num_threads): Likewise.
1861         (cp_parser_omp_clause_num_tasks): Likewise.
1862         (cp_parser_omp_clause_grainsize): Likewise.
1863         (cp_parser_omp_clause_priority): Likewise.
1864         (cp_parser_omp_clause_hint): Likewise.
1865         (cp_parser_omp_clause_defaultmap): Likewise.
1866         (cp_parser_omp_clause_ordered): Likewise.
1867         (cp_parser_omp_clause_schedule): Likewise.
1868         (cp_parser_omp_clause_num_teams): Likewise.
1869         (cp_parser_omp_clause_thread_limit): Likewise.
1870         (cp_parser_omp_clause_aligned): Likewise.
1871         (cp_parser_omp_clause_linear): Likewise.
1872         (cp_parser_omp_clause_safelen): Likewise.
1873         (cp_parser_omp_clause_simdlen): Likewise.
1874         (cp_parser_omp_clause_depend): Likewise.
1875         (cp_parser_omp_clause_device): Likewise.
1876         (cp_parser_omp_clause_dist_schedule): Likewise.
1877         (cp_parser_oacc_clause_async): Likewise.
1878         (cp_parser_omp_critical): Likewise.
1879         (cp_parser_omp_for_loop): Likewise.
1880         (cp_parser_omp_sections_scope): Likewise.
1881         (cp_parser_omp_declare_reduction_exprs): Likewise.
1882         Update for new param to cp_parser_required_error.
1883         (cp_parser_oacc_routine): Likewise.
1884         (cp_parser_transaction_expression): Likewise.
1885         (cp_parser_cilk_simd_vectorlength): Likewise.
1887 2017-08-09  Jason Merrill  <jason@redhat.com>
1889         PR c++/81525 - wrong constant value with generic lambda
1890         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
1891         (tsubst_copy) [VAR_DECL]: Handle auto.
1893         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1894         * init.c (get_nsdmi): Add complain parm.
1895         * typeck2.c (digest_nsdmi_init): Add complain parm.
1896         (process_init_constructor_record): Pass complain to get_nsdmi.
1897         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
1898         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
1899         synthesized_method_walk.
1900         (synthesized_method_walk): Adjust.
1901         (walk_field_subobs): Pass complain to get_nsdmi.
1902         (defaulted_late_check): Skip other checks if deleted.
1903         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
1904         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
1905         * parser.c (defarg_location): New.
1906         * error.c (location_of): Use it.
1908 2017-08-09  Marek Polacek  <polacek@redhat.com>
1910         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
1911         * typeck.c (build_binary_op): Change the type of a parameter to bool.
1912         (cp_truthvalue_conversion): Use true instead of 1.
1914 2017-08-08  Marek Polacek  <polacek@redhat.com>
1916         PR c++/81607
1917         * cp-gimplify.c (cp_fold): If folding exposed a branch of
1918         a COND_EXPR, convert it to the original type of the COND_EXPR, if
1919         they differ.               
1921 2017-08-08  Martin Liska  <mliska@suse.cz>
1923         * call.c: Include header files.
1924         * cp-gimplify.c: Likewise.
1925         * cp-ubsan.c: Likewise.
1926         * cvt.c: Likewise.
1927         * init.c: Likewise.
1928         * search.c: Likewise.
1929         * semantics.c: Likewise.
1930         * typeck.c: Likewise.
1932 2017-08-07  Martin Liska  <mliska@suse.cz>
1934         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
1935         attribute.
1936         (cp_parser_std_attribute): Likewise.
1937         * tree.c: Add new include.
1939 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
1941         PR c++/79790
1942         * pt.c (do_class_deduction): Handle the case of no viable implicit
1943         deduction guides; simplify the code generating implicit deduction
1944         guides.
1946 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
1948         PR c++/71440
1949         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
1950         destructor as expressions.
1952 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
1954         PR c++/81640
1955         * call.c (build_user_type_conversion_1): Only call
1956         lookup_fnfields_slot if totype is CLASS_TYPE_P.
1958 2017-07-31  Jason Merrill  <jason@redhat.com>
1960         * decl.c (declare_global_var): Set DECL_CONTEXT.
1962 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
1963             Martin Liska  <mliska@suse.cz>
1965         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
1966         * semantics.c (finish_goto_stmt): Build gimple predict
1967         stament.
1968         * constexpr.c (potential_constant_expression_1): Handle
1969         PREDICT_EXPR.
1971 2017-07-31  Martin Liska  <mliska@suse.cz>
1973         PR sanitize/81530
1974         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
1975         also with current_function_decl non-null equality.
1976         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
1977         * decl.c (compute_array_index_type): Likewise.
1978         * init.c (finish_length_check): Likewise.
1979         * typeck.c (cp_build_binary_op): Likewise.
1981 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
1983         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
1984         DW_AT_export_symbols.
1985         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
1986         argument, pass it through to the debug hook.
1987         (finish_namespace_using_directive): Adjust
1988         emit_debug_info_using_namespace caller.
1989         (push_namespace): Likewise.  Call it after setting
1990         DECL_NAMESPACE_INLINE_P.
1991         (cp_emit_debug_info_for_using): Pass false as new argument to
1992         the imported_module_or_decl debug hook.
1994 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
1996         * lex.c (copy_decl): Adjust.
1997         (copy_type): Likewise.
1999 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
2001         PR c++/71570
2002         * lambda.c (add_capture): Early return if we cannot capture by
2003         reference.
2005 2017-07-26  Jason Merrill  <jason@redhat.com>
2007         P0702R1 - List deduction of vector.
2008         * pt.c (do_class_deduction): Special-case deduction from a single
2009         element of related type.
2011 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
2013         PR c++/67054 - Inherited ctor with non-default-constructible members
2014         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2015         when deducing an inheriting constructor.
2017 2017-07-21  Nathan Sidwell  <nathan@acm.org>
2019         * search.c (lookup_conversion_operator): Return overloads.
2020         (lookup_fnfields_idx_nolazy): Absorb into ...
2021         (lookup_fnfields_slot_nolaxy): ... here.
2022         (lookup_fnfields_1): Absorb into ...
2023         (lookup_fnfields_slot): ... here.
2025         Remove special CDtor METHOD_VEC slots.
2026         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2027         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2028         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2029         (CLASSTYPE_DESTRUCTOR): Likewise.
2030         * class (add_method): Don't use special cdtor slots.
2031         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2032         (look_for_overrides_here): Use lookup_fnfields_slot.
2033         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2035         * call.c (add_candidates): Move decls to initialization.  Don't
2036         use !!.
2038 2017-07-20  Nathan Sidwell  <nathan@acm.org>
2040         Remove TYPE_METHODS.
2041         * class.c (maybe_warn_about_overly_private_class,
2042         finish_struct_methods, one_inheriting_sig, count_fields,
2043         add_fields_to_record_type, check_field_decls, check_methods,
2044         clone_function_decl, set_method_tm_attributes,
2045         finalize_literal_type_property, check_bases_and_members,
2046         create_vtable_ptr, determine_key_method,
2047         unreverse_member_declarations, finish_struct,
2048         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2049         * decl.c (fixup_anonymous_aggr): Likewise.
2050         * decl2.c (reset_type_linkage_2): Likewise.
2051         * method.c (after_nsdmi_defaulted_late_checks,
2052         lazily_declare_fn): Likewise.
2053         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2054         * pt.c (instantiate_class_template_1, tsubst_expr,
2055         do_type_instantiation, instantiate_pending_templates): Likewise.
2056         * search.c (lookup_field_1): Likewise.
2057         * semantics.c (finish_member_declaration,
2058         finish_omp_declare_simd_methods): Likewise.
2060 2017-07-19  Nathan Sidwell  <nathan@acm.org>
2062         * class.c (add_implicitly_declared_members): Use
2063         classtype_has_move_assign_or_move_ctor_p.
2064         (classtype_has_move_assign_or_move_ctor,
2065         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2066         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2067         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2068         Replace with ...
2069         (classtype_has_move_assign_or_move_ctor_p): ... this.
2070         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2071         * tree.c (type_has_nontrivial_copy_init): Adjust.
2073         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2074         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2076 2017-07-18  Nathan Sidwell  <nathan@acm.org>
2078         * cp-array-notation.c (build_array_notation_ref): Use
2079         TYPE_{MIN,MAX}_VALUE.
2081         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2082         (add_implicitly_declared_members): Use it.
2083         (type_has_move_constructor, type_has_move_assign): Merge into ...
2084         (classtype_has_move_assign_or_move_ctor): ... this new function.
2085         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2087 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
2089         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2090         friend outside class and obsolete auto as storage-class-specifier.
2092 2017-07-17  Nathan Sidwell  <nathan@acm.org>
2094         * class.c (maybe_warn_about_overly_private_class): Ignore public
2095         copy ctors.
2097         * class.c (type_has_user_declared_move_constructor,
2098         type_has_user_declared_move_assign): Combine into ...
2099         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2100         * cp-tree.h (type_has_user_declared_move_constructor,
2101         type_has_user_declared_move_assign): Combine into ...
2102         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2103         * method.c (maybe_explain_implicit_delete): Use it.
2104         (lazily_declare_fn): Use it.
2105         * tree.c (type_has_nontrivial_copy_init): Use it.
2107         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2108         semantics, simplify implementation.
2110 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
2112         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2113         in old-style cast diagnostic.
2114         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2115         in useless cast diagnostic.
2116         * error.c (type_to_string): Remove enum special handling.
2118 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
2120         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2121         the header names.
2122         (maybe_suggest_missing_header): Update for addition of '<' and '>'
2123         to above.  Provide a fix-it hint.
2124         * pt.c: Include "gcc-rich-location.h"
2125         (listify): Attempt to add fix-it hint for missing
2126         #include <initializer_list>.
2127         * rtti.c: Include "gcc-rich-location.h".
2128         (typeid_ok_p): Attempt to add fix-it hint for missing
2129         #include <typeinfo>.
2131 2017-07-12  Jason Merrill  <jason@redhat.com>
2133         P0512R0 - Deduction from an initializer list.
2134         * pt.c (do_class_deduction): Do list deduction in two phases.
2136 2017-07-12  Nathan Sidwell  <nathan@acm.org>
2138         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2139         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2140         identifier flags.
2141         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2142         DECL_CXX_DESTRUCTOR explicitly.
2143         * decl2.c (grokclassfn): Likewise.
2144         * friend.c (do_friend): Likewise.
2145         * method.c (make_thunk, make_alias_for,
2146         implicitly_declare_fn): Likewise.
2148 2017-07-11  Jason Merrill  <jason@redhat.com>
2150         Core DR 393
2151         * decl.c (grokparms): Downgrade error about array of unknown bound
2152         to pedwarn and disable it for C++17.
2154 2017-07-11  Nathan Sidwell  <nathan@acm.org>
2156         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2158 2017-07-10  Martin Sebor  <msebor@redhat.com>
2160         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2162 2017-07-06  Jason Merrill  <jason@redhat.com>
2164         PR c++/81204 - parse error with dependent template-name
2165         * parser.c (cp_parser_lookup_name): Revert previous change.
2167 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
2169         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2170         selftest::run_cp_tests.
2171         (selftest::run_cp_tests): New function.
2172         * cp-tree.h (selftest::run_cp_tests): New decl.
2174 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
2176         * parser.c (cp_parser_decomposition_declaration): Replace
2177         decomposition declaration with structured binding in diagnostics.
2178         * decl.c (cp_finish_decomp): Likewise.
2179         (grokdeclarator): Likewise.
2181         PR c++/81258
2182         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2183         forms of structured binding initializers.
2185 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
2187         PR c++/65775
2188         * decl.c (grokdeclarator): Move checks on function return type after
2189         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2190         is UNKNOWN_LOCATION fall back to input_location.
2192 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
2194         * parser.c (enum required_token): Fix spelling of
2195         RT_INTERATION to RT_ITERATION.
2196         (cp_parser_iteration_statement): Likewise.
2197         (cp_parser_required_error): Likewise.
2199 2017-06-30  Jason Merrill  <jason@redhat.com>
2201         PR c++/81257 - ICE with invalid ::template.
2202         PR c++/54769 - wrong lookup of dependent template-name.
2203         * parser.c (cp_parser_template_name): Revert part of last change.
2205 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2207         * config-lang.in (gtfiles): Add cp/lex.c.
2208         * cp-tree.h (mangle_convop_name_for_type): Rename ...
2209         (make_conv_op_name): ... here.  Move to lex.
2210         * lambda.c (maybe_add_lambda_conv_op): Update.
2211         * parser.c (cp_parser_conversion_function_id): Update.
2212         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2213         tsubst_copy_and_build): Update.
2214         * semantics.c (apply_deduced_return_type): Update.
2215         * mangle.c (conv_type_hasher, conv_type_names,
2216         mangle_conv_op_name_for_type): Move to ...
2217         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2218         ... here.  Rename.
2220 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
2222         PR c++/80014
2223         * parser.c (cp_parser_postfix_expression): Construct a location
2224         for typeid expressions.
2226 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2228         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2229         declare.
2230         (lookup_all_conversions): Declare.
2231         * class.c (get_basefndecls): Use lookup_fnfields_slot.
2232         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2233         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
2234         diagnostics.
2235         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2236         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2237         lookup_all_conversions.
2238         * search.c (lookup_fnfields_1): Make static.
2239         (lookup_all_conversions): New.
2240         (class_method_index_for_fn): Delete.
2241         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2242         lookup_fnfields_slot.
2244         * call.c (build_new_method_call_1): Use constructo_name to get
2245         ctor name.  Move argument processing earlier to merge cdtor
2246         handling blocks.
2247         * decl.c (grokfndecl): Cdtors have special names.
2248         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2249         * pt.c (check_explicit_specialization): Cdtor name is already
2250         special.
2251         * search.c (class_method_index_for_fn): Likewise.
2253         PR c++/81229
2254         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2255         a matching TYPE_DECL.
2257 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
2259         * class.c (add_method): Change pair of errors to error + inform.
2260         (handle_using_decl): Likewise.
2262 2017-06-29  Jason Merrill  <jason@redhat.com>
2264         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2266         PR c++/81180 - ICE with C++17 deduction of member class template.
2267         * pt.c (build_deduction_guide): Correct member template handling.
2269         PR c++/81188 - matching decltype of member function call.
2270         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2272 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2274         PR c++/81247
2275         * parser.c (cp_parser_namespace_definition): Immediately close the
2276         namespace if there's no open-brace.
2277         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2278         namespace.
2280 2017-06-29  Jason Merrill  <jason@redhat.com>
2282         PR c++/81164 - ICE with invalid inherited constructor.
2283         * search.c (binfo_direct_p): New.
2284         * name-lookup.c (do_class_using_decl): Use it.
2286 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2288         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2289         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2290         * decl.c (initialize_predefined_identifiers): Name cdtor special
2291         names consistently.  Use literals for above deleted defines.
2292         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2294         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2295         flag.
2297         * call.c (check_dtor_name): Use constructor_name for enums too.
2298         (build_new_method_call_1): Use constructor_name for cdtors and
2299         show ~ for dtor.
2300         * class.c (build_self_reference): Use TYPE_NAME to get name of
2301         self reference.
2302         * name-lookup (constructor_name): Use DECL_NAME directly.
2303         (constructor_name_p): Reimplement.
2304         (push_class_level_binding_1): Use TYPE_NAME directly.
2306         * class.c (finish_struct): Use OVL_P.
2307         (get_vfield_name): Measure constructor_name length.
2308         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2309         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2310         * cxx-pretty-print.c (is_destructor_name): Delete.
2311         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2312         * decl.c (grokfndecl): Move cheap checks first when looking for
2313         implicit extern cness.
2315         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2316         indentation. Remove unnecessary assignment of constructor name.
2318         Whitespace cleanups.
2319         * call.c (name_as_c_string): Move CONST_CAST to return.
2320         (build_new_method_call_1): Remove unneeded bracing.
2321         * class.c (include_empty_classes): Unbreak line.
2322         * constraint.cc (tsubst_check_constraint): Add space.
2323         * cp-tree.h (lang_decl_ns): Add comment.
2324         (PTRMEM_CST_MEMBER): Break line.
2325         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2326         (grokdeclarator): Remove lines, move declaration to first use.
2327         * decl2.c (decl_needed_p): Fix indentation.
2328         (c_parse_final_cleanups): Remove blank line.
2329         * method.c (implicitly_declare_fn): Move declaration to first use.
2330         * search.c (current_scope): Add blank lines.
2332 2017-06-28  Jason Merrill  <jason@redhat.com>
2334         PR c++/72764 - ICE with invalid template typename.
2335         * decl.c (build_typename_type): No longer static.
2336         * tree.c (strip_typedefs): Use it instead of make_typename_type.
2338         PR c++/69300 - ICE with self-referential noexcept
2339         * pt.c (maybe_instantiate_noexcept): Check for recursion.
2341         PR c++/61022 - error with variadic template template parm
2342         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2344         PR c++/72801 - ICE with variadic partial specialization
2345         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2347         PR c++/55639 - partial specialization with ::template
2348         * parser.c (cp_parser_class_head): Handle ::template.
2350         PR c++/45976 - error with ::template in declarator.
2351         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2353         PR c++/54769 - wrong lookup of dependent template-name.
2354         * parser.c (cp_parser_template_name): Handle dependent object type.
2355         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2356         parameter.
2357         (cp_parser_id_expression): Pass it.
2358         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2360         * parser.c (cp_parser_template_id): Use the range location on the
2361         TEMPLATE_ID_EXPR.
2363         PR c++/81204 - parse error with dependent template-name
2364         * parser.c (cp_parser_lookup_name): Disqualify function templates
2365         after lookup.
2367 2017-06-27  Nathan Sidwell  <nathan@acm.org>
2369         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2370         initialization point.  Don't unnecessarily check for ctor name.
2372         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2373         (CLASSTYPE_DESTRUCTOR): ... this.
2374         * class.c (accessible_nvdtor_p,
2375         maybe_warn_about_overly_private_class,
2376         add_implicitly_declared_members,
2377         clone_constructors_and_destructors, type_has_virtual_destructor):
2378         Adjust for CLASSTYPE_DESTRUCTOR.
2379         (deduce_noexcept_on_destructors): Absorb into ...
2380         (check_bases_and_members): ... here.
2381         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2382         * init.c (build_delete): Likewise.
2383         * parser.c (cp_parser_lookup_name): Likewise.
2384         * pt.c (check_explicit_specialization): Likewise.
2385         * rtti.c (emit_support_tinfos): Likewise.
2386         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2388         Kill IDENTIFIER_TEMPLATE.
2389         * cp-tree.h (lang_identifier): Remove class_template_info field.
2390         (IDENTIFIER_TEMPLATE): Delete.
2391         * name-lookup.c (constructor_name_full): Subsume into ...
2392         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
2393         (constructor_name_p): Likewise.
2394         * mangle.c (write_source_name): Likewise.
2395         * ptree.c (cxx_print_identifier): Likewise.
2397 2017-06-27  Marek Polacek  <polacek@redhat.com>
2399         PR bootstrap/81216
2400         * parser.c (cp_parser_already_scoped_statement): Initialize
2401         LOC_AFTER_LABELS.
2403 2017-06-26  Jason Merrill  <jason@redhat.com>
2405         PR c++/81215 - deduction failure with variadic TTP.
2406         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2408 2017-06-26  Martin Sebor  <msebor@redhat.com>
2410         PR c++/81169
2411         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2412         to detect casting away cv-qualifiers.
2414 2017-06-26  Nathan Sidwell  <nathan@acm.org>
2416         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2417         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2418         identifier.
2419         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2420         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2421         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2422         * decl.c (grok_op_properties): Adjust identifier checking.
2423         * init.c (expand_default_init): Adjust identifier descision.
2424         * method.c (implicitly_declare_fn): Don't use
2425         DECL_ASSIGNMENT_OPERATOR_P.
2426         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2427         IDENTIFIER_DTOR_P.
2428         * call.c (in_charge_arg_for_name): Reimplement.
2429         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2430         IDENTIFIER_DTOR_P.
2432 2017-06-26  Marek Polacek  <polacek@redhat.com>
2434         PR c/80116
2435         * parser.c (cp_parser_statement): Add a default argument.  Save the
2436         location of the expression-statement after labels have been parsed.
2437         (cp_parser_implicitly_scoped_statement): Set the location of the
2438         body of the conditional after parsing all the labels.  Call
2439         warn_for_multistatement_macros.
2440         (cp_parser_already_scoped_statement): Likewise.
2442 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
2444         PR c++/62315
2445         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2446         'typename' in error messages about missing 'typename'.
2448 2017-06-23  Jason Merrill  <jason@redhat.com>
2450         PR c++/79056 - C++17 ICE with invalid template syntax.
2451         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2452         is a TYPE_DECL.
2453         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2454         * pt.c (template_placeholder_p): New.
2455         * cp-tree.h: Declare it.
2457 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
2459         * decl.c (duplicate_decls): Use builtin_structptr_types.
2461 2017-06-22  Nathan Sidwell  <nathan@acm.org>
2463         Reorder IDENTIFIER flags
2464         gcc/cp/
2465         * cp-tree.h (enum cp_identifier_kind): New.
2466         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2467         IDENTIFIER_KIND_BIT_2): New.
2468         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2469         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2470         (C_IS_RESERVED_WORD): Replace with ...
2471         (IDENTIFIER_KEYWORD_P): ... this.
2472         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2473         (IDENTIFIER_CDTOR_P): ... this.
2474         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2475         (IDENTIFIER_OPNAME_P): Replace with ...
2476         (IDENTIFIER_ANY_OP_P): ... this.
2477         (IDENTIFIER_ASSIGN_OP_P): New.
2478         (IDENTIFIER_TYPENAME_P): Replace with ...
2479         (IDENTIFIER_CONV_OP_P): ... this.
2480         (NEW_DELETE_OPNAME_P): Replace with ...
2481         (IDENTIFIER_NEWDEL_OP_P): ... this.
2482         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2483         (get_identifier_kind_name, set_identifier_kind): Declare.
2484         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2485         (init_operators): Adjust to avoid keywords, use
2486         set_identifier_kind. Copy TYPE_EXPR slot.
2487         (init_reswords): Call set_identifier_kind.
2488         (unqualified_name_lookup_error): Adjust.
2489         * operators.def (TYPE_EXPR): Remove.
2490         * decl.c (struct predefined_identifier): Move into ...
2491         (initialize_predefined_identifiers): ... here.  Call
2492         set_identifier_kind.
2493         (grokfndecl, check_var_type, grokdeclarator): Adjust.
2494         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2495         space.  Adjust.
2496         * call.c (name_as_c_string): Adjust.
2497         (build_new_method_call_1): Likewise.
2498         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2499         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2500         * dump.c (cp_dump_tree): Adjust.
2501         * error.c (dump_decl_name): Adjust.
2502         * mangle.c (write_unqualified_id, write_member_name,
2503         write_expression): Adjust.
2504         (mangle_conv_op_name_for_type): Use set_identifier_kind.
2505         * name-lookup.c (do_class_using_decl): Adjust.
2506         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2507         * parser.c (cp_lexer_get_preprocessor_token,
2508         cp_parser_direct_declarator): Likewise.
2509         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2510         tsubst_copy, tsubst_copy_and_build): Adjust.
2511         * ptree.c (cxx_print_identifier): Print identifier kind.
2512         * search.c (lookup_field_r, lookup_member,
2513         lookup_fnfields_idx_nolazy): Adjust.
2514         * semantics.c (finish_id_expression): Adjust..
2515         * typeck.c (cp_build_addr_expr_1): Adjust.
2517 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
2519         PR c++/81154
2520         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2521         Complain about t not being a variable if t is OVERLOAD even
2522         when processing_template_decl.
2524 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
2526         * parser.c (get_cast_suggestion): New function.
2527         (maybe_add_cast_fixit): New function.
2528         (cp_parser_cast_expression): Capture the location of the closing
2529         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
2530         about old-style casts.
2532 2017-06-20  Jason Merrill  <jason@redhat.com>
2534         PR c++/80972 - C++17 ICE with attribute packed.
2535         * call.c (build_over_call): Allow a TARGET_EXPR from reference
2536         binding.
2538 2017-06-20  Nathan Sidwell  <nathan@acm.org>
2540         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2541         (nelts_identifier): Delete.
2542         * decl.c (initialize_predefined_identifiers): Remove nelts.
2544         PR c++/67074 - namespace aliases
2545         * decl.c (duplicate_decls): Don't error here on mismatched
2546         namespace alias.
2547         * name-lookup.c (name_lookup::add_value): Matching namespaces are
2548         not ambiguous.
2549         (diagnose_name_conflict): Namespaces are never redeclarations.
2550         (update_binding): An alias can match a real namespace.
2552 2017-06-19  Jason Merrill  <jason@redhat.com>
2554         PR c++/80562 - ICE with constexpr if.
2555         * semantics.c (finish_if_stmt_cond): Call
2556         instantiate_non_dependent_expr.
2558         PR c++/80829 - ICE with constexpr copy of base subobject.
2559         * constexpr.c (clear_no_implicit_zero): New.
2560         (cxx_eval_call_expression): Call it.
2562 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2564         PR c++/81124
2565         PR c++/79766
2566         * name-lookup.c (set_decl_namespace): Don't follow using
2567         directives and ignore using decls.  Only check overly-explicit
2568         scope after discovering decl.
2570 2017-06-19  Jason Merrill  <jason@redhat.com>
2572         PR c++/81073 - constexpr and static var in statement-expression.
2573         * typeck2.c (store_init_value): Always call
2574         require_potential_constant_expression.
2575         * pt.c (convert_nontype_argument): Likewise.
2576         * constexpr.c (potential_constant_expression_1): Adjust message.
2577         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2578         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2580 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2582         * pt.c (coerce_template_parms): Fix indentation.
2583         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
2584         in to single block.
2586         PR c++/81119
2587         * name-lookup.c (update_binding): Only warn about constructors
2588         hidden by functions.
2590 2017-06-17  Jason Merrill  <jason@redhat.com>
2592         PR c++/60063 - -Wunused-local-typedefs and templates.
2593         * decl2.c (is_late_template_attribute): Return false for "used".
2595         PR c++/70844 - -Wuseless-cast and inheriting constructor.
2596         * method.c (forward_parm): Suppress warn_useless_cast.
2598 2017-06-16  Jason Merrill  <jason@redhat.com>
2600         PR c++/81045 - Wrong type-dependence with auto return type.
2601         * pt.c (type_dependent_expression_p): An undeduced auto outside the
2602         template isn't dependent.
2603         * call.c (build_over_call): Instantiate undeduced auto even in a
2604         template.
2606         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2607         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2608         set longer for a generic lambda.
2610         PR c++/80614 - Wrong mangling for C++17 noexcept type
2611         * mangle.c (write_type): Put the eh spec back on the function type.
2613         PR c++/81102 - Wrong error with partial specialization.
2614         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2615         types.  Do type deduction later.
2617         PR c++/81074 - ICE with partial specialization of member template.
2618         PR c++/71747
2619         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2621         PR c++/80831 - ICE with -fsyntax-only.
2622         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2624         PR c++/80639 - ICE with invalid PMF initialization.
2625         PR c++/80043 - ICE with -fpermissive
2626         * typeck.c (convert_for_assignment): Recurse when instantiate_type
2627         returns without an error.
2629 2017-06-16  Nathan Sidwell  <nathan@acm.org>
2631         * pt.c (tsubst_baselink): Fix & clarify formatting.
2633         * cp-tree.h (build_this_parm, cp_build_parm_decl,
2634         build_artificial_parm): Add FN parm.
2635         * decl.c (start_cleanup_fn): Adjust.
2636         (build_this_parm): Add FN parm, pass it through.
2637         (grokfndecl): Adjust parm building.
2638         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2639         (build_artificial_parm): Add FN parm, pass through.
2640         (maybe_retrofit_in_chrg): Adjust parm building.
2641         (start_static_storage_duration_function): Likwise.
2642         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2643         * method.c (implicitly_declare_fn): Likewise.
2644         * parser.c (inject_this_parameter): Likewise.
2646         Symbol tables are insert only.
2647         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2648         derive from pointer_hash.  Make undeletable.
2650         * class.c (resort_type_method_vec): Avoid potential unsigned
2651         overflow.
2653         Don't defer noexcept_deferred_spec.
2654         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2655         * decl.c (cxx_init_decl_processing): Initialize
2656         noexcept_deferred_spec.
2657         * except.c (unevaluated_noexcept_spec): Delete.
2658         * class.c (deduce_noexcept_on_destructor): Use
2659         noexcept_deferred_spec directly.
2660         * method.c (implicitly_declare_fn): Likewise.
2662         Make keyed_classes a vector.
2663         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2664         (keyed_classes): Declare as vector.
2665         * decl.c (keyed_classes): Define.
2666         (cxx_init_decl_processing): Allocate it.
2667         (record_key_method_defined): Use vec_safe_push.
2668         * class.c (finish_struct_1): Likewise.
2669         * pt.c (instantiate_class_template_1): Likewise.
2670         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2672         Make rtti lazier
2673         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2674         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
2675         (tinfo_names): New.
2676         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
2677         (get_tinfo_decl): Use get_tinfo_desc.
2678         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2679         (create_pseudo_type_info): Delete.
2680         (get_pseudo_ti_index): Just determine the index.
2681         (get_tinfo_desc): New.  Create all types lazily.
2682         (create_tinfo_types): Just allocate the descriptor array.
2683         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
2684         location.
2686 2017-06-15  Martin Sebor  <msebor@redhat.com>
2688         PR c++/80560
2689         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2690         functions.
2691         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2692         (build_cxx_call): Call maybe_warn_class_memaccess.
2694 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
2696         * cp-gimplify.c (cp_genericize_r): Turn most of the function
2697         into a switch (TREE_CODE (stmt)) statement from long else if
2698         sequence.
2700 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
2702         PR c++/80973
2703         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2704         argument even if it has REFERENCE_TYPE.
2706         PR c++/80984
2707         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2708         BLOCK_VARS (outer) chain.
2709         (cxx_omp_const_qual_no_mutable): Likewise.
2711 2017-06-13  Martin Liska  <mliska@suse.cz>
2713         PR sanitize/78204
2714         * class.c (build_base_path): Use sanitize_flags_p.
2715         * cp-gimplify.c (cp_genericize_r): Likewise.
2716         (cp_genericize_tree): Likewise.
2717         (cp_genericize): Likewise.
2718         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2719         * decl.c (compute_array_index_type): Likewise.
2720         (start_preparsed_function): Likewise.
2721         * decl2.c (one_static_initialization_or_destruction): Likewise.
2722         * init.c (finish_length_check): Likewise.
2723         * lambda.c (maybe_add_lambda_conv_op): Likewise.
2724         * typeck.c (cp_build_binary_op): Likewise.
2725         (build_static_cast_1): Likewise.
2727 2017-06-11  Jason Merrill  <jason@redhat.com>
2729         * error.c (dump_expr): Use is_this_parameter.
2731         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2732         id_equal.
2734 2017-06-09  Jason Merrill  <jason@redhat.com>
2736         Missing bits from N4268, constant evaluation for all non-type args.
2737         * call.c (build_converted_constant_expr): Rename from
2738         build_integral_nontype_arg_conv, handle all types.
2739         * pt.c (convert_nontype_argument): In C++17 call it for all types.
2740         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2741         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2743         Overhaul pointer-to-member conversion and template argument handling.
2744         * call.c (standard_conversion): Avoid creating ck_pmem when the
2745         class type is the same.
2746         * cvt.c (can_convert_qual): Split from
2747         perform_qualification_conversions.
2748         * constexpr.c (cxx_eval_constant_expression): Check it.
2749         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2750         adjustment is necessary.
2751         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2752         (convert_nontype_argument): Avoid redundant error.
2754         * call.c (convert_like_real): Remove "inner" parameter.
2755         Don't replace a constant with its value.
2756         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2758         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2759         nullptr_node.
2761         * parser.c (cp_parser_constant_expression): Check
2762         potential_rvalue_constant_expression after decay_conversion.
2763         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2765         PR c++/80384 - ICE with dependent noexcept-specifier
2766         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2767         noexcept-specifier.
2769         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2771 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
2773         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2774         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2775         (excpet.c): Mark terminate as cold.
2777 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
2779         PR c/81006
2780         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2781         to sizetype before size_binop.
2783         PR c++/81011
2784         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2785         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2786         and OMP_CLAUSE_SHARED_READONLY flags.
2788 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
2790         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2792 2017-06-07  Nathan Sidwell  <nathan@acm.org>
2794         * class.c (layout_class_type): Restructure overlong-bitfield tpe
2795         search.
2797 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
2799         PR c++/80990
2800         * pt.c (do_class_deduction): Build qualified type.
2802 2017-06-06  Nathan Sidwell  <nathan@acm.org>
2804         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2805         sans using directives.  Don't walk into inline namespaces.
2807         PR c++/80979
2808         * name-lookup.c (adl_class_only): Don't add visible friends.
2810 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
2812         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
2814 2017-06-02  Nathan Sidwell  <nathan@acm.org>
2816         Remove lang_type_ptrmem.
2817         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
2818         into ...
2819         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
2820         (lang_type): ... this.  Delete old definition.
2821         (lang_type_ptrmem): Delete.
2822         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
2823         (LANG_TYPE_PTRMEM_CHECK): Delete.
2824         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
2825         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
2826         * decl.c (build_ptrmemfunc_type): Adjust.
2827         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
2828         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
2829         
2830         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
2831         setting.
2832         
2833         Remove cp_binding_level::namespaces
2834         * name-lookup.h (cp_binding_level): Lose namespaces field.
2835         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
2836         list.
2837         (suggest_alternatives_for): Adjust for namespace list.  Do
2838         breadth-first search.
2839         * decl2.c (collect_source_refs): Namespaces are on the regulr
2840         list.
2841         (collect_ada_namespace): Likewise.
2843 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2845         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
2846         warning.
2848 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
2850         PR c++/80812
2851         * method.c (constructible_expr): Strip array types before calling
2852         build_value_init.
2854 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
2856         PR c++/80896
2857         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
2858         for case INDIRECT_REF too in the main switch.
2860 2017-05-31  Jason Merrill  <jason@redhat.com>
2862         PR c++/80840 - ICE with constexpr and reference
2863         * pt.c (convert_nontype_argument): Don't test whether a decl is
2864         value-dependent when binding to a reference.
2866 2017-05-31  Nathan Sidwell  <nathan@acm.org>
2868         * cp-tree.h (lang_decl_slector): New enum.
2869         (lang_decl_base): Make selector an enum.  Drop decomposition_p
2870         field.
2871         (lang_decl): Use enum for discrimination.
2872         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
2873         LANG_DECL_DEOMP_CHECK): Use enum.
2874         (DECL_DECOMPOSITION_P): Use selector value.
2875         (SET_DECL_DECOMPOSITION_P): Delete.
2876         (retrofit_lang_decl): Lose SEL parm.
2877         (fit_decomposition_lang_decl): Declare.
2878         * decl.c (cp_finish_decomp, grokdeclarator): Use
2879         fit_decomposition_lang_decl.
2880         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
2881         retrofit_lang_decl.
2882         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
2883         (fit_decomposition_lang_decl): Likewise.
2884         (retrofit_lang_decl): Use worker functions.
2885         (cxx_dup_lang_specific_decl): Use selector enum.
2886         (maybe_add_lang_type_raw): New.  Broken out of ...
2887         (cxx_make_type_name): ... here.  Call it.
2889 2017-05-30  Jason Merrill  <jason@redhat.com>
2891         PR c++/80856 - ICE with local extern in template
2892         * semantics.c (finish_call_expr): Replace a local extern overload
2893         set in a template with the IDENTIFIER_NODE.
2895 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
2897         * call.c (perform_implicit_conversion_flags): Convert
2898         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
2899         (print_conversion_rejection): Replace pairs of %qT with
2900         %qH and %qI in various places.
2901         (build_user_type_conversion_1): Likewise.
2902         (build_integral_nontype_arg_conv): Likewise.
2903         (build_conditional_expr_1): Likewise.
2904         (convert_like_real): Likewise.
2905         (convert_arg_to_ellipsis): Likewise.
2906         (joust): Likewise.
2907         (initialize_reference): Likewise.
2908         * cvt.c (cp_convert_to_pointer): Likewise.
2909         (cp_convert_to_pointer): Likewise.
2910         (convert_to_reference): Likewise.
2911         (ocp_convert): Likewise.
2912         * error.c (cp_printer): Gain bool and const char ** parameters.
2913         (struct deferred_printed_type): New struct.
2914         (class cxx_format_postprocessor): New class.
2915         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
2916         to pp->m_format_postprocessor.
2917         (comparable_template_types_p): New function.
2918         (newline_and_indent): New function.
2919         (arg_to_string): New function.
2920         (print_nonequal_arg): New function.
2921         (print_template_differences): New function.
2922         (type_to_string_with_compare): New function.
2923         (print_template_tree_comparison): New function.
2924         (append_formatted_chunk): New function.
2925         (add_quotes): New function.
2926         (cxx_format_postprocessor::handle): New function.
2927         (defer_phase_2_of_type_diff): New function.
2928         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
2929         %H and %I.
2930         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
2931         %qH and %qI in various places.
2932         (convert_member_func_to_ptr): Likewise.
2933         (build_reinterpret_cast_1): Likewise.
2934         (convert_for_assignment): Likewise.
2935         * typeck2.c (check_narrowing): Likewise.
2937 2017-05-30  Nathan Sidwell  <nathan@acm.org>
2939         Kill IDENTIFIER_NAMESPACE_BINDINGS
2940         * cp-tree.h (lang_identifier): Delete namespace_bindings.
2941         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
2942         (lang_decl_ns): Add bindings.
2943         (DECL_NAMESPACE_BINDINGS): New.
2944         * lex.c (retrofit_lang_decl): Create namespace hash table.
2945         * name-lookup.c (find_namespace_slot): Change to use hash-map.
2946         * ptree.c (cxx_print_binding): Delete.
2947         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
2949         * cp-tree.def (OVERLOAD): Fix comment.
2950         * cp-tree.h: Fix comments and whitespace.
2951         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
2952         * name-lookup.c (add_decl_to_level): Assert not class.
2953         (check_local_shadow): Use OVL_P.
2954         (pushdecl_with_scope_1): Rename to ...
2955         (do_pushdecl_with_Scope): ... here.
2956         (do_nonmember_using_decl): Use qualified_namespace_lookup return
2957         value.
2958         (push_class_level_binding_1): Use OVL_P.
2959         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
2960         (pushtag_1): Rename to ...
2961         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
2962         (pushtag): Adjust.
2963         (store_class_bindings): Do not time here.
2964         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
2965         * pt.c (listify): Declare argvec at point of initialization.
2967         PR c++/80913
2968         * name-lookup.c (add_decl_to_level): Assert not making a circular
2969         chain.
2970         (update_binding): Don't prematurely slide artificial decl.
2972 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
2974         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
2976 2017-05-29  Nathan Sidwell  <nathan@acm.org>
2978         PR c++/80891 (#1,#5)
2979         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
2980         * name-lookup.c (name_lookup): Add deduping field.
2981         (name_lookup::preserve_state, name_lookup::restore_state): Deal
2982         with deduping.
2983         (name_lookup::add_overload): New.
2984         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
2985         (name_lookup::search_adl): Set deduping.  Don't unmark here.
2986         * pt.c (most_specialized_instantiation): Revert previous change,
2987         Assert not given duplicates.
2988         * tree.c (lookup_mark): Just mark the underlying decls.
2989         (lookup_maybe_add): Dedup using marked decls.
2991         PR c++/80891 (#4)
2992         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
2993         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
2995         Stat hack representation
2996         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
2997         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
2998         (stat_hack): New.
2999         (find_namespace_binding): Replace with ...
3000         (find_namespace_slot): ... this.
3001         (find_namespace_value): New.
3002         (name_lookup::search_namespace_only,
3003         name_lookup::adl_namespace_only): Adjust.
3004         (update_binding): Add SLOT parameter, adjust.
3005         (check_local_shadow): Use find_namespace_value.
3006         (set_local_extern_decl_linkage): Likewise.
3007         (do_pushdecl): Adjust for namespace slot.
3008         (push_local_binding): Assert not a namespace binding.
3009         (check_for_out_of_scope_variable): Use find_namespace_value.
3010         (set_identifier_type_value_with_scope): Likewise.
3011         (get_namespace_binding): Likewise.
3012         (set_namespace_binding): Delete.
3013         (set_global_binding): Directly update the binding.
3014         (finish_namespace_using_decl): Likewise.
3015         (lookup_type_scope_1): Use find_namespace_slot and update.
3016         (do_push_nested_namespace): Use find_namespace_value.
3018         PR c++/80891 (#1)
3019         * pt.c (most_specialized_instantiation): Cope with duplicate
3020         instantiations.
3022         PR c++/80891 (#3)
3023         * cp-tree.h (build_min_nt_call_vec): Declare.
3024         * decl.c (build_offset_ref_call_from_tree): Call it.
3025         * parser.c (cp_parser_postfix_expression): Likewise.
3026         * pt.c (tsubst_copy_and_build): Likewise.
3027         * semantics.c (finish_call_expr): Likewise.
3028         * tree.c (build_min_nt_loc): Keep unresolved lookups.
3029         (build_min): Likewise.
3030         (build_min_non_dep): Likewise.
3031         (build_min_non_dep_call_vec): Likewise.
3032         (build_min_nt_call_vec): New.
3034         PR c++/80891 (#2)
3035         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3036         (ovl_used): New.
3037         (lookup_keep): Call it.
3039 2017-05-26  Nathan Sidwell  <nathan@acm.org>
3041         Implement DR2061
3042         * name-lookup.c (push_inline_namespaces): New.
3043         (push_namespace): Look inside inline namespaces.
3045         Inline and using namespace representation change.
3046         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
3047         inlinees as vector.
3048         (DECL_NAMESPACE_USING): Adjust.
3049         (DECL_NAMESPACE_INLINEES): New.
3050         * name-lookup.h (struct cp_binding_level): Change usings
3051         representation.
3052         * name-lookup.c (name_lookup::do_queue_usings,
3053         name_lookup::queue_usings): Adjust.
3054         (name_lookup::search_namespace, name_lookup::search_usings,
3055         name_lookup::queue_namespace): Adjust.
3056         (name_lookup::adl_namespace_only): Adjust.
3057         (add_using_namespace, push_namespace): Push onto vector.
3058         (pop_namespace): Add timing logic.
3060         * call.c (build_operator_new_call): Do namelookup and ADL here.
3061         (build_new_op_1): Likewise.
3062         * name-lookup.h (lookup_function_nonclass): Delete declaration.
3063         (do_using_directive): Likewise.
3064         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3065         declare early.
3066         (struct scope_binding): Delete.
3067         (EMPTY_SCOPE_BINDING): Delete.
3068         (set_decl_namespace): Use OVL_P.
3069         (finish_local_using_decl): Lose unnecesary checks.
3070         (lookup_function_nonclass): Delete.
3071         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3073         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3074         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
3075         unduplicatable.
3076         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3077         (lkp_iterator): Add outer field.  Adjust ctor.
3078         (lkp_iterator::operator++): New.
3079         (lookup_mark, lookup_maybe_add): Declare.
3080         * name-lookup.c (name_lookup): Delete fn_set member.
3081         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3082         and mark lookup.
3083         (name_lookup::add_value): Use lookup_add directly.
3084         (name_lookup::add_fns: Use lookup_maybe_add.
3085         (name_lookup::search_adl): Mark and unmark fns.
3086         (pushdecl): Adjust.
3087         * pt.c (check_explicit_specialization): Use lookup_add directly.
3088         * ptree.c (cxx_print_xnode): Show complete overload structure.
3089         * tree.c (lookup_mark, lookup_maybe_add): New.
3091         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3093 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
3095         * cp-tree.h (struct lang_decl_decomp): New type.
3096         (struct lang_decl): Add u.decomp.
3097         (LANG_DECL_DECOMP_CHECK): Define.
3098         (DECL_DECOMPOSITION_P): Note it is set also on the vars
3099         for user identifiers.
3100         (DECL_DECOMP_BASE): Define.
3101         (retrofit_lang_decl): Add extra int = 0 argument.
3102         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3103         use it to influence the selector choices and for selector
3104         0 to non-zero transition copy old content.
3105         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3106         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3107         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
3108         wording if decl is a structured binding.
3109         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3110         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
3111         of individual variables for tuple structured bindings.
3112         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3113         Clear DECL_DECOMP_BASE.
3114         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3115         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3116         is expected.
3117         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3118         DECL_VALUE_EXPR.
3120 2017-05-25  Jason Merrill  <jason@redhat.com>
3122         PR c++/80605 - __is_standard_layout and zero-length array
3123         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3125 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3127         Kill OVL_CURRENT, OVL_NEXT.
3128         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3129         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3130         (consider_binding_level): Use OVL_FIRST.
3131         (cp_emit_debug_info_for_using): Use lkp_iterator.
3132         * pt.c (check_explicit_specialization): Use ovl_iterator.       
3134         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3135         * cp-tree.h (lang_decl_ns): Remove ns_users field.
3136         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3137         (TREE_INDIRECT_USING): Delete.
3138         * name-lookup.h (is_associated_namespace): Delete.
3139         * name-lookup.c (name_lookup::search_usings,
3140         name_lookup::do_queue_usings): Usings are always direct.
3141         (is_associated_namespace): Delete.
3142         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3143         (namespace_ancestor_1, namespace_ancestor): Delete.
3144         (push_using_directive_1, push_using_directive): Delete.
3145         (add_using_namespace_1): Delete.
3146         (add_using_namespace): Reimplement.
3147         (emit_debug_info_using_namespace): New.
3148         (finish_namespace_using_directive, finish_local_using_directive,
3149         push_namespace): Adjust.
3150         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3152 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
3154         * semantics.c (finish_handler_parms): Warn about non-reference type
3155         catch handlers.
3157 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3159         Reimplement unqualified namespace lookup.
3160         * name-lookup.c (name_lookup::using_pair,
3161         name_lookup::using_queue): New typedefs.
3162         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3163         name_lookup::queue_usings): New.
3164         (name_lookup::search_unqualified): New.
3165         (merge_functions, same_entity_p, ambiguous_decl,
3166         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3167         lookup_using_namespace): Delete.
3168         (lookup_name_real_1): Adjust.
3170         Reimplement qualified namespace lookup.
3171         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
3172         (name_lookup::ambiguous, name_lookup::add_value,
3173         name_lookup::add_type, name_lookup::process_binding): New.
3174         (name_lookup::search_namespace_only,
3175         name_lookup::search_namespace, name_lookup::search_usings): New.
3176         (name_lookup::search_qualified): New.
3177         (do_nonmember_using_decl, suggest_alternatives_for,
3178         lookup_qualified_name): Adjust.
3179         (tree_vec_contains): Delete.
3180         (qualified_lookup_using_namespace): Rename to ...
3181         (qualified_namespace_lookup): ... here.  Reimplement.
3183         Reimplement ADL.
3184         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3185         * name-lookup.h (lookup_arg_dependent): Return plain tree.
3186         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3187         arg_assoc_args_vec, arg_assoc_type, add_function,
3188         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3189         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3190         lookup_arg_dependent_1): Delete.
3191         (name_lookup): New lookup object.
3192         (name_lookup::preserve_state, name_lookup::restore_state,
3193         name_lookup::mark_seen, name_lookup::find_and_mark,
3194         name_lookup::add_fns, name_lookup::adl_namespace_only,
3195         name_lookup::adl_namespace, name_lookup::adl_class_only,
3196         name_lookup::adl_bases, name_lookup::adl_class,
3197         name_lookup::adl_expr, name_lookup::adl_type,
3198         name_lookup::adl_template_arg, name_lookup::search_adl): New.
3199         (lookup_arg_dependent): Return a plain tree.  Adjust.
3200         (is_associated_namespace): Move later.
3201         
3202 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3204         * friend.c (do_friend): Remove check for existing decl.
3205         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3206         * name-lookup.c (push_local_binding): Directly look for binding.
3207         (lookup_name_innermost_nonclass_level_1): Delete.
3208         (lookup_name_innermost_nonclass_level): Delete.
3210         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3212         * cp-tree.h (cp_free_lang_data): Add extern.
3213         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3214         ATTRIBUTE_PURE.
3215         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3216         * typeck.c (type_unknown_p): Delete.
3217         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3218         overload management.
3219         (dependent_name): Likewise.
3220         (decl_anon_ns_mem_p): Simplify.
3222 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
3224         PR c++/80544
3225         * tree.c (reshape_init): Use unqualified type for direct enum init.
3226         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3227         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3228         non-class destination types.
3229         (build_const_cast_1): Strip cv-quals from destination types.
3230         (build_static_cast, build_reinterpret_cast, build_const_cast)
3231         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3233 2017-05-24  Martin Sebor  <msebor@redhat.com>
3235         PR c/80731
3236         * call.c (fully_fold_internal): Adjust.
3238 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3240         * cp-tree.h (ovl_skip_hidden): Declare.
3241         * tree.c (ovl_skip_hidden): New.
3242         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3243         (lookup_arg_dependent_1): Likewise.
3244         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3245         (hidden_name_p, remove_hidden_names): Delete.
3246         (lookup_name_real_1): Do not strip hidden names.
3247         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3249         * cp-tree.h (OVL_HIDDEN_P): New.
3250         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3251         (ovl_iterator::reveal_node): Declare.
3252         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3253         (ovl_insert): Order on hiddenness.
3254         (ovl_iterator::reveal_node): New.
3255         * name-lookup.c (anticipated_builtin_p): New.
3256         (supplement_binding_1): Use it.
3257         (set_local_extern_decl_linkage): Use hidden_p.
3258         (do_pushdecl): Deal with unhiding a hidden decl, use
3259         anticipated_builtin_p.
3260         (do_nonmember_using_decl): Use anticipated_decl_p.
3261         (lookup_name_real_1): Use DECL_HIDDEN_P.
3263 2017-05-23  Jason Merrill  <jason@redhat.com>
3265         -Wunused and C++17 structured bindings
3266         * decl.c (poplevel): Don't warn about unused structured bindings,
3267         only real variables.
3268         * error.c (dump_simple_decl): Handle structured bindings.
3269         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3271 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3273         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3274         * name-lookup.c (create_local_binding): New.
3275         (update_binding): New.
3276         (pushdecl_maybe_friend_1): Rename to ...
3277         (do_pushdecl): ... this.  Reimplement.
3278         (pushdecl): Adjust.
3279         (push_overloaded_decl_1, push_overloaded_decl): Delete.
3281 2017-05-23  Jason Merrill  <jason@redhat.com>
3283         PR c++/80396 - built-in for make_integer_sequence.
3284         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3285         (expand_integer_pack, expand_builtin_pack_call): New.
3286         (find_parameter_packs_r): Check builtin_pack_call_p.
3287         (check_for_bare_parameter_packs): Handle it.
3288         (tsubst_pack_expansion): Call expand_builtin_pack_call.
3289         (declare_integer_pack): New.
3290         (init_template_processing): Call it.
3291         * decl2.c (mark_used): Check builtin_pack_fn_p.
3293 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3295         * name-lookup.c (find_namespace_binding): New.
3296         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3297         (set_identifier_type_value_with_scope): Use find_namespace_binding.
3298         (find_binding, cp_binding_level_find_binding_for_name,
3299         binding_for_name, namespace_binding_1): Delete.
3300         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3301         (get_namespace_binding, set_namespace_binding,
3302         finish_namespace_using_decl, unqualified_namespace_lookup_1,
3303         qualified_lookup_using_namespace, lookup_type_scope_1,
3304         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3306         PR c++/80866
3307         * parser.c (cp_parser_template_id): Keep the lookup when stashing
3308         the template_id.
3310         * cp-tree.h (DECL_HIDDEN_P): New.
3311         * name-lookup.c (set_decl_context,
3312         set_local_extern_decl_linkage): New, broken out of ...
3313         (pushdecl_maybe_friend_1): ... here.  Call them.
3315 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
3317         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3318         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3319         "VECTOR_LENGTH".
3321 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3323         * cp-tree.h (OVL_P): New.
3324         * name-lookup.h (push_local_binding): Delete.
3325         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3326         (finish_namespace_using_decl, finish_local_using_decl): ... here
3327         * name-lookup.c (add_decl_to_level): Swap args.
3328         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3329         (diagnose_name_conflict): Check contexts are same for redecl.
3330         (update_local_overload): New.
3331         (compparms_for_decl_and_using): Rename to ...
3332         (matching_fn_p): ... here.
3333         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3334         push_local_bindings call.
3335         (push_local_binding): Make static, replace FLAGS arg with
3336         IS_USING.
3337         (validate_nonmember_using_decl): Use OVL_FIRST.
3338         (do_nonmember_using_decl): Use in/out parameters.  Use
3339         lkp_iterator and simplify.
3340         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3341         (finish_namespace_using_decl, finish_local_using_decl): ... here.
3342         Adjust.
3343         (lookup_type_current_level): Delete.
3344         * parser.c (cp_parser_using_declaration): Adjust.
3345         * pt.c (tsubst_expr): Adjust.
3347 2017-05-22  Nathan Sidwell  <nathan@acm.org>
3349         * name-lookup.h (parse_using_directive): Replace with ...
3350         (finish_namespace_using_directive): ... this and ...
3351         (finish_local_using_directive): ... this.
3352         * name-lookup.c (add_using_namespace_1): Move later.
3353         (add_using_namespace): Move later, add namespace_p arg, remove
3354         indirect arg.
3355         (push_using_directive_1): Directly recurse.
3356         (do_using_directive, parse_using_directive): Delete, split into ...
3357         (finish_namespace_using_directive): ... this and ...
3358         (finish_local_using_directive): ... this.
3359         (push_namespace): Use add_using_namespace.
3360         * parser.c (cp_parser_using_directive): Call
3361         finish_namespace_using_directive or finish_local_using_directive.
3362         * pt.c (tsubst_expr): Call finish_local_using_directive.
3364         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3365         * cp-tree.h (raw_dump_id): Declare.
3366         * decl2.c (raw_dump_id): Define.
3367         (dump_tu): Use raw_dump_id.
3369         * config-lang.in (gtfiles): Sort list, break lines.
3371         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3372         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3373         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3374         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3375         CPTI_RETHROW_FN): New.
3376         (noexcept_deferred_spec): New.
3377         (terminate_node, call_unexpected_node): Rename to ...
3378         (terminate_fn, call_unexpected_fn): ... here.
3379         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3380         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3381         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3382         (init_exception_processing): Adjust.
3383         (declare_library_fn): Create and push the fns here.
3384         (do_get_exception_ptr, do_begin_catch, do_end_catch,
3385         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3386         declare_library_fn use.
3387         (unevaluated_noexcept_spec): Adjust.
3388         * cp-gimplify.c (genericize_eh_spec_block,
3389         gimplify_most_not_throw_expr): Adjust.
3391         * name-lookup.c (pushdecl_top_level,
3392         pushdecl_top_level_and_finish): Move after namespace pushing and
3393         popping functions.
3394         (push_to_top_level): Rename to ...
3395         (do_push_to_top_level): ... here.  Remove timing code.
3396         (pop_from_top_level_1): Rename to ...
3397         (do_pop_from_top_level): ... here.
3398         (do_push_nested_namespace, do_pop_nested_namespace)
3399         (push_to_top_level): New wrapper for do_push_to_top_level.
3400         (pop_from_top_level): Adjust.
3401         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3403 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3405         * config-lang.in (gtfiles): Add c-family/c-format.c,
3406         except.c, init.c, lambda.c and friend.c.
3407         * class.c (dvirt_fn): Move out of function scope,
3408         add GTY attribute.
3409         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3410         * init.c (fn): Likewise.
3411         * lambda.c (ptr_id, max_id): Likewise.
3412         * friend.c (global_friend): Add GTY attribute.
3414 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3416         * call.c (add_list_candidates): Use OVL_FIRST.
3417         (build_new_method_call_1): Likewise.
3418         * cp-tree.h (OVL_SINGLE_P): New.
3419         (TYPE_HIDDEN_P): New.
3420         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3421         * dump.c (cp_tump_tree): Adjust overload dumping.
3422         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3423         printing.
3424         * method.c (lazily_declare_fn): Assert we added it.
3425         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3426         OVL_FIRST.
3427         (cp_parser_template_name): Use lkp_iterator.
3428         * pt.c (begin_template_parm_list): Fixup comment.
3429         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3430         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3431         (ovl_scope): Use lkp_iterator.
3433 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
3435         * parser.c (cp_parser_omp_clause_default): Handle
3436         "OMP_CLAUSE_DEFAULT_PRESENT".
3438         * parser.c (cp_parser_omp_clause_default): Avoid printing more
3439         than one syntax error message.
3441 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3443         * class.c (class_dump_id): Define.
3444         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3445         * cp-objcp-common.c (cp_register_dumps): New.
3446         * cp-objcp-common.h (cp_register_dumps): Declare.
3447         (LANG_HOOKS_REGISTER_DUMPS): Override.
3448         * cp-tree.h (class_dump_id): Declare.
3450 2017-05-18  Nathan Sidwell  <nathan@acm.org>
3452         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3453         (OVL_USED_P): New.
3454         (lookup_keep): Declare.
3455         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3456         * pt.c (tsubst_copy): Assert lookup is persistent.
3457         * semantics.c (finish_call_expr): Use lkp_iterator, call
3458         lookup_keep.
3459         * tree.c (ovl_copy): New.
3460         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3461         (lookup_keep): New.
3463         * cp-tree.h (OVL_USED): Replace with ...
3464         (OVL_USING_P): ... this.
3465         (ovl_iterator::using_p): Adjust.
3466         * name-lookup.c (push_overloaded_decl_1,
3467         do_nonmember_using_decl): Adjust.
3468         * search.c (lookup_field_r): Adjust.
3469         * tree.c (ovl_insert, ovl_scope): Adjust.
3471         * cp-tree.h (lookup_add): Swap args.
3472         (ovl_cons, build_overload): Delete.
3473         * name-lookup.c (add_function, push_overloaded_decl_1,
3474         do_nonmember_using_decl, merge_functions, remove_hidden_names):
3475         Use lookup_add, ovl_insert.
3476         * pt.c (check_explicit_specialization): Use lookup_add.
3477         (do_class_deduction): Likewise. Refactor if.
3478         * tree.c (lookup_add): Swap args.
3479         (ovl_cons, build_overload): Delete.
3481         * name-lookup.c (find_local_binding): New, broken out of ...
3482         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
3483         (set_namespace_binding): Swap scope & name args.
3484         (namespace_binding_1): Likewise.
3485         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3486         (push_overloaded_decl_1): Likewise.
3487         (set_global_binding): Likewise.
3488         (get_namespace_binding): Adjust namespace_binding_1 call.
3490 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3492         * cp-tree.h (default_hash_traits <lang_identifier *>): New
3493         specialization.
3494         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3495         (extern_c_fns): New hash table.
3496         (check_extern_c_conflict): New, broken out of ...
3497         (pushdecl_maybe_friend_1): ... here.  Call it.
3498         (c_linkage_bindings): Just look in hash table.
3500 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
3502         PR c++/80654
3503         PR c++/80682
3504         Implement new C++ intrinsics __is_assignable and __is_constructible.
3505         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3506         (is_xible): New.
3507         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3508         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3509         * method.c (constructible_expr): Set cp_unevaluated.
3510         (is_xible_helper): New.
3511         (is_trivially_xible): Adjust.
3512         (is_xible): New.
3513         * parser.c (cp_parser_primary_expression): Handle
3514         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3515         (cp_parser_trait_expr): Likewise.
3516         * semantics.c (trait_expr_value): Handle
3517         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3519 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3521         * cp-tree.h (ovl_iterator::using_p): New predicate.
3522         (ovl_iterator::remove_node): New worker.
3523         (ovl_insert): Declare.
3524         * tree.c (ovl_insert): New.
3525         (ovl_iterator::remove_node): New.
3526         * class.c (add_method): Use ovl_iterator, ovl_insert.
3527         (clone_function_decl): Fix description.
3528         (clone_constructors_and_destructors): Use ovl_iterator.
3530         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3531         (maybe_warn_about_overly_private_class): Use ovl_iterator.
3532         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3533         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3534         (get_base_fndecls): Use ovl_iterator.
3535         (warn_hidden): Use OVL_NAME, ovl_iterator.
3536         (add_implicitly_declared_members): Use ovl_iterator.
3537         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3538         flatten nested if.
3539         (finish_shorthand_constraint): Simplify, use ovl_make.
3540         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
3541         * search.c (shared_member_p): Use ovl_iterator.
3542         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3543         (lookup_conversion_operator): Use OVL_FIRST.
3544         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3545         (look_for_overrides_here): Use ovl_iterator.
3546         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3547         * typeck.c (build_x_unary_op): Use ovl_make.
3549 2017-05-17  Martin Liska  <mliska@suse.cz>
3551         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3552         use it instead of int type.
3553         (dump_vtable): Likewise.
3554         (dump_vtt): Likewise.
3555         * decl2.c (dump_tu): Likewise.
3557 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
3559         * call.c (enforce_access): Add access_failure_info * param and use
3560         it to record access failures.
3561         * cp-tree.h (class access_failure_info): New class.
3562         (enforce_access): Add access_failure_info * param, defaulting to
3563         NULL.
3564         (lookup_member): Likewise.
3565         (locate_field_accessor): New function decl.
3566         (perform_or_defer_access_check): Add access_failure_info * param,
3567         defaulting to NULL.
3568         * search.c (lookup_member): Add access_failure_info * param and
3569         pass it on to call to perform_or_defer_access_check.
3570         (matches_code_and_type_p): New function.
3571         (field_access_p): New function.
3572         (direct_accessor_p): New function.
3573         (reference_accessor_p): New function.
3574         (field_accessor_p): New function.
3575         (struct locate_field_data): New struct.
3576         (dfs_locate_field_accessor_pre): New function.
3577         (locate_field_accessor): New function.
3578         * semantics.c (perform_or_defer_access_check): Add
3579         access_failure_info * param, and pass it on to call to
3580         enforce_access.
3581         * typeck.c (access_failure_info::record_access_failure): New method.
3582         (access_failure_info::maybe_suggest_accessor): New method.
3583         (finish_class_member_access_expr): Pass an access_failure_info
3584         instance to the lookup_member call, and call its
3585         maybe_suggest_accessor method afterwards.
3587 2017-05-16  Marek Polacek  <polacek@redhat.com>
3589         PR sanitizer/80536
3590         PR sanitizer/80386
3591         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3593 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3595         * name-lookup.c (check_local_shadow): New, broke out of ...
3596         (pushdecl_maybe_friend_1): ... here.  Call it.
3598         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3599         (ovl_first): Move inline definition to end of file.
3600         (ovl_make, lookup_add): Declare.
3601         (get_fns, get_first_fn): Make pure.
3602         * tree.c (ovl_cache): New.
3603         (ovl_make, lookup_add): New.
3604         * pt.c (do_class_deduction): Don't add candidates that will be
3605         elided.
3607         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3608         (print_error_for_call_failure): Use OVL_NAME.
3609         (build_op_call_1): Use ovl_iterator.
3610         (add_candidates): Use OVL_FIRST & lkp_iterator.
3611         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3612         lkp_iterator.
3613         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3614         (type_has_user_nondefault_constructor,
3615         in_class_defaulted_default_constructor,
3616         type_has_user_provided_constructor,
3617         type_has_user_provided_or_explicit_constructor,
3618         type_has_non_user_provided_default_constructor,
3619         vbase_has_user_provided_move_assign,
3620         type_has_move_constructor, type_has_move_assign,
3621         type_has_user_declared_move_constructor,
3622         type_has_user_declared_move_assign,
3623         type_build_ctor_call, type_build_dtor_call,
3624         type_requires_array_cookie, explain_non_literal_class): Likewise.
3625         (finish_struct): Use lkp_iterator.
3626         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3627         (note_name_declared_in_class): Use OVL_NAME.
3628         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3629         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3630         cxx_pretty_printer::expression): Likewise.
3631         * decl2.c (check_classfn): Use ovl_iterator.
3632         * pt.c (retrieve_specialization): Use ovl_iterator.
3633         * tree.c (cp_tree_equal): Use lkp_iterator.
3634         (type_has_nontrivial_copy_init): Use ovl_iterator.
3636         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3637         check is_overloaded_fn.
3639 2017-05-16  Martin Liska  <mliska@suse.cz>
3641         * parser.c (cp_lexer_print_token): Add default value for flags
3642         argument of print_gimple_stmt, print_gimple_expr,
3643         print_generic_stmt and print_generic_expr.
3645 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3647         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3648         iterators.
3649         (MAYBE_BASELINK_FUNCTIONS): New.
3650         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3651         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3652         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3653         * method.c (inherited_ctor_binfo): Use ovl_iterator.
3654         (binfo_inherited_from): Likewise.
3655         * parser.c (lookup_literal_operator): Use lkp_iterator.
3656         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3657         (print_candidates_1): Likewise.
3658         (determine_specialization): Likewise.
3659         (resolve_overloaded_unification): Likewise.
3660         (resolve_nondeduced_context): Likewise.
3661         (type_dependent_expression_p): Likewise.
3662         (dependent_template_p): Likewise.
3663         * ptree.c (cxx_print_xnode): Likewise.
3664         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3665         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3666         * typeck.c (check_template_keyword): Use lkp_iterator.
3668         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3669         (ovl_first): New.
3670         * constexpr.c (function_concept_check): Use OVL_FIRST.
3671         * cvt.c (build_expr_type_conversion): Likewise.
3672         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3673         * decl2.c (mark_used): Use OVL_FIRST.
3674         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3675         (dump_expr, location_of): Use OVL_FIRST.
3676         * friend.c (do_friend): Use OVL_NAME.
3677         * init.c (build_offset_ref): Use OVL_FIRST.
3678         * mangle.c (write_member_name): Likewise.
3679         (write_expression): Use OVL_NAME.
3680         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3681         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3682         * pt.c (check_explicit_specialization): Use OVL_FIRST.
3683         (check_template_shadow): Likewise.
3684         (tsubst_template_args): Use OVL_NAME.
3685         (tsubst_baselink): Use OVL_FIRST.
3686         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3687         * tree.c (get_first_fn): Use OVL_FIRST.
3688         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3689         (cp_build_addr_expr_1): Use OVL_FIRST.
3691         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3692         peeking.
3693         * semantics.c (finish_id_expression): Directly init local var.
3694         (finish_omp_reduction_clause): Use really_overloaded_fn.
3695         * tree.c (get_fns): Document.  Assert we got an overload.
3696         (get_first_fn) Document.
3697         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3698         really_overloaded_fn.
3699         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3701         * cp-tree.h (SCOPE_DEPTH): New.
3702         * name-lookup.h (is_nested_namespace): Declare.
3703         * name-lookup.c (is_nested_namespace): New.
3704         (is_ancestor): Use it.
3705         (set_decl_namespace): Likewise.
3706         (push_namespace): Set SCOPE_DEPTH.
3707         * pt.c (check_specialization_namespace): Use is_nested_namespace.
3708         (check_unqualigied_spec_or_inst): Likewise.
3710 2017-05-15  Nathan Sidwell  <nathan@acm.org>
3712         PR c++/79369
3713         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3714         * name-lookup.h (push_namespace): Return int, add make_inline arg.
3715         * name-lookup.c (push_namespace): Deal with inline directly.
3716         Return pushed count.
3717         * parser.c (cp_parser_namespace_definition): Adjust for
3718         push_namespace change.
3720 2017-05-11  Nathan Sidwell  <nathan@acm.org>
3722         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3723         LANG_HOOKS_PUSHDECL): Move to ...
3724         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3725         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3726         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3728         * name-lookup.h (pushdecl): Add default friend parm.
3729         (pushdecl_maybe_friend): Delete.
3730         (pushdecl_top_level): Add default friend parm.
3731         (pushdecl_top_level_maybe_friend): Delete.
3732         * name-lookup.c (pushdecl_maybe_friend): Delete.
3733         (pushdecl): Add is_friend parm.
3734         (pushdecl_top_level): Add is friend_parm.
3735         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3736         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3737         * friend.c (do_friend): Adjust.
3738         * pt.c (tsubst_friend_class): Adjust.
3740         Revert pushdecl_top_level_and_finish name change.
3741         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3742         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3743         * decl.c (cp_make_fname_decl): Adjust.
3744         * decl2.c (get_guard, handle_tls_init):  Adjust.
3745         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
3747         * name-lookup.c (pushdecl_outermost_localscope): Always
3748         conditionally stop timer.
3750         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3751         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3753         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3754         pushtag_top_level_maybe_friend,
3755         pushdecl_top_level_and_finish): Move declarations to ...
3756         * name-lookup.h: ... here.  Group pushdecl variants.
3757         (pushdecl_top_level_and_finish): Rename to ...
3758         (pushdecl_top_level_with_init): ... here.
3759         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3760         * decl2.c (get_guard, handle_tls_init): Likewise.
3761         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3762         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3763         * method.c (implicitly_declare_fn): Likewise.
3764         * searchc (node_debug_info_needed): Likewise.
3765         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3766         (pushdecl_top_level_with_init): ... here.
3767         (pop_everything): Use namespace_bindings_p.
3769         * name-lookup.h (pop_binding): Rename to pop_local_binding.
3770         (getdecls): Rename to get_local_decls.
3771         * name-lookup.c (pop_binding): Rename to ...
3772         (pop_local_binding): ... here.
3773         (pop_bindings_and_leave_scope): Adjust.
3774         (getdecls): Rename to ...
3775         (get_local_decls): ... here.  Assert local scope.
3776         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
3777         logic.
3778         (store_parm_decls): Adjust get_local_decls call.
3779         (parser.c (synthesize_implicit_template_parm): Likewise.
3781 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
3783         PR c++/80682
3784         * method.c (is_trivially_xible): Reject void types.
3786 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3788         * class.c (handle_using_decl): Always use OVL_CURRENT.
3789         (resolve_address_of_overloaded_function): Move iterator decl into
3790         for scope.  Don't strip anticipated decls here.
3792         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3793         printing.
3794         (print_candidates): Adjust.
3796         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
3797         line breaking.
3798         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
3799         koenig_p handling here.
3800         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3801         (tsubst_omp_clauses): Likewise.
3802         (do_class_deduction): Adjust buld_new_function_call calls.
3803         * semantics.c (finish_call_expr): Likewise.
3805 2017-05-10  Jason Merrill  <jason@redhat.com>
3807         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3808         (unify_type_mismatch, unify_parameter_pack_mismatch)
3809         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3810         (unify_parameter_pack_inconsistent, unify_inconsistency)
3811         (unify_vla_arg, unify_method_type_error, unify_arity)
3812         (unify_arg_conversion, unify_no_common_base)
3813         (unify_inconsistent_template_template_parameters)
3814         (unify_template_deduction_failure)
3815         (unify_template_argument_mismatch)
3816         (unify_overload_resolution_failure): Call unify_invalid.
3818         CWG 1847 - Clarifying compatibility during partial ordering
3819         * pt.c (more_specialized_fn): No order between two non-deducible
3820         parameters.
3822         * pt.c (dependent_type_p): Make sure we aren't called with
3823         global_type_node.
3825         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
3826         * pt.c (convert_template_argument): Just return an argument pack.
3827         (coerce_template_parameter_pack, template_parm_to_arg)
3828         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
3829         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
3830         Don't set the type of a NONTYPE_ARGUMENT_PACK.
3831         * parser.c (make_char_string_pack, make_string_pack): Likewise.
3833 2017-05-10  Nathan Sidwell  <nathan@acm.org>
3835         * cp-tree.h (add_method, clone_function_decl): Change last arg to
3836         bool.
3837         * class.c (add_method): Change third arg to bool.  Adjust.
3838         (one_inheriting_sig, one_inherited_ctor): Adjust.
3839         (clone_function_decl): Change 2nd arg to bool.  Adjust.
3840         (clone_constructors_and_destructors): Adjust.
3841         * lambda.c (maybe_add_lambda_conv_op): Adjust.
3842         * method.c (lazily_declare_fn): Adjust.
3843         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
3844         * semantics.c (finish_member_declaration): Adjust.
3846 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
3848         PR c++/80145
3849         * decl.c (finish_function): To improve error recovery, change the
3850         logic for calling apply_deduced_return_type.
3852 2017-05-09  Jason Merrill  <jason@redhat.com>
3854         PR c++/80605 - __is_standard_layout and empty base
3855         * class.c (check_bases): Ignore empty bases.
3857         PR c++/70979 - literal class and closure types
3858         * class.c (finalize_literal_type_property): Handle closures
3859         specifically.
3860         (explain_non_literal_class): Likewise.
3862         PR c++/66297, DR 1684 - literal class and constexpr member fns
3863         * constexpr.c (is_valid_constexpr_fn): Only complain about
3864         non-literal enclosing class in C++11.
3865         * class.c (finalize_literal_type_property): Likewise.
3867 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
3869         PR c++/80186
3870         * pt.c (tsubst_decl): Early return error_mark_node if
3871         grok_ctor_properties returns false.
3873 2017-05-09  Jason Merrill  <jason@redhat.com>
3875         PR c++/70167 - array prvalue treated as lvalue
3876         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
3877         (enum fcl_t): New.
3878         * semantics.c (finish_compound_literal): Add fcl_context parameter.
3879         Only make a static variable for C99 syntax.
3880         * parser.c (cp_parser_postfix_expression): Pass it.
3881         * pt.c (tsubst_copy_and_build): Likewise.
3882         * call.c (extend_ref_init_temps): Set
3883         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3885 2017-05-09  Nathan Sidwell  <nathan@acm.org>
3887         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
3888         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
3889         * name-lookup.h (pushdecl_top_level): Declare.
3891 2017-05-08  Jason Merrill  <jason@redhat.com>
3893         PR c++/80178 - parameter passing for uncopyable classes
3894         * tree.c (type_has_nontrivial_copy_init): True for classes with only
3895         deleted copy/move ctors.
3896         (remember_deleted_copy, maybe_warn_parm_abi): New.
3897         * decl.c (require_complete_types_for_parms, check_function_type):
3898         Call maybe_warn_parm_abi.
3899         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
3901 2017-05-08  Nathan Sidwell  <nathan@acm.org>
3903         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
3904         (start_preparsed_function): Do decl pushing before setting
3905         current_funciton_decl and announcing it.
3907         * name-lookup.h (pushdecl_with_scope): Replace with ...
3908         (pushdecl_outermost_localscope): ... this.
3909         * name-lookup.c (pushdecl_with_scope): Replace with ...
3910         (pushdecl_outermost_localscope): ... this.
3911         (pushdecl_namespace_level): Adjust.
3912         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
3913         * lambda.c (insert_capture_proxy): Likewise.
3915         * class.c (build_vtbl_initializer): Don't shadow outer variable
3916         with static var.
3918         Revert _binding -> _value change.
3919         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
3920         (get_namespace_binding, set_global_binding): ... these.
3921         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
3922         (get_namespace_binding, set_global_binding): ... these.
3923         (arg_assoc_namespace, pushdecl_maybe_friend_1,
3924         check_for_out_of_scope_variable, push_overloaded_decl_1,
3925         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
3926         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
3927         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
3928         * decl.c (poplevel): Adjust.
3929         * pt.c (make_constrained_auto): Likewise.
3931 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
3933         PR translation/80280
3934         * call.c (print_z_candidate): Fix quoting.
3936 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
3938         * error.c (pedwarn_cxx98): Replace report_diagnostic
3939         with diagnostic_report_diagnostic.
3941 2017-05-05  Nathan Sidwell  <nathan@acm.org>
3943         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
3944         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
3945         (IDENTIFIER_NAMESPACE_VALUE): Delete.
3946         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
3947         with ...
3948         (get_namespace_value, set_global_value): ... these.
3949         (get_global_value_if_present, is_typename_at_global_scope): Delete.
3950         * decl.c (poplevel): Use get_namespace_value.
3951         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
3952         * class.c (build_vtbl_initializer): Stash library decl in
3953         static var. Use IDENTIFIER_GLOBAL_VALUE.
3954         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
3955         do_allocate_exception, do_free_exception, build_throw): Likewise.
3956         * init.c (throw_bad_array_new_length): Likewise.
3957         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
3958         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
3959         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
3960         get_namespace_value.
3961         (set_namespace_binding_1): Rename to
3962         (set_namespace_binding): ... here.
3963         (set_global_value): New.
3964         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
3965         get_namespace_value.
3966         * pt.c (listify): Use get_namespace_value.
3968         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
3969         current scope.
3970         * lex.c (unqualified_name_lookup_error): Likewise.
3972         * class.c (alter_class): Use retrofit_lang_decl directly.
3973         * decl.c (push_local_name, dupliate_decls): Likewise.
3974         * semantics.c (omp_privatize_field): Likewise.
3976         Kill walk_namespaces.
3977         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
3978         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
3980         Kill per-namespace static_decls.
3981         * cp-tree.h (static_decls): Declare.
3982         (wrapup_globals_for_namespace,
3983         diagnose_inline_vars_for_namespace): Replace with ...
3984         (wrapup_namespace_globals): ... this.
3985         * decl.c (static_decls): Define.
3986         (wrapup_globals_for_namespace,
3987         diagnose_inline_vars_for_namespace): Replace with ...
3988         (wrapup_namespace_globals): ... this.
3989         (cxx_init_decl_processing): Initialize static_decls.
3990         * decl2.c (c_parse_final_cleanups): Adjust.
3991         * name-lookup.h (cp_binding_level): Remove static_decls member.
3992         * name-lookup.c (add_decl_to_level): Adjust.
3993         (begin_scope): Adjust.
3995 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
3997         PR c++/71577
3998         * decl.c (reshape_init): Unconditionally return error_mark_node
3999         upon error about too many initializers.
4001 2017-05-04  Nathan Sidwell  <nathan@acm.org>
4003         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4005 2017-05-04  Martin Sebor  <msebor@redhat.com>
4007         PR translation/80280
4008         * call.c (print_z_candidate): Add missing quoting to %D and other
4009         like directives.
4010         (build_op_call_1): Same.
4011         * constraint.cc (diagnose_check_constraint): Same.
4012         * mangle.c (mangle_decl): Same.
4013         * name-lookup.c (cp_binding_level_debug): Same.
4014         (set_decl_namespace): Same.
4015         * parser.c (cp_parser_tx_qualifier_opt): Same.
4016         * pt.c (print_candidates_1): Same.
4017         (check_template_variable): Same.
4018         (tsubst_default_argument): Same.
4019         (most_specialized_partial_spec): Same.
4020         * semantics.c (omp_reduction_lookup): Same.
4021         * tree.c (check_abi_tag_redeclaration): Same.
4022         * typeck.c (comptypes): Same.
4023         * typeck2.c (abstract_virtuals_error_sfinae): Same.
4025 2017-05-04  Nathan Sidwell  <nathan@acm.org>
4027         More global trees.
4028         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4029         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4030         CPTI_INIT_LIST_IDENTIFIER.
4031         (global_namespace, global_type_node, global_identifier,
4032         anon_identifier, init_list_identifier): New.
4033         * decl.c (global_type_node, global_scope_name): Delete.
4034         (initialize_predefined_identifiers): Add new identifiers.
4035         (cxx_init_decl_processing): Adjust.
4036         * name-lookup.h (global_namespace, global_type_node): Delete.
4037         * name-lookup.c (global_namespace, anonymous_namespace_name,
4038         get_anonymous_namespace_name): Delete.
4039         (namespace_scope_ht_size, begin_scope, pushtag_1,
4040         push_namespace): Adjust,
4041         * call.c (type_has_extended_temps): Use init_list_identifier.
4042         * pt.c (listify): Likewise.
4044         * name-lookup.c: Reorder functions to make merging from modules
4045         branch simpler.
4047 2017-05-03  Jason Merrill  <jason@redhat.com>
4049         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4051 2017-05-03  Nathan Sidwell  <nathan@acm.org>
4053         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4054         along with #defines, to before name-lookup include.
4056 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
4058         * pt.c (is_auto_or_concept): Remove.
4059         (type_uses_auto_or_concept): Remove, unused.
4060         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4061         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4062         * cp-tree.h (is_auto_or_concept): Remove.
4064 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
4066         PR c++/80038
4067         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4068         add pedigree operation and detach call here.
4069         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4070         cilk_cp_gimplify_call_params_in_spawned_fn.
4071         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4072         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4074 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
4076         * parser.c (cp_parser_member_declaration): Add fix-it hints for
4077         stray comma and missing semicolon at end of member declaration.
4079 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
4081         * parser.c (cp_parser_cast_expression): Add target type of cast to
4082         diagnostic.
4083         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4085 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
4087         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4088         return type to bool.
4089         * cp-tree.h (grok_ctor_properties): Update.
4091 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
4093         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4094         information to diagnostic of invalid colon in nested-name-specifier.
4096 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
4098         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4099         diagnostic of invalid class/struct keyword after enum.
4101 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4103         * parser.c (cp_parser_member_declaration): Add fix-it hint
4104         for removing stray semicolons.
4106 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4108         * name-lookup.c (get_std_name_hint): New function.
4109         (maybe_suggest_missing_header): New function.
4110         (suggest_alternative_in_explicit_scope): Call
4111         maybe_suggest_missing_header.
4113 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4115         PR c++/80177
4116         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4117         candidate type of bm from tree to const char *.
4118         (consider_binding_level): Likewise.
4119         (lookup_name_fuzzy): Likewise, using this to merge the best
4120         result from the preprocessor into bm, rather than immediately
4121         returning, so that better matches from reserved words can "win".
4122         Guard the rejection of keywords that don't start decl-specifiers
4123         so it only happens for FUZZY_LOOKUP_TYPENAME.
4125 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4127         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4128         (start_enum): Likewise.
4129         (build_enumerator): Likewise. Use %qE instead of plain %E.
4130         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4131         %<%D%> in diagnostics.
4132         (cp_parser_elaborated_type_specifier): Likewise.
4133         * pt.c (make_pack_expansion): Use %qT and %qE instead of
4134         %<%T%> and %<%E%> in diagnostics.
4135         (tsubst_pack_expansion): Likewise.
4137 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
4139         PR c++/80016
4140         * parser.c (cp_parser_unary_expression):  Generate a location
4141         range for alignof and sizeof expressions.
4143 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4145         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4146         error message.
4147         (cp_parser_virt_specifier_seq_opt): Likewise.
4148         (set_and_check_decl_spec_loc): Likewise twice.
4150 2017-04-21  Jason Merrill  <jason@redhat.com>
4152         PR c++/80179 - ICE with initialized flexible array member.
4153         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4155 2017-04-21  Richard Biener  <rguenther@suse.de>
4157         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4158         (copy_type): Likewise.
4159         * lex.c (copy_decl): Pass down mem-stat info.
4160         (copy_type): Likewise.
4162 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
4164         PR c++/80473
4165         * init.c (build_new_1): Suppress notes about over-aligned new when
4166         the warning is suppressed.
4168 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
4170         * parser.c (cp_parser_member_declaration): Add warning with fixit
4171         information for extra semicolon after in-class function definition.
4173 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
4175         PR middle-end/80423
4176         * tree.c (build_cplus_array_type): Call build_array_type
4177         with the intended TYPE_TYPELESS_STORAGE flag value, instead
4178         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4179         on the shared type.
4181 2017-04-18  Marek Polacek  <polacek@redhat.com>
4183         PR c++/80244 - ICE with attribute in template alias.
4184         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4186         PR c++/80241 - ICE with alignas pack expansion.
4187         * error.c (dump_expr): Handle TREE_LIST.
4188         * parser.c (cp_parser_std_attribute_list): Return error_mark if
4189         make_pack_expansion returns an error.
4191 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
4193         PR c++/80287
4194         * class.c (fixup_may_alias): Fix all type variants.
4196 2017-04-17  Jason Merrill  <jason@redhat.com>
4198         PR c++/80415 - wrong error with default arg and array reference.
4199         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4201         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4203 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
4205         * decl.c (name_unnamed_type): Split out of...
4206         (grokdeclarator): ... this.
4207         * decl.h (name_unnamed_type): Declare.
4209 2017-04-12  Richard Biener  <rguenther@suse.de>
4210         Bernd Edlinger  <bernd.edlinger@hotmail.de>
4212         PR middle-end/79671
4213         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4214         for arrays of character or std::byte type.
4216 2017-04-11  Jason Merrill  <jason@redhat.com>
4218         PR c++/80294 - ICE with constexpr and inheritance.
4219         * constexpr.c (reduced_constant_expression_p):
4220         A null constructor element is non-constant.
4221         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4222         returning an empty base.
4224 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4226         PR c++/80370
4227         * decl.c (cp_finish_decomp): If processing_template_decl on
4228         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4229         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
4230         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4231         processing.
4232         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4233         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4234         dependent.
4236 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4238         PR c++/80363
4239         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4241 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
4243         PR c++/80176
4244         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4245         operand, if it is a static member function, recurse on the
4246         BASELINK.
4248 2017-04-10  Marek Polacek  <polacek@redhat.com>
4250         PR sanitizer/80348
4251         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
4252         ORIG_TYPE earlier and not only when shortening.
4254 2017-04-07  Jason Merrill  <jason@redhat.com>
4256         PR c++/80356 - ICE with reference to function template argument.
4257         PR c++/79294
4258         * pt.c (convert_nontype_argument_function): Adjust type even with a
4259         value-dependent argument.
4261         PR c++/80267 - ICE with nested capture of reference
4262         PR c++/60992
4263         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4265 2017-04-07  Marek Polacek  <polacek@redhat.com>
4267         PR sanitizer/80348
4268         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4270         PR c++/80095
4271         * call.c (build_over_call): Don't check cxx_dialect.
4272         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4273         whether SUB is a CONSTRUCTOR.
4274         * init.c (build_new_1): Don't check cxx_dialect.
4275         * tree.c (replace_placeholders): Add a function comment.  Return if
4276         not in C++14, or if the object isn't a (member of a) class.
4277         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4278         TYPE is CLASS_TYPE_P.
4280 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
4282         PR c++/80309
4283         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4284         of a loop doing vec_safe_push of NULL.  Formatting fixes.
4285         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4286         to newidx before calling canonical_type_parameter on newtype.
4288 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
4290         PR c++/80296
4291         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4292         UNARY_PLUS_EXPR case.
4294 2017-04-03  Jason Merrill  <jason@redhat.com>
4296         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4298 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
4300         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4301         * decl2.c (one_static_initialization_or_destruction): Likewise.
4302         * name-lookup.c (store_bindings): Likewise.
4303         * parser.c (make_call_declarator): Likewise.
4304         * pt.c (check_explicit_specialization): Likewise.
4306 2017-04-03  Jason Merrill  <jason@redhat.com>
4308         PR sanitizer/79993 - ICE with VLA initialization from string
4309         PR c++/69487 - wrong VLA initialization from string
4310         * init.c (finish_length_check): Split out from build_vec_init.
4311         (build_vec_init): Handle STRING_CST.
4312         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4313         (digest_init_r): Don't give a STRING_CST VLA type.
4315 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
4317         PR c++/79572
4318         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4319         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
4320         for NOP_EXPR to REFERENCE_TYPE.
4322         PR libstdc++/80251
4323         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4324         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4325         CPTK_IS_AGGREGATE.
4326         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4327         Remove extraneous parens.
4328         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4329         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4330         (cp_parser_trait_expr): Likewise.
4332 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
4334         PR middle-end/80162
4335         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4336         * typeck.c (cxx_mark_addressable): Likewise.  Look through
4337         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4338         to ARRAY_TYPE.
4339         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4341 2017-03-24  Jason Merrill  <jason@redhat.com>
4343         PR c++/77339 - ICE with invalid use of alias template.
4344         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4345         alias template.
4347 2017-03-24  Marek Polacek  <polacek@redhat.com>
4349         PR c++/80119
4350         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4351         doesn't have side effects.
4353 2017-03-23  Jason Merrill  <jason@redhat.com>
4355         PR c++/80150 - ICE with overloaded variadic deduction.
4356         * pt.c (try_one_overload): Remove asserts.
4358         PR c++/77563 - missing ambiguous conversion error.
4359         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4361 2017-03-23  Marek Polacek  <polacek@redhat.com>
4363         * cp-tree.h: Remove a C_RID_YYCODE reference.
4365 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
4367         PR c++/80141
4368         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4369         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4370         processing_template_decl.
4372 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
4374         PR c++/77752
4375         * name-lookup.c (pushtag_1): Add check for bogus, non template,
4376         std::initializer_list.
4378 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
4380         PR c++/35878
4381         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4383 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
4385         PR c++/35878
4386         * init.c (std_placement_new_fn_p): New.
4387         (build_new_1): Call it.
4389 2017-03-20  Jason Merrill  <jason@redhat.com>
4391         PR c++/80096 - ICE with C++17 non-type auto.
4392         * pt.c (tsubst): Delay tsubst of type of template non-type
4393         parameter.
4395         PR c++/79519 - ICE with deleted template friend.
4396         * decl.c (grokdeclarator): Complain about misplaced function
4397         definition using =, as well.
4399         PR c++/79640 - infinite recursion with generic lambda.
4400         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4401         before substituting its initializer.
4403 2017-03-20  Marek Polacek  <polacek@redhat.com>
4404             Paolo Carlini  <paolo.carlini@oracle.com>
4406         PR c++/80059 - ICE with noexcept and __transaction_atomic
4407         * except.c (build_must_not_throw_expr): Call
4408         instantiate_non_dependent_expr.
4410 2017-03-19  Jason Merrill  <jason@redhat.com>
4412         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4413         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4414         reference decomposition.
4416         PR c++/80077 - error with constexpr and -fno-elide-constructors.
4417         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4418         expanding trivial constructor.
4420 2017-03-17  Jason Merrill  <jason@redhat.com>
4422         PR c++/78345 - ICE initializing array from lambda.
4423         * init.c (build_aggr_init): Check array initializer.
4424         (build_vec_init): Check the type of a CONSTRUCTOR.
4426         PR c++/80073 - C++17 ICE with virtual base.
4427         * decl.c (xref_basetypes): Also check for indirect vbases.
4429 2017-03-16  Jason Merrill  <jason@redhat.com>
4431         * decl.c (start_enum): std::byte aliases anything.
4433         PR c++/79797
4434         * constexpr.c (lookup_placeholder): Tweak.
4436 2017-03-15  Jason Merrill  <jason@redhat.com>
4438         PR c++/80043 - ICE with -fpermissive
4439         * typeck.c (convert_for_assignment): Handle instantiate_type
4440         not giving an error.
4442 2017-03-14  Nathan Sidwell  <nathan@acm.org>
4444         PR c++/79393 DR 1658 workaround
4445         * method.c (synthesized_method_base_walk): Inihibit abstract class
4446         virtual base access check here.
4447         (synthesized_method_walk): Not here.
4449 2017-03-13  Nathan Sidwell  <nathan@acm.org>
4451         PR c++/79393 DR 1658 workaround
4452         * method.c (synthesized_method_walk): Check vbases of abstract
4453         classes for dtor walk.
4455 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
4457         PR translation/79848
4458         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4460 2017-03-10  Jason Merrill  <jason@redhat.com>
4462         PR c++/79960 - alias templates and partial ordering
4463         * pt.c (comp_template_args): Add partial_order parm.
4464         (template_args_equal): Likewise.
4465         (comp_template_args_porder): New.
4466         (get_partial_spec_bindings): Use it.
4468 2017-03-10  Marek Polacek  <polacek@redhat.com>
4470         PR c++/79967
4471         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4473 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
4475         PR c++/79899
4476         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4477         Use XALLOCAVEC macro.
4479         PR c++/79896
4480         * decl.c (finish_enum_value_list): If value is error_mark_node,
4481         don't copy it and change its type.
4482         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4483         of CONST_DECL is error_mark_node.
4485 2017-03-09  Marek Polacek  <polacek@redhat.com>
4487         PR c++/79900 - ICE in strip_typedefs
4488         * tree.c (strip_typedefs): Skip the attribute handling if T is
4489         a variant type which hasn't been updated yet.
4491         PR c++/79687 - wrong code with pointer-to-member
4492         * init.c (constant_value_1): Break if the variable has a dynamic
4493         initializer.
4495 2017-03-08  Jason Merrill  <jason@redhat.com>
4497         PR c++/79797 - ICE with self-reference in array DMI.
4498         * constexpr.c (lookup_placeholder): Split out...
4499         (cxx_eval_constant_expression): ...from here.
4501 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
4503         PR c/79834
4504         * parser.c (cp_parser_omp_cancellation_point,
4505         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4506         cp_parser_omp_target_update): Change "may only be used in compound
4507         statements" diagnostics, such that the same translatable string is
4508         used for all pragmas.
4509         (cp_parser_pragma): Likewise.  Use error_at instead of
4510         cp_parser_error for that diagnostics.
4512 2017-03-06  Marek Polacek  <polacek@redhat.com>
4514         PR c++/79796 - ICE with NSDMI and this pointer
4515         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4516         replace_placeholders.
4518 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
4520         PR c++/79822
4521         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4522         ({ (void) 0; }).
4524 2017-03-06  Jason Merrill  <jason@redhat.com>
4526         Revert "Allow deduction guides to look into primary template."
4527         * cp-tree.h, parser.c, pt.c, search.c: Revert.
4529 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
4531         PR c++/70266
4532         * except.c (build_must_not_throw_expr): Perform the implicit
4533         conversions on the condition.
4535 2017-03-03  Jason Merrill  <jason@redhat.com>
4537         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4538         -Wc++1z-compat.
4540         Core issues 2273 and 2277
4541         * call.c (joust): Adjust using-declaration tiebreaker to handle
4542         the intermediate base case.
4543         * method.c (strip_inheriting_ctors): Just return the argument if
4544         !flag_new_inheriting_ctors.
4546 2017-03-03  Richard Biener  <rguenther@suse.de>
4548         PR c++/79825
4549         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4551 2017-03-03  Marek Polacek  <polacek@redhat.com>
4553         PR c++/79791
4554         * typeck.c (string_conv_p): In C++11, always call pedwarn with
4555         OPT_Wwrite_strings.
4557 2017-03-02  Jason Merrill  <jason@redhat.com>
4559         Update overload resolution with deduction guides.
4560         * pt.c (do_class_deduction): Always build the copy guide.
4561         (copy_guide_p, template_guide_p): New.
4562         (build_deduction_guide): Remember the original constructor.
4563         * call.c (joust): Prefer the copy guide and non-template guides.
4565         Allow deduction guides to look into primary template.
4566         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4567         (struct cp_decl_specifier_seq): Add constructor_p.
4568         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4569         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
4570         Clear deduction_guide_type.  Don't handle deduction guide names.
4571         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4572         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
4573         (cp_parser_member_declaration, cp_parser_cache_defarg)
4574         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4575         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4576         (build_deduction_guide): Set deduction_guide_type.
4577         (dependent_scope_p): Check deduction_guide_type.
4578         * search.c (lookup_member): Likewise.
4580 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
4582         PR c++/79782
4583         * init.c (mark_exp_read_r): New function.
4584         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4585         whole arguments instead of plain mark_exp_read on TREE_LIST values.
4587 2017-03-01  Jason Merrill  <jason@redhat.com>
4589         Class template argument deduction in new-expression
4590         * init.c (build_new): Handle deduction from no initializer.
4591         * parser.c (cp_parser_new_expression): Don't require a single
4592         expression for class template deduction.
4593         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4594         class template placeholder.
4595         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4596         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4597         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4599 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
4601         PR c++/79746
4602         * init.c (emit_mem_initializers): When not constructing vbases of
4603         abstract classes, mark arguments as read for
4604         -Wunused-but-set-parameter.
4606 2017-02-28  Jason Merrill  <jason@redhat.com>
4608         Class template argument deduction refinements
4609         * call.c (joust): Move deduction guide tiebreaker down.
4610         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4611         deduction with no initializer.
4612         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4613         (do_class_deduction): Use that rather than special case.
4614         (do_auto_deduction): Handle null initializer.
4616 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
4618         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4619         instead of just cond ? "..." : "...".
4620         (grokdeclarator): Likewise.
4621         (build_enumerator): Likewise.
4622         * init.c (build_new_1): Likewise.
4623         * call.c (build_new_method_call_1): Likewise.
4624         * parser.c: Include intl.h.
4625         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4626         "enter"/"exit" keyword.
4627         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4628         message.
4630 2017-02-27  Jason Merrill  <jason@redhat.com>
4632         PR c++/71568 - SFINAE forming pointer to member function
4633         * init.c (build_offset_ref): Check the return value of
4634         perform_or_defer_access_check.
4636 2017-02-27  Marek Polacek  <polacek@redhat.com>
4638         * decl.c (expand_static_init): Add missing } in a comment.
4640 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
4642         * init.c: Include intl.h.
4643         (build_new_1): Move message strings into pedwarn to make them
4644         -Wformat-security friendly. Mark string for translation.
4645         * pt.c (tsubst_copy_and_build): Mark string for translation.
4646         Make the pointer const.
4647         * semantics.c (finish_id_expression): Mark strings for translation.
4649 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
4651         * call.c (build_op_delete_call): Make msg1 and msg2 const.
4653 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
4655         PR c++/79588
4656         * call.c (build_over_call): Call check_function_arguments even for
4657         -Wrestrict, adjust check_function_arguments caller.
4658         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4659         here.
4660         * typeck.c (cp_build_function_call_vec): Adjust
4661         check_function_arguments caller.
4663 2017-02-24  Marek Polacek  <polacek@redhat.com>
4665         PR translation/79705
4666         * decl.c (check_redeclaration_exception_specification): Mark a string
4667         for translation.  Make the pointer const.
4669 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
4671         PR c++/79361
4672         * pt.c (register_specialization): Check duplicate_decls return value
4673         for error_mark_node and pass it back.
4675 2017-02-22  Jason Merrill  <jason@redhat.com>
4677         PR c++/79679 - missing destructor for argument
4678         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4679         conversions.
4681         * pt.c (do_class_deduction): Handle 0 argument case.
4683 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
4685         PR c++/79664
4686         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4687         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4688         * constexpr.c (potential_constant_expression_1): Handle
4689         OMP_*, OACC_* and CILK_* trees.  Use error_at with
4690         EXPR_LOC_OR_LOC (t, input_location) computed early
4691         instead of error, or error_at with location_of (t).
4693 2017-02-22  Marek Polacek  <polacek@redhat.com>
4695         PR c++/79653
4696         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4697         if the alignas expression is erroneous.
4698         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4699         error_mark_node.
4701         PR c++/79657
4702         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4704 2017-02-21  Jason Merrill  <jason@redhat.com>
4706         PR c++/50308 - wrong deprecated warning with ADL
4707         PR c++/17729 - duplicate deprecated warning
4708         * semantics.c (finish_id_expression): Only call mark_used on a
4709         function if we aren't building a call.
4711         PR c++/41727 - ICE with partial spec of partial instantiation
4712         * pt.c (process_partial_specialization): For now, don't check more
4713         specialized if there is more than one level of args.
4715 2017-02-21  Marek Polacek  <polacek@redhat.com>
4717         PR c++/79535
4718         * cp-tree.h (maybe_reject_flexarray_init): Declare.
4719         * init.c (maybe_reject_flexarray_init): No longer static.
4720         Add check for current_function_decl.
4721         * parser.c (cp_parser_late_parse_one_default_arg): Reject
4722         a default mem-initializer for a flexible array.
4724 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4725             Paolo Carlini  <paolo.carlini@oracle.com>
4727         PR c++/79654
4728         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4729         on error.
4730         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4731         decl after the decomposition artificial decl has error_mark_node.
4732         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4733         instead of just == error_mark_node comparison.
4735 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4737         PR sanitizer/79589
4738         * decl.c: Include gimplify.h.
4739         (cp_finish_decomp): Make sure there is no sharing of trees
4740         in between DECL_VALUE_EXPR of decomposition decls.
4742         PR c++/79655
4743         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4745         PR c++/79639
4746         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4747         call cplus_expand_constant on it first.
4749 2017-02-19  Jason Merrill  <jason@redhat.com>
4751         PR c++/78139 - destructor needed by new-expression
4752         * call.c (build_special_member_call): Use tf_no_cleanup.
4754         PR c++/78282 - auto template and pack expansion
4755         * pt.c (find_parameter_packs_r): Don't walk into the type of
4756         templates other than template template-parameters.
4758         PR c++/79606 - ICE with this->base_member in NSDMI
4759         * class.c (build_base_path): Check processing_template_decl.
4761         PR c++/79607 - ICE with T{} initializer
4762         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4764         PR c++/79566 - elaborated-type-specifier in range for
4765         * parser.c (cp_parser_simple_declaration): Fix check for type
4766         definition.
4768         PR c++/79400 - confusing suggestion of 'noexcept'
4769         * parser.c (cp_parser_exception_specification_opt): Remove
4770         suggestion for deprecated dynamic exception-specification.
4772         PR c++/79470 - partial ordering with reference parameters
4773         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4775         PR c++/79500 - ICE with non-template deduction guide
4776         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4777         DECL_TEMPLATE_RESULT.
4779         PR c++/79580 - ICE with compound literal
4780         * parser.c (cp_parser_class_head): If we're in the middle of an
4781         expression, use ts_within_enclosing_non_class.
4783         PR c++/79503 - inherited ctor taking base class
4784         * call.c (add_function_candidate): Also check that
4785         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4787 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
4789         PR c++/79380
4790         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4791         argument.
4793 2017-02-19  Eric Fiselier  <eric@efcs.ca>
4794             Jonathan Wakely  <jwakely@redhat.com>
4796         PR c++/69523
4797         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4798         control warning about literal suffix identifiers without a leading
4799         underscore.
4801 2017-02-17  Jason Merrill  <jason@redhat.com>
4803         PR c++/79508 - lookup error with member template
4804         * parser.c (cp_parser_template_name): Clear
4805         parser->context->object_type if we aren't doing lookup.
4807         PR c++/78690 - ICE with using and global type with same name
4808         * pt.c (type_dependent_object_expression_p): True for
4809         IDENTIFIER_NODE.
4811         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4812         * pt.c (convert_template_argument): Just return an auto arg pack.
4813         (tsubst_template_args): Don't tsubst an auto pack type.
4815         PR c++/79556 - C++17 ICE with non-type auto
4816         * pt.c (do_auto_deduction): Don't try to deduce from null type.
4818         PR c++/79533 - C++17 ICE with temporary cast to reference
4819         * call.c (build_over_call): Conversion to a reference prevents copy
4820         elision.
4822 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4823             Jason Merrill  <jason@redhat.com>
4825         PR c++/79502 - lost nodiscard attribute
4826         * pt.c (apply_late_template_attributes): Do apply non-dependent
4827         attributes to types.
4829 2017-02-16  Jason Merrill  <jason@redhat.com>
4831         PR c++/78572 - ICE with self-modifying array initializer
4832         * constexpr.c (cxx_eval_store_expression): The object we're
4833         initializing is outside the constant-expression.
4834         (cxx_eval_call_expression): Set ctx->call.
4836         PR c++/79050 - ICE with undeduced auto and LTO
4837         * decl.c (poplevel): Remove undeduced auto decls.
4839 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
4841         PR c++/79512
4842         * parser.c (cp_parser_omp_target): For -fopenmp-simd
4843         ignore #pragma omp target even when not followed by identifier.
4845 2017-02-15  Jason Merrill  <jason@redhat.com>
4846             Jakub Jelinek  <jakub@redhat.com>
4848         PR c++/79464 - ICE in IPA with omitted constructor parms
4849         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
4850         (adjust_clone_args): Adjust.
4851         (add_method): Remember omitted parms.
4852         * call.c (add_function_candidate): Likewise.
4853         * mangle.c (write_method_parms): Likewise.
4854         * method.c (ctor_omit_inherited_parms): Return false if there are no
4855         parms to omit.
4857 2017-02-15  Martin Sebor  <msebor@redhat.com>
4859         PR c++/79363
4860         * init.c (maybe_reject_flexarray_init): New function.
4861         (perform_member_init): Call it.
4863 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
4865         PR c++/79301
4866         * parser.c (cp_parser_std_attribute): Don't pedwarn about
4867         [[deprecated]] with -std=c++11 and [[fallthrough]] with
4868         -std=c++11 and -std=c++14.
4870         PR c++/79288
4871         * decl.c (grokdeclarator): For static data members, handle thread_p
4872         only after handling inline.
4874 2017-02-14  Marek Polacek  <polacek@redhat.com>
4876         PR c++/79420
4877         PR c++/79463
4878         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
4879         clobbering if the postfix expression isn't an EXPR_P.
4881 2017-02-13  Jason Merrill  <jason@redhat.com>
4883         PR c++/79461 - ICE with lambda in constexpr constructor
4884         * constexpr.c (build_data_member_initialization): Ignore
4885         initialization of a local variable.
4887 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
4889         * init.c (warn_placement_new_too_small): Add missing space in
4890         diagnostics.
4891         * parser.c (cp_parser_oacc_declare): Likewise.
4892         * mangle.c (maybe_check_abi_tags): Likewise.
4894         PR c++/79232
4895         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
4896         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
4897         in the rightmost operand.
4899 2017-02-13  Nathan Sidwell  <nathan@acm.org>
4901         PR c++/79296 - ICE mangling localized template instantiation
4902         * decl2.c (determine_visibility): Use template fn context for
4903         local class instantiations.
4905 2017-02-11  Jason Merrill  <jason@redhat.com>
4907         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
4908         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
4909         (build_new_1): Use replace_placeholders.
4910         * tree.c (replace_placeholders_t): Also track whether we've seen a
4911         placeholder.
4912         (replace_placeholders, replace_placeholders_r): Adjust.
4913         * cp-tree.h: Adjust.
4915         PR c++/77790 - ICE with auto function in C++11 mode
4916         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
4917         (require_deduced_type): Add complain parm, return bool.
4918         * cp-tree.h: Adjust.
4919         * decl2.c (mark_used): Use require_deduced_type.
4921 2017-02-10  Jason Merrill  <jason@redhat.com>
4923         PR c++/78908 - template ops and bitfields
4924         * tree.c (build_min_non_dep): Use unlowered_expr_type.
4926         PR c++/78897 - constexpr union
4927         * constexpr.c (cxx_eval_store_expression): A store to a union member
4928         erases a previous store to another member.
4930         PR c++/71285 - member of fold-expression
4931         * semantics.c (finish_unary_fold_expr)
4932         (finish_binary_fold_expr): Use null type for fold-expressions.
4934         PR c++/79401 - protected inherited constructor
4935         * call.c (enforce_access): For inheriting constructor, find a base
4936         binfo in the path we already have.
4938 2017-02-10  Marek Polacek  <polacek@redhat.com>
4940         PR c++/79435
4941         * pt.c (type_dependent_expression_p): Check if the expression type
4942         is null.
4944         PR c++/79184
4945         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
4946         if warnings shouldn't be given.
4948 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
4950         PR c++/71737
4951         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
4952         an error_mark_node as type.
4954 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4955             Jason Merrill  <jason@redhat.com>
4957         PR c++/79143
4958         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
4959         from pattern to type.
4961 2017-02-09  Jason Merrill  <jason@redhat.com>
4963         PR c++/79316 - default argument in deduction guide
4964         PR c++/79350 - explicit deduction guide
4965         * parser.c (cp_parser_constructor_declarator_p)
4966         (cp_parser_direct_declarator): Parse deduction guides more like
4967         constructors.
4968         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
4969         * tree.c (special_function_p): Return it.
4970         * decl.c (check_special_function_return_type): Handle it.
4971         (grokdeclarator, grokfndecl): Adjust.
4972         (cp_finish_decl): Pass flags to do_auto_deduction.
4973         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
4974         * pt.c (dguide_name_p): Take a const_tree.
4975         (do_class_deduction): Handle explicit.
4976         (do_auto_deduction): Pass flags through.
4977         (build_deduction_guide): Copy explicit flag.
4979 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
4981         PR c++/79429
4982         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
4983         non-pragma_compound context here.
4984         (cp_parser_omp_target): Likewise.
4985         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
4986         parsing for ordered and target omp pragmas in non-pragma_stmt
4987         non-pragma_compound contexts.
4989         PR c/79431
4990         * parser.c (cp_parser_oacc_declare): Formatting fix.
4991         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
4992         automatic variables.
4994 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
4995             Chung-Lin Tang  <cltang@codesourcery.com>
4997         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
4998         parsing.  Parse constant expression. Remove semantic checking.
4999         (cp_parser_omp_clause_collapse): Disallow tile.
5000         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
5001         error about missing for after already emitting one.  Use more
5002         conventional for idiom for unbounded loop.
5003         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5004         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5005         (finish_omp_for): Deal with tile clause.
5007 2017-02-07  Nathan Sidwell  <nathan@acm.org>
5009         * method.c (synthesized_method_base_walk): New.  Broken out of ...
5010         (synthesized_method_walk): ... here.  Call it.  Cleanup
5011         initializations.
5013 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
5015         PR c++/79360
5016         * typeck2.c (process_init_constructor_union): Consider only
5017         FIELD_DECLs when looking for an NSDMI.
5019 2017-02-06  Jason Merrill  <jason@redhat.com>
5021         PR c++/71193 - incomplete types in templates
5022         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5023         handle incomplete type by pedwarning and then treating as dependent.
5025 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
5027         PR c++/79379
5028         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5029         (potential_constant_expression_1): Likewise.
5031         PR c++/79377
5032         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5033         allow one fewer than expected arguments if flag_permissive.
5035         PR c++/79372
5036         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5037         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5038         with error_mark_node type.
5040 2017-02-03  Jason Merrill  <jason@redhat.com>
5042         PR c++/78689 - ICE on constructor with label
5043         * optimize.c (maybe_clone_body): Replace omitted parameters with
5044         null lvalues.
5045         * class.c (build_clone): Fix logic for omitting inherited parms.
5047         PR c++/12245 - excessive memory use
5048         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5049         back in.  Don't cache constants.
5050         (maybe_constant_init): Don't cache constants.
5052         PR c++/79294 - ICE with invalid template argument
5053         * pt.c (convert_nontype_argument_function): Check value-dependence.
5054         (convert_nontype_argument): Don't check it here for function ptrs.
5056 2017-02-02  Richard Biener  <rguenther@suse.de>
5058         PR cp/14179
5059         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5060         it lazily on the first changed element only and copy it
5061         fully upfront, only storing changed elements.
5063 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
5065         PR c++/69637
5066         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5067         to the width.
5069 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
5071         PR c++/79304
5072         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5073         after ARROW_EXPR.
5075 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
5077         PR c++/79298
5078         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5079         any namespace aliases.
5081 2017-01-31  Nathan Sidwell  <nathan@acm.org>
5083         PR c++/79290
5084         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5086         PR c++/67273
5087         PR c++/79253
5088         * pt.c: (instantiate_decl): Push to top level when current
5089         function scope doesn't match.  Only push lmabda scope stack when
5090         pushing to top.
5092         * cp-tree.h (instantiate_decl): Make defer_ok bool.
5093         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5094         (instantiate_decl): Simplify and reorder state saving and restoration.
5096         PR c++/79264
5097         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5098         * semantics.c (finish_member_declaration): Assert class is being
5099         defined.
5101 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
5103         Introduce C++ support in libcc1.
5104         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5105         (ansi_opname): Rename to...
5106         (cp_operator_id): ... this.  Adjust all callers.
5107         (ansi_assopname): Rename to...
5108         (cp_assignment_operator_id): ... this.  Adjust all callers.
5109         (cp_literal_operator_id): Declare.
5110         (set_global_friend): Declare.
5111         (is_global_friend): Declare.
5112         (enum cp_oracle_request): New type.
5113         (cp_binding_oracle_function): New type.
5114         (cp_binding_oracle): Declare.
5115         (cp_finish_injected_record_type): Declare.
5116         * friend.c (global_friend): New var.
5117         (set_global_friend): New fn.
5118         (is_global_friend): New fn.
5119         (is_friend): Call is_global_friend.
5120         * name-lookup.c (cp_binding_oracle): New var.
5121         (query_oracle): New fn.
5122         (qualified_lookup_using_namespace): Call query_oracle.
5123         (lookup_name_real_1): Likewise.
5124         * parser.c (cp_literal_operator_id): Drop static.
5125         * search.c (friend_accessible_p): Call is_global_friend.
5126         * semantics.c (is_this_parameter): Accept a variable if the
5127         binding oracle is enabled.
5129 2017-01-27  Jason Merrill  <jason@redhat.com>
5131         PR c++/78771 - ICE with inherited constructor.
5132         * call.c (build_over_call): Call deduce_inheriting_ctor here.
5133         * pt.c (tsubst_decl): Not here.
5134         * class.c (add_method): Or here.
5135         * method.c (deduce_inheriting_ctor): Handle clones.
5136         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5138 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
5140         PR c++/64382
5141         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5142         New function.
5143         * cp/cp-tree.h: Declare it.
5144         * cp/semantics.c (finish_id_expression): Resolve names within a default
5145         capturing generic lambda defined within a template prior to
5146         instantiation to allow for captures to be added to the closure type.
5148 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
5150         PR c++/68727
5151         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5152         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5153         * parser.c (cp_parser_builtin_offsetof): Pass result of
5154         build_static_cast of null_pointer_node to finish_offsetof.
5155         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5156         it for -Winvalid-offsetof pedwarn instead of trying to guess
5157         original offsetof type from EXPR.  Save OBJECT_PTR as a new
5158         second operand to OFFSETOF_EXPR.
5159         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5160         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5161         as OBJECT_PTR.
5163 2017-01-26  Jason Merrill  <jason@redhat.com>
5165         * name-lookup.c (parse_using_directive): Deprecate strong using.
5167         PR c++/79176 - lambda ICE with -flto -Os
5168         * decl2.c (vague_linkage_p): Handle decloned 'tors.
5169         * tree.c (decl_linkage): Likewise.
5171 2017-01-25  Martin Sebor  <msebor@redhat.com>
5173         * decl.c (grokdeclarator): Fix a typo in a comment.
5175 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
5177         PR c++/78896
5178         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5179         lambda expressions.
5181         PR c++/77914
5182         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5183         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5185 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
5187         PR lto/79061
5188         * decl.c (cxx_init_decl_processing): Pass main_input_filename
5189         to build_translation_unit_decl.
5191 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
5193         PR c++/79205
5194         * cp-gimplify.c (cp_genericize_r): Add result of
5195         convert_from_reference on invisiref parm to p_set.
5197 2017-01-24  Nathan Sidwell  <nathan@acm.org>
5199         PR c++/78469 - defaulted ctor and inaccessible dtor
5200         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5201         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5202         * tree.c (build_target_expr): Check tf_no_cleanup.
5204         PR c++/79118 - anon-members and constexpr
5205         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5206         ctor decl.  Recursively check anonymous members.
5207         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5208         call.
5209         (explain_invalid_constexpr_fn): Likewise.
5211 2017-01-23  Nathan Sidwell  <nathan@acm.org>
5213         PR c++/71710 - template using directive of field
5214         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5215         check earlier.
5217         PR c++/71406 - ICE with scope-ref'd template id exprs
5218         PR c++/77508
5219         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5220         before breaking up TEMPLATE_ID_EXPR.
5222 2017-01-20  Nathan Sidwell  <nathan@acm.org>
5224         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5225         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5227 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
5229         PR c++/77829
5230         PR c++/78656
5231         * cp-tree.h (suggest_alternatives_for): Add bool param.
5232         (suggest_alternative_in_explicit_scope): New decl.
5233         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5234         that isn't the global one, call new function
5235         suggest_alternative_in_explicit_scope, only calling
5236         suggest_alternatives_for if it fails, and disabling near match
5237         searches fort that case.  When SCOPE is the global namespace,
5238         pass true for new param to suggest_alternatives_for to allow for
5239         fuzzy name lookups.
5240         * lex.c (unqualified_name_lookup_error): Pass true for new param
5241         to suggest_alternatives_for.
5242         * name-lookup.c (consider_binding_level): Add forward decl.
5243         (suggest_alternatives_for): Add "suggest_misspellings" param,
5244         using it to conditionalize the fuzzy name-lookup code.
5245         (suggest_alternative_in_explicit_scope): New function.
5246         * parser.c (cp_parser_primary_expression): When calling
5247         finish_id_expression, pass location of id_expression rather
5248         than that of id_expr_token.
5249         (cp_parser_id_expression): Convert local "unqualified_id" from
5250         tree to cp_expr to avoid implicitly dropping location information.
5252 2017-01-20  Marek Polacek  <polacek@redhat.com>
5254         PR c/64279
5255         * call.c (build_conditional_expr_1): Warn about duplicated branches.
5256         * semantics.c (finish_expr_stmt): Build statement using the proper
5257         location.
5259 2017-01-19  Jason Merrill  <jason@redhat.com>
5261         US 20 - forwarding references and class template argument deduction
5262         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5263         * pt.c (push_template_decl_real): Set it.
5264         (maybe_adjust_types_for_deduction): Check it.
5265         (rewrite_template_parm): Copy it.
5267         US 19 - deduction guides and constructors
5268         * call.c (joust): Prefer deduction guides to constructors.
5269         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5270         (deduction_guide_p): Check DECL_P.
5272         * decl.c (check_initializer): Always use build_aggr_init for array
5273         decomposition.
5275         PR c++/79130 - decomposition and direct-initialization
5276         * init.c (build_aggr_init): Communicate direct-initialization to
5277         build_vec_init.
5278         (build_vec_init): Check for array copy sooner.
5279         * parser.c (cp_parser_decomposition_declaration): Remove call to
5280         build_x_compound_expr_from_list.
5282 2017-01-18  Jason Merrill  <jason@redhat.com>
5284         PR c++/68666 - member variable template-id
5285         * typeck.c (finish_class_member_access_expr): Handle variable
5286         template-id.
5287         * pt.c (lookup_and_finish_template_variable): No longer static.
5288         * cp-tree.h: Declare it.
5290 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5292         PR c++/78488
5293         * call.c (build_over_call): When checking ellipsis conversions for
5294         an inherited ctor, make sure there is at least one conversion.
5296 2017-01-18  Jason Merrill  <jason@redhat.com>
5298         PR c++/78894 - ICE with class deduction and default arg
5299         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5301 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5303         PR c++/77489
5304         * mangle.c (write_discriminator): Reorganize abi warning check.
5306 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5308         * cp-tree.h: Clarify exception spec node comment.
5309         * except.c (nothrow_spec_p): Simplify by checking node-equality.
5311         PR c++/79091
5312         * mangle.c (write_exception_spec): Check nothrow explicitly.
5313         (write_encoding): Don't increment processing_template_decl around
5314         encoding.
5316 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5318         PR c++/70182
5319         * mangle.c (write_template_args): Add "on" for operator names.
5321 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5323         PR c++/77489
5324         * mangle.c (write_discriminator): Handle discriminator >= 10.
5326 2017-01-17  Nathan Sidwell  <nathan@acm.org>
5328         PR c++/61636
5329         * cp-tree.h (maybe_generic_this_capture): Declare.
5330         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5331         (maybe_resolve_dummy): ... here.  Call it.
5332         (maybe_generic_this_capture): New.
5333         * parser.c (cp_parser_postfix_expression): Speculatively capture
5334         this in generic lambda in unresolved member function call.
5335         * pt.c (tsubst_copy_and_build): Force hard error from failed
5336         member function lookup in generic lambda.
5338 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
5340         PR c++/70565
5341         * cp-array-notation.c (expand_array_notation_exprs): Handle
5342         OMP_PARALLEL.
5344 2017-01-11  Jason Merrill  <jason@redhat.com>
5346         PR c++/78337 - ICE on invalid with generic lambda
5347         * semantics.c (process_outer_var_ref): Check if containing_function
5348         is null.  Move inform call under complain test.
5350 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5352         PR c++/77812
5353         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5354         is a new overload.
5356 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5358         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5360 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
5362         PR c++/78341
5363         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5364         assertion.  Formatting fix.
5366         PR c++/72813
5367         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5368         writing PCH file.
5370 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
5372         PR c++/77949
5373         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5374         a missing semicolon if we have a valid insertion location for
5375         the fix-it hint.
5377 2017-01-10  Jason Merrill  <jason@redhat.com>
5379         FI 20, decomposition declaration with parenthesized initializer.
5380         * parser.c (cp_parser_decomposition_declaration): Use
5381         cp_parser_initializer.
5383 2017-01-09  Jason Merrill  <jason@redhat.com>
5385         Implement P0195R2, C++17 variadic using.
5386         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5387         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5388         * error.c (dump_decl): Likewise.
5390 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
5392         PR translation/79019
5393         PR translation/79020
5394         * semantics.c (finish_omp_clauses): Add missing whitespace to
5395         translatable strings.
5396         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5398 2017-01-07  Jason Merrill  <jason@redhat.com>
5400         PR c++/78948 - instantiation from discarded statement
5401         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5402         * cp-tree.h (in_discarded_stmt): Declare it.
5403         (struct saved_scope): Add discarded_stmt bitfield.
5404         (in_discarded_stmt): New macro.
5405         * decl2.c (mark_used): Check it.
5406         * parser.c (cp_parser_selection_statement): Adjust.
5407         (cp_parser_jump_statement): Adjust.
5409 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
5411         PR c++/78931
5412         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5413         REFERENCE_REF_P, set tt to its operand.
5415         PR c++/78890
5416         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5417         unions even for C++11 and later.
5419 2017-01-05  Nathan Sidwell  <nathan@acm.org>
5421         PR c++/78765
5422         * pt.c (convert_nontype_argument): Don't try and see if integral
5423         or enum expressions are constants prematurely.
5425 2017-01-04  Marek Polacek  <polacek@redhat.com>
5427         PR c++/64767
5428         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5429         a zero character literal.
5431 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
5433         PR c++/78949
5434         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5435         vector type.
5437         PR c++/78693
5438         * parser.c (cp_parser_simple_declaration): Only complain about
5439         inconsistent auto deduction if auto_result doesn't use auto.
5441         * parser.c (cp_parser_simple_declaration): Diagnose function
5442         declaration among more than one init-declarators with auto
5443         specifier.
5445         PR c++/71182
5446         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5447         assertion, as lexer->buffer may be NULL.
5449 2017-01-04  Marek Polacek  <polacek@redhat.com>
5451         PR c++/77545
5452         PR c++/77284
5453         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5455 2017-01-04  Nathan Sidwell  <nathan@acm.org>
5457         PR c++/66735
5458         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5459         (lambda_capture_field_type): Update prototype.
5460         * lambda.c (lambda_capture_field_type): Add is_reference parm.
5461         Add referenceness here.
5462         (add_capture): Adjust lambda_capture_field_type call, refactor
5463         error checking.
5464         * pt.c (tsubst): Adjust lambda_capture_field_type call.
5466 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
5468         Update copyright years.
5470 Copyright (C) 2017 Free Software Foundation, Inc.
5472 Copying and distribution of this file, with or without modification,
5473 are permitted in any medium without royalty provided the copyright
5474 notice and this notice are preserved.