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