PR c++/83116
[official-gcc.git] / gcc / cp / ChangeLog
blob6ac963ae99a5d55754b129ec21b89e8e8e8c907f
1 2017-12-18  Marek Polacek  <polacek@redhat.com>
3         PR c++/83116
4         * constexpr.c (cxx_eval_call_expression): Only look into
5         constexpr_call_table if ctx->strict.
7 2017-12-18  Jakub Jelinek  <jakub@redhat.com>
9         PR c++/83300
10         * decl2.c (save_template_attributes): Add flags argument, if
11         not ATTR_FLAG_TYPE_IN_PLACE, *decl_p is a type and we want to
12         modify TYPE_ATTRIBUTES, add them on type attribute variant.
14 2017-12-18  Nathan Sidwell  <nathan@acm.org>
16         PR c++/59930
17         * name-lookup.c (name_lookup::search_unqualified): Don't search
18         parent namespace when looking for hidden things.
19         * pt.c (tsubst_friend_class): Always push to friend scope, drop
20         unneeded self-friend check. Inject new hidden friend into correct
21         scope.
23 2017-12-15  Jakub Jelinek  <jakub@redhat.com>
25         PR c++/83205
26         * decl.c (cp_finish_decomp): Handle the case when tsize is not
27         error_mark_node, but doesn't fit into uhwi.  Split up count != eltscnt
28         and !tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
29         to handle plural forms properly.
31         PR c++/81197
32         * cp-tree.h (cp_maybe_mangle_decomp): Declare.
33         * decl.c (cp_maybe_mangle_decomp): New function.
34         (cp_finish_decomp): Don't SET_DECL_ASSEMBLER_NAME here.
35         * parser.c (cp_convert_range_for,
36         cp_parser_decomposition_declaration): Call cp_maybe_mangle_decomp.
37         * pt.c (tsubst_expr): Likewise.
38         * mangle.c (find_decomp_unqualified_name): New function.
39         (write_unqualified_name): Handle DECL_DECOMPOSITION_P
40         where DECL_ASSEMBLER_NAME is already set.
42         PR c++/80135
43         PR c++/81922
44         * typeck2.c (digest_init_r): Change nested argument type from bool to
45         int.  Use code instead of TREE_CODE (type) where possible.  If
46         nested == 2, diagnose initialization of flexible array member with
47         STRING_CST.  Pass nested to process_init_constructor.  Formatting fix.
48         (digest_init, digest_init_flags): Adjust digest_init_r caller.
49         (massage_init_elt): Add nested argument.  Pass 2 instead of 1 to
50         digest_init_r's nested argument if nested is non-zero.
51         (process_init_constructor_array): Add nested argument.  If nested == 2,
52         diagnose initialization of flexible array member with non-empty
53         braced enclosed list.  Pass nested to massage_init_elt.
54         (process_init_constructor_record, process_init_constructor_union): Add
55         nested argument, pass it to massage_init_elt.
56         (process_init_constructor): Add nested argument, pass it to
57         process_init_constructor_{array,record,union}.
58         * init.c (find_field_init): Renamed to ...
59         (find_flexarray_init): ... this.  Return NULL_TREE if init is
60         error_mark_node.  Don't look through nested CONSTRUCTORs.
61         (warn_placement_new_too_small): Adjust caller.
63         PR c++/83217
64         * decl.c (cp_finish_decomp): If decl's type is REFERENCE_TYPE,
65         call complete_type (TREE_TYPE (type)).
67         * tree.c (cxx_attribute_table, std_attribute_table): Swap
68         affects_type_identity and handler fields, adjust comments.
70 2017-12-15  Nathan Sidwell  <nathan@acm.org>
72         PR c++/59930
73         * decl.c (xref_tag_1): Correct comments about template friends and
74         default args.
75         * friend.c (make_friend_class): Move comments concerning
76         self-friendliness to code dealing with such.
77         * pt.c (check_default_tmpl_args): Deal with template friend
78         classes too.
79         (push_template_decl_real): Check default args for non-function
80         template friends.
82 2017-12-14  Bernd Edlinger  <bernd.edlinger@hotmail.de>
84         * decl2.c (start_static_storage_duration_function): Avoid warning.
85         * typeck.c (cxx_safe_arg_type_equiv_p,
86         cxx_safe_function_type_cast_p): New function.
87         (build_reinterpret_cast_1): Implement -Wcast-function-type.
89 2017-12-14  Jakub Jelinek  <jakub@redhat.com>
91         PR c++/79650
92         * pt.c (convert_nontype_argument): Diagnose
93         reduced_constant_expression_p expressions that aren't INTEGER_CST.
95 2017-12-13  Paolo Carlini  <paolo.carlini@oracle.com>
97         PR c++/81061
98         * typeck.c (cp_build_modify_expr): Upon cxx_readonly_error
99         immediately return error_mark_node.
101 2017-12-13  Nathan Sidwell  <nathan@acm.org>
103         PR c++/15272
104         * pt.c (tsubst_baselink): Don't repeat the lookup for
105         non-dependent baselinks.
107 2017-12-12  Jason Merrill  <jason@redhat.com>
109         * decl.c (value_dependent_init_p): Check the type of a CONSTRUCTOR.
110         (type_dependent_init_p): Remove.
112         PR c++/82115 - ICE with variable initialized with its own address.
113         * cp-tree.h (struct lang_decl_base): Add dependent_init_p.
114         (DECL_DEPENDENT_INIT_P, SET_DECL_DEPENDENT_INIT_P): New.
115         * decl.c (cp_finish_decl): Set it.
116         (duplicate_decls): Copy it.
117         * pt.c (tsubst_decl): Clear it.
118         (value_dependent_expression_p): Revert earlier change.  Check it.
120 2017-12-12  Alexandre Oliva <aoliva@redhat.com>
122         * constexpr.c (check_constexpr_ctor_body_1): Skip begin stmt
123         markers.
124         (constexpr_fn_retval): Likewise.
125         (potential_constant_expression_1): Likewise.
126         (cxx_eval_statement_list): Check that a begin stmt marker is
127         not used as the value of a statement list.
128         (cxx_eval_constant_expression): Return begin stmt markers
129         unchanged.
130         * cp-array-notation.c (stmt_location): New.
131         (cp_expand_cond_array_notations): Use it.
132         * cp-objcp-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true.
133         * parser.c (add_debug_begin_stmt): New.
134         (cp_parser_statement): Call it.
135         * pt.c (tsubst_copy): Handle begin stmt markers.
137 2017-12-07  Martin Sebor  <msebor@redhat.com>
139         PR c/81544
140         * cp-tree.h (decls_match): Add default argument.
141         * decl.c (decls_match): Avoid calling into the target back end
142         and triggering an error.
143         * decl2.c (cplus_decl_attributes): Look up existing declaration and
144         pass it to decl_attributes.
145         * tree.c (cxx_attribute_table): Initialize new member of struct
146         attribute_spec.
148 2017-12-06  Jakub Jelinek  <jakub@redhat.com>
150         PR c++/80259
151         * decl2.c (grokfield): Diagnose = delete redefinition of a friend.
153 2017-12-06  Jason Merrill  <jason@redhat.com>
155         * call.c (convert_for_arg_passing): Pass NULL_TREE to
156         targetm.calls.promote_prototypes.
157         (type_passed_as): Likewise.
159         PR c++/82115 - ICE with variable initialized with its own address.
160         * pt.c (value_dependent_expression_p): Add lval parameter.  Don't
161         consider DECL_INITIAL if it's true.
163 2017-12-06  David Malcolm  <dmalcolm@redhat.com>
165         PR c/83236
166         * name-lookup.c (consider_binding_level): Don't suggest names that
167         are reserved for use by the implementation.
169 2017-12-06  David Malcolm  <dmalcolm@redhat.com>
171         * name-lookup.c: Include "c-family/c-spellcheck.h".
173 2017-12-05  Jason Merrill  <jason@redhat.com>
175         PR c++/82331 - ICE with variadic partial specialization of auto
176         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
177         around call to tsubst.
179 2017-12-05  Nathan Sidwell  <nathan@acm.org>
181         PR c++/83287
182         * tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.
184 2017-12-05  Martin Liska  <mliska@suse.cz>
185             Jakub Jelinek  <jakub@redhat.com>
187         * typeck.c (pointer_diff): Add new argument and instrument
188         pointer subtraction.
189         (cp_build_binary_op): Create compound expression if doing an
190         instrumentation.
192 2017-12-05  Jakub Jelinek  <jakub@redhat.com>
194         * cp-gimplify.c (cp_maybe_instrument_return): Don't add
195         __builtin_unreachable if -O0 or if -fsanitize=unreachable.
197 2017-12-04  Jason Merrill  <jason@redhat.com>
199         PR c++/83273 - constexpr if allows non-constant condition
200         * semantics.c (finish_if_stmt_cond): Use require_constant_expression
201         rather than is_constant_expression.
202         * constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
203         in C++17.
205 2017-12-01  Jason Merrill  <jason@redhat.com>
207         Give #include hints for <complex>.
208         * name-lookup.c (get_std_name_hint): Add <complex>.
209         * parser.c (cp_parser_diagnose_invalid_type_name): Call
210         suggest_alternative_in_explicit_scope.
211         (cp_parser_namespace_name): Likewise.
213         PR c++/79228 - extensions hide C++14 complex literal operators
214         * parser.c (cp_parser_userdef_numeric_literal): Be helpful about
215         'i' in C++14 and up.
217 2017-12-01  Jakub Jelinek  <jakub@redhat.com>
219         * parser.c (cp_parser_new): Don't clear cilk_simd_fn_info.
220         (parsing_nsdmi): Adjust comment.
221         (cp_parser_omp_for_loop_init): Likewise.
222         * parser.h (struct cp_omp_declare_simd_data): Adjust comment.
223         (struct cp_parser): Remove cilk_simd_fn_info field.
224         * cp-tree.h (cilk_valid_spawn): Remove.
226         PR c/79153
227         * cp-gimplify.c (genericize_switch_stmt): Emit LABEL_EXPR for the
228         break label into SWITCH_BODY instead of after it and set
229         SWITCH_BREAK_LABEL_P on it.
230         * parser.c (cp_parser_objc_expression): Add FALLTHRU comment to avoid
231         -Wimplicit-fallthrough warning.
233 2017-11-30  Jason Merrill  <jason@redhat.com>
235         PR c++/82219 - bogus -Wignored-qualifiers with template
236         * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
237         -Wignored-qualifiers.
239 2017-11-29  David Malcolm  <dmalcolm@redhat.com>
241         * parser.c (cp_parser_unary_expression): Generate a location for
242         "noexcept".
243         (cp_parser_trait_expr): Generate and return a location_t,
244         converting the return type from tree to cp_expr.
245         (cp_parser_static_assert): Pass location of the condition to
246         finish_static_assert, rather than that of the "static_assert"
247         token, where available.
249 2017-11-29  Paolo Carlini  <paolo.carlini@oracle.com>
251         PR c++/82293
252         * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
253         on a null type.
255 2017-11-29  Jason Merrill  <jason@redhat.com>
257         PR c++/82760 - memory corruption with aligned new.
258         * call.c (build_operator_new_call): Update *args if we add the
259         align_arg.
261 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
263         PR sanitizer/81275
264         * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
265         (SWITCH_STMT_NO_BREAK_P): Define.
266         (note_break_stmt, note_iteration_stmt_body_start,
267         note_iteration_stmt_body_end): Declare.
268         * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
269         and in_loop_body_p fields.
270         (push_switch): Clear them.
271         (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
272         and !break_stmt_seen_p.  Assert in_loop_body_p is false.
273         (note_break_stmt, note_iteration_stmt_body_start,
274         note_iteration_stmt_body_end): New functions.
275         (finish_case_label): Set has_default_p when both low and high
276         are NULL_TREE.
277         * parser.c (cp_parser_iteration_statement): Use
278         note_iteration_stmt_body_start and note_iteration_stmt_body_end
279         around parsing iteration body.
280         * pt.c (tsubst_expr): Likewise.
281         * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
282         SWITCH_STMT which contains no BREAK_STMTs, contains a default:
283         CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
284         can't fallthru.
285         * semantics.c (finish_break_stmt): Call note_break_stmt.
286         * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
287         bit to SWITCH_ALL_CASES_P.  Assert that if SWITCH_STMT_NO_BREAK_P then
288         the break label is not TREE_USED.
290 2017-11-28  Julia Koval  <julia.koval@intel.com>
291             Sebastian Peryt  <sebastian.peryt@intel.com>
293         * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
294         * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
295         * constexpr.c (potential_constant_expression_1): Ditto.
296         * cp-array-notation.c: Delete.
297         * cp-cilkplus.c: Ditto.
298         * cp-cilkplus.h: Ditto.
299         * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
300         cilkplus condition.
301         * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
302         * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
303         * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
304         * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
305         * lambda.c (cp-cilkplus.h): Remove.
306         * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
307         cp_parser_cilk_simd_vectorlength): Delete.
308         (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
309         cp_parser_postfix_expression,
310         cp_parser_postfix_open_square_expression,
311         cp_parser_statement, cp_parser_jump_statement,
312         cp_parser_direct_declarator,
313         cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
314         cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
315         cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
316         cp_parser_omp_flush,
317         cp_parser_omp_for_cond, cp_parser_omp_for_incr,
318         cp_parser_omp_for_loop_init,
319         cp_parser_omp_for_loop,
320         cp_parser_omp_declare_simd): Remove cilkplus support.
321         (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
322         cp_parser_cilk_grainsize): Remove.
323         (cp_parser_pragma, c_parse_file): Remove cilkplus support.
324         (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
325         cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
326         cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
327         * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
328         * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
329         cilkplus support.
330         * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
331         finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
332         finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
333         cilkplus
334         support.
335         * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
336         * typeck.c (cp_build_array_ref, cp_build_compound_expr,
337         check_return_expr): Remove cilkplus support.
339 2017-11-28  Jakub Jelinek  <jakub@redhat.com>
341         * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
342         build2_loc instead of build3_loc.
344 2017-11-27  Martin Sebor  <msebor@redhat.com>
346         PR c++/83058
347         * init.c (warn_placement_new_too_small): Use offset_int instead of
348         HOST_WIDE_INT.
350 2017-11-27  Jakub Jelinek  <jakub@redhat.com>
352         PR c++/81888
353         * parser.c (cp_parser_decomposition_declaration): Reject just
354         BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
355         than all such CONSTRUCTORs, and only if is_direct_init is true.
357 2017-11-27  Jason Merrill  <jason@redhat.com>
359         * pt.c (primary_template_specialization_p): Rename from
360         primary_template_instantiation_p.  Don't check
361         DECL_TEMPLATE_INSTANTIATION.
362         * call.c, cp-tree.h, decl2.c: Adjust.
364 2017-11-27  Jakub Jelinek  <jakub@redhat.com>
366         PR c++/81675
367         * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
368         for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
369         INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
370         through into normal folding, otherwise just rebuild x if any op
371         changed.
373 2017-11-14  Boris Kolpackov  <boris@codesynthesis.com>
375         * Make-lang.in (c++.install-plugin): Install backend import library.
377 2017-11-23  Jakub Jelinek  <jakub@redhat.com>
379         * parser.c (cp_parser_omp_declare): Change return type to bool from
380         void, return true for declare simd.
381         (cp_parser_pragma): Return cp_parser_omp_declare returned value
382         rather than always false.
384 2017-11-23  Mike Stump  <mikestump@comcast.net>
385             Eric Botcazou  <ebotcazou@adacore.com>
387         * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
388         * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
389         ANNOTATE_EXPR.
390         (finish_do_stmt): Likewise.
391         (finish_for_cond): Likewise.
393 2017-11-22  Jakub Jelinek  <jakub@redhat.com>
395         PR c++/82401
396         * name-lookup.c (member_name_cmp): Return 0 if a == b.
398 2017-11-22  David Malcolm  <dmalcolm@redhat.com>
400         PR c++/62170
401         * error.c (type_to_string): Add leading comment.  Add params
402         "postprocessed", "quote", and "show_color", using them to fix
403         quoting of the "aka" for types involving typedefs.
404         (arg_to_string): Update for new params to type_to_string.
405         (cxx_format_postprocessor::handle): Likewise.
406         (cp_printer): Convert penultimate param from bool to bool *.
407         Update call to type_to_string and calls to
408         defer_phase_2_of_type_diff.
410 2017-11-22  Marek Polacek  <polacek@redhat.com>
412         PR c++/60336
413         PR middle-end/67239
414         PR target/68355
415         * class.c (layout_class_type): Set DECL_PADDING_P on padding.
416         * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
417         (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
419 2017-11-21  Martin Liska  <mliska@suse.cz>
421         * class.c (finalize_literal_type_property): Add quotes for
422         constexpr keyword.
423         (explain_non_literal_class): Likewise.
424         * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
425         (is_valid_constexpr_fn): Likewise.
426         (check_constexpr_ctor_body): Likewise.
427         (register_constexpr_fundef): Likewise.
428         (explain_invalid_constexpr_fn): Likewise.
429         (cxx_eval_builtin_function_call): Likewise.
430         (cxx_eval_call_expression): Likewise.
431         (cxx_eval_loop_expr): Likewise.
432         (potential_constant_expression_1): Likewise.
433         * decl.c (check_previous_goto_1): Likewise.
434         (check_goto): Likewise.
435         (grokfndecl): Likewise.
436         (grokdeclarator): Likewise.
437         * error.c (maybe_print_constexpr_context): Likewise.
438         * method.c (process_subob_fn): Likewise.
439         (defaulted_late_check): Likewise.
440         * parser.c (cp_parser_compound_statement): Likewise.
442 2017-11-21  Marc Glisse  <marc.glisse@inria.fr>
444         * constexpr.c (cxx_eval_constant_expression,
445         potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
446         * cp-gimplify.c (cp_fold): Likewise.
447         * error.c (dump_expr): Likewise.
448         * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
450 2017-11-21  Jakub Jelinek  <jakub@redhat.com>
452         P0428R2 - familiar template syntax for generic lambdas
453         * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
454         for cxx2a and above, reword pedwarn for C++14/C++17.
456 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
458         PR c/81404
459         * name-lookup.c: Include "c-family/known-headers.h"
460         (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
461         potentially return a new suggest_missing_header hint.
463 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
465         PR c++/72786
466         * name-lookup.c (class macro_use_before_def): New class.
467         (lookup_name_fuzzy): Detect macro that were used before being
468         defined, and report them as such.
470 2017-11-20  Jason Merrill  <jason@redhat.com>
472         * decl2.c (constrain_class_visibility): Don't warn about artificial
473         fields.
475 2017-11-20  Jakub Jelinek  <jakub@redhat.com>
477         P0329R4: Designated Initialization
478         * parser.c (cp_parser_initializer_clause): List in comment grammar
479         designated-initializer-list.
480         (cp_parser_initializer_list): Allow .identifier = without pedwarn for
481         C++2A, parse .identifier { ... }.  Improve location_t argument to
482         pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
483         designated initializer list.  Diagnose mixing designated and
484         non-designated initializer clauses for C++2A.  Diagnose duplicated
485         identifiers in designators.
486         * name-lookup.h (search_anon_aggr): New declaration.
487         * name-lookup.c (fields_linear_search): Use search_anon_aggr.
488         (search_anon_aggr): New function.
489         * typeck2.c (process_init_constructor_record): Allow designator
490         to skip over some non-static data members.  Handle anonymous
491         aggregates.  Add diagnostics for designator order not matching
492         member declaration order.
494 2017-11-20  David Malcolm  <dmalcolm@redhat.com>
496         * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
497         Include "c-family/name-hint.h"
498         (suggest_alternatives_for): Convert "fuzzy_name" from const char *
499         to name_hint, and rename to "hint".  Pass location to
500         lookup_name_fuzzy.
501         (lookup_name_fuzzy): Convert return type from const char *
502         to name_hint.  Add location_t param.
503         * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
504         Include "c-family/name-hint.h"
505         (cp_parser_diagnose_invalid_type_name): Convert
506         "suggestion" from const char * to name_hint, and rename to "hint".
507         Pass location to lookup_name_fuzzy.
509 2017-11-20  Nathan Sidwell  <nathan@acm.org>
511         PR c++/82878
512         PR c++/78495
513         * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
514         ctor.
515         * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
516         inhibibition check removed in previous c++/78495 change.
518 2017-11-20   Jakub Jelinek  <jakub@redhat.com>
520         PR c++/82781
521         * constexpr.c (cxx_eval_vector_conditional_expression): New function.
522         (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
523         of cxx_eval_conditional_expression.
525 2017-11-19  Jakub Jelinek  <jakub@redhat.com>
527         PR c/66618
528         PR c/69960
529         * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
530         cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
532 2017-11-16  Jason Merrill  <jason@redhat.com>
534         PR c++/79092 - non-type args of different types are different
535         * tree.c (cp_tree_equal): Check the type of constants.
536         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
537         when comparing to previously deduced argument.
538         (maybe_convert_nontype_argument): New.
539         (convert_nontype_argument): Call it.
540         (tsubst_copy_and_build): Handle partial instantiation of
541         IMPLICIT_CONV_EXPR.
542         (unify): Ignore type when deducing from array bound.
543         (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
544         (value_dependent_expression_p): Any type-dependent expression is
545         value-dependent.  Handle IMPLICIT_CONV_EXPR.
546         * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
547         * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
549 2017-11-16  Nathan Sidwell  <nathan@acm.org>
551         PR c++/82836
552         PR c++/82737
553         * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
554         Override.
555         * cp-tree.h (overwrite_mangling): Declare.
556         * decl2.c (struct mangled_decl_hash): Entries are deletable.
557         (overwrite_mangling): New.
559         PR c++/81060
560         * decl.c (xref_tag_1): Push lambda into current scope.
561         * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
563 2017-11-15  Nathan Sidwell  <nathan@acm.org>
565         PR c++/81574
566         * lambda.c (lambda_capture_field_type): Function references are
567         always catured by reference.
569 2017-11-15  Martin Liska  <mliska@suse.cz>
571         * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
572         instead of cp_build_indirect_ref.
574 2017-11-15  Martin Liska  <mliska@suse.cz>
576         * decl.c (begin_destructor_body): In case of VPTR sanitization
577         (with disabled recovery), zero vptr in order to catch virtual calls
578         after lifetime of an object.
580 2017-11-14  Jason Merrill  <jason@redhat.com>
582         Use GTY((cache)) on some hash tables.
583         * decl.c (decomp_type_table): Use tree_cache_map.
584         * init.c (nsdmi_inst): Likewise.
585         * pt.c (defarg_ints): Likewise.
586         * cp-objcp-common.c (cp_get_debug_type): Likewise.
588 2017-11-13  Jason Merrill  <jason@redhat.com>
590         Capture adjustments for P0588R1.
591         * semantics.c (process_outer_var_ref): Capture variables when
592         they are named; complain about non-capture uses when odr-used.
593         * expr.c (mark_use): Rvalue use looks through capture proxy.
594         * constexpr.c (potential_constant_expression_1): Improve error about
595         use of captured variable.
596         * lambda.c (need_generic_capture, dependent_capture_r)
597         (do_dependent_capture, processing_nonlambda_template): Remove.
598         * call.c (build_this): Remove uses of the above.
599         * decl.c (cp_finish_decl): Likewise.
600         * semantics.c (maybe_cleanup_point_expr)
601         (maybe_cleanup_point_expr_void, finish_goto_stmt)
602         (maybe_convert_cond): Likewise.
603         * typeck.c (check_return_expr): Likewise.
605         Defer folding of *&.
606         * typeck.c (cp_build_fold_indirect_ref): New.
607         (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
608         Add 'fold' parameter.
609         * cp-tree.h: Declare cp_build_fold_indirect_ref.
610         * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
611         parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
612         * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
613         (cp_convert_range_for): Likewise.
614         * typeck2.c (build_x_arrow): Use RO_ARROW.
616         * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
617         INDIRECT_REF of ADDR_EXPR.
619         PR c++/82360 - ICE with static_cast in template.
620         * call.c (perform_direct_initialization_if_possible): Check
621         processing_template_decl.
622         * typeck.c (build_static_cast_1): Likewise.
624 2017-11-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
626         Remove the null check from placement new in all modes
627         * init.c (build_new_1): Don't do a null check for
628         a namespace-scope non-replaceable placement new
629         in any mode unless -fcheck-new is provided.
631 2017-11-07 Boris Kolpackov  <boris@codesynthesis.com>
633         * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
634         in cp-tree.h.
636 2017-11-07  Jakub Jelinek  <jakub@redhat.com>
638         PR c++/82835
639         * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
640         convert_default_arg instead of i.
642 2017-11-06  Jason Merrill  <jason@redhat.com>
644         P0704R1 - fixing const-qualified pointers to members
645         * typeck2.c (build_m_component_ref): Also accept in lower stds with
646         a pedwarn.
648 2017-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
650         PR c++/65579
651         * decl2.c (finish_static_data_member_decl): If there's an initializer,
652         complete the type and re-apply the quals.
654 2017-11-06  Martin Liska  <mliska@suse.cz>
656         PR middle-end/82404
657         * constexpr.c (cxx_eval_builtin_function_call): Handle
658         __builtin_unreachable call.
659         (get_function_named_in_call): Declare function earlier.
660         (constexpr_fn_retval): Skip __builtin_unreachable.
661         * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
662         ...
663         (cp_maybe_instrument_return): ... this.
664         (cp_genericize): Call the function unconditionally.
666 2017-11-03  Nathan Sidwell  <nathan@acm.org>
668         PR c++/82710
669         * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
670         warning too.
672 2017-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
674         PR c++/81957
675         * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
676         (expand_integer_pack, convert_template_argument, coerce_template_parms,
677         gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
678         unify): Adjust calls.
679         * tree.c (cp_build_qualified_type_real): Likewise.
680         * cp-tree.h (make_pack_expansion): Adjust declaration.
682 2017-11-02  Nathan Sidwell  <nathan@acm.org>
684         * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
685         (IDENTIFIER_NEW_OP_P): New.
686         * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
687         * pt.c (push_template_decl_real): Likewise.
688         * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
690         PR c++/82710
691         * decl.c (grokdeclarator): Don't warn when parens protect a return
692         type from a qualified name.
694 2017-11-01  Nathan Sidwell  <nathan@acm.org>
696         * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
697         Renumber and reserve udlit value.
698         (IDENTIFIER_NEWDEL_OP_P): Delete.
699         (IDENTIFIER_OVL_OP_P): New.
700         (IDENTIFIER_ASSIGN_OP_P): Adjust.
701         (IDENTIFIER_CONV_OP_P): Adjust.
702         (IDENTIFIER_OVL_OP_INFO): Adjust.
703         (IDENTIFIER_OVL_OP_FLAGS): New.
704         * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
705         * lex.c (get_identifier_kind_name): Adjust.
706         (init_operators): Don't special case new/delete ops.
707         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
708         * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
709         * typeck.c (check_return_expr): Likewise.
711         * cp-tree.h (assign_op_identifier, call_op_identifier): Use
712         compressed code.
713         (struct lang_decl_fn): Use compressed operator code.
714         (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
715         (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
716         (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
717         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
718         (build_library_fn): Likewise.
719         (grok_op_properties): Likewise.
720         * mangle.c (write_unqualified_name): Likewise.
721         * method.c (implicitly_declare_fn): Likewise.
722         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
724         * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
725         (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
726         (enum ovl_op_code): New.
727         (struct ovl_op_info): Add ovl_op_code field.
728         (ovl_op_info): Size by OVL_OP_MAX.
729         (ovl_op_mapping, ovl_op_alternate): Declare.
730         (OVL_OP_INFO): Adjust for mapping array.
731         (IDENTIFIER_OVL_OP_INFO): New.
732         * decl.c (ambi_op_p, unary_op_p): Delete.
733         (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
734         ovl_op_alternate.
735         * lex.c (ovl_op_info): Adjust and static initialize.
736         (ovl_op_mappings, ovl_op_alternate): Define.
737         (init_operators): Iterate over ovl_op_info array and init mappings
738         & alternate arrays.
739         * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
740         * operators.def (DEF_OPERATOR): Remove KIND parm.
741         (DEF_SIMPLE_OPERATOR): Delete.
742         (OPERATOR_TRANSITION): Expand if defined.
744 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
746         * pt.c (listify): Use %< and %> for description of #include.
748 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
750         * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
751         than 0.
752         * name-lookup.c (suggest_alternatives_for): Update for renaming of
753         inform_at_rich_loc.
754         (maybe_suggest_missing_header): Likewise.
755         (suggest_alternative_in_explicit_scope): Likewise.
756         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
757         renaming of error_at_rich_loc.
758         (cp_parser_string_literal): Likewise.
759         (cp_parser_nested_name_specifier_opt): Likewise.
760         (cp_parser_cast_expression): Likewise for renaming of
761         warning_at_rich_loc.
762         (cp_parser_decl_specifier_seq): Likewise for renaming of
763         error_at_rich_loc and warning_at_rich_loc.
764         (cp_parser_elaborated_type_specifier): Likewise for renaming of
765         pedwarn_at_rich_loc.
766         (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
767         error_at_rich_loc.
768         (cp_parser_virt_specifier_seq_opt): Likewise.
769         (cp_parser_class_specifier_1): Likewise.
770         (cp_parser_class_head): Likewise.
771         (cp_parser_member_declaration): Likewise for renaming of
772         pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
773         (cp_parser_enclosed_template_argument_list): Likewise for renaming
774         of error_at_rich_loc.
775         (set_and_check_decl_spec_loc): Likewise.
776         * pt.c (listify): Likewise.
777         * rtti.c (typeid_ok_p): Likewise.
778         * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
779         than 0.
780         * typeck.c (access_failure_info::maybe_suggest_accessor): Update
781         for renaming of inform_at_rich_loc.
782         (finish_class_member_access_expr): Likewise for renaming of
783         error_at_rich_loc.
785 2017-10-31  Nathan Sidwell  <nathan@acm.org>
787         * cp-tree.h (struct operator_name_info_t): Rename to ...
788         (struct ovl_op_info_t): ... here.  Add tree_code field.
789         (operator_name_info, assignment_operator_name_info): Delete.
790         (ovl_op_info): Declare.
791         (OVL_OP_INFO): Adjust.
792         * decl.c (grok_op_properties): Use ovl_op_flags.
793         * lex.c (operator_name_info, assignment_operator_name_info):
794         Delete.
795         (ovl_op_info): Define.
796         (set_operator_ident): Adjust.
797         (init_operators): Set tree_code.
798         * mangle.c (write_unqualified_id): Adjust operator array scan.
800         * lex.c (init_operators): Allow NULL operator name.  Don't add
801         special cases.
802         * operators.def: Use NULL for mangling only operators.  Move to
803         after regular operators but move assignment operators last.
805         * cp-tree.h (enum ovl_op_flags): New.
806         (struct operator_name_info_t): Rename arity to flags.
807         * lex.c (set_operator_ident): New.
808         (init_operators): Use it.  Adjust for flags.
809         * mangle.c (write_unqualified_id): Adjust for flags.
810         * operators.def: Replace arity with flags.
812         * cp-tree.h (ovl_op_identifier): New.
813         (assign_op_identifier, call_op_identifier): Adjust.
814         (cp_operator_id, cp_assignment_operator_ide): Delete.
815         (SET_OVERLOADED_OPERATOR_CODE): Delete.
816         (OVL_OP_INFO): New.
817         * call.c (op_error): Use OVL_OP_INFO.
818         (build_conditional_expr_1): Use ovl_op_identifier.
819         (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
820         (build_op_delete_call): Likewise.
821         * class.c (type_requires_array_cookie): Use ovl_op_identifier.
822         * decl.c (duplicate_decls): Directly copy operator code.
823         (builtin_function_1): Do not set operator code.
824         (build_library_fn): Directly set operator code.
825         (push_cp_library_fn): Use ovl_op_identifier.
826         (grok_op_properties): Directly set operator code.
827         * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
828         * error.c (dump_expr): Use OVL_OP_INFO.
829         (op_to_string): Add assop arg. Use OVL_OP_INFO.
830         (assop_to_string): Delete.
831         (args_to_string): Adjust.
832         * init.c (build_new_1): Use ovl_op_identifier.
833         * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
834         (write_expression): Likewise.
835         * method.c (synthesized_method_walk): Use ovl_op_identifier.
836         (implicitly_declare_fn): Use assign_op_identifier. Directly set
837         operator code.
838         * name-lookup.c (get_class_binding): Use assign_op_identifier.
839         * parser.c (cp_parser_operator): Use ovl_op_identifier.
840         (cp_parser_omp_clause_reduction): Likewise.
841         * semantics.c (omp_reduction_id): Likewise.
842         * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
844         * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
845         (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
846         (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
847         (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
848         * call.c (add_function_candidate): Use
849         DECL_OVERLOADED_OPERATOR_IS.
850         (build_op_call_1): Use call_op_identifier &
851         DECL_OVERLOADED_OPERATOR_IS.
852         (build_over_call): Likewise.
853         (has_trivial_copy_assign_p): Use assign_op_identifier.
854         (build_special_member_call): Likewise.
855         * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
856         (vbase_has_user_provided_move_assign,
857         classtype_has_move_assign_or_move_ctor_p): Likewise.
858         * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
859         (grok_special_member_properties): Use assign_op_identifier.
860         (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
861         * decl2.c (mark_used): Use DECL_CONV_FN_P.
862         * dump.c (dump_access): Delete prototype.
863         (dump_op): Delete.
864         (cp_dump_tree): Don't call it.
865         * lambda.c (lambda_function): Use call_op_identifier.
866         (maybe_add_lambda_conv_op): Not an overloaded operator.  Remove
867         unneeded braces.
868         * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
869         * method.c (do_build_copy_assign): Use assign_op_identifier.
870         (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
871         (get_copy_assign): Use assign_op_identifier.
872         (synthesized_method_walk): Likewise.
873         (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
874         * parser.c (cp_parser_lambda_declarator_opt): Use
875         call_op_identifier.
876         * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
877         assign_op_identifier.
878         * tree.c (special_function_p):  Use DECL_OVERLOADED_OPERATOR_IS.
879         * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
880         (check_return_expr): Use assign_op_identifier.
882 2017-10-30  Paolo Carlini  <paolo.carlini@oracle.com>
884         PR c++/82085
885         * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
886         unconditionally call convert_from_reference.
888 2017-10-30  Nathan Sidwell  <nathan@acm.org>
890         * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
891         as a few lines earlier.
892         * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
893         * decl.c (grokfndecl): Fix indentation.
894         (compute_array_index_type): Use processing_template_decl_sentinel.
895         (grok_op_properties): Move warnings to end.  Reorder other checks
896         to group similar entities.  Tweak diagnostics.
897         * lex.c (unqualified_name_lookup_error): No need to check name is
898         not ERROR_MARK operator.
899         * parser.c (cp_parser_operator): Select operator code before
900         looking it up.
901         * typeck.c (check_return_expr): Fix indentation and line wrapping.
903 2017-10-27  Paolo Carlini  <paolo.carlini@oracle.com>
905         * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
907 2017-10-26  Nathan Sidwell  <nathan@acm.org>
909         * decl.c (sort_labels): Restore function.
910         (pop_labels): Sort labels
911         (identify_goto): Add translation markup.
913 2017-10-25  Nathan Sidwell  <nathan@acm.org>
915         Kill IDENTIFIER_LABEL_VALUE.
916         * cp-tree.h (lang_identifier): Delete label_value slot.
917         (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
918         (struct named_label_hasher): Rename to ...
919         (struct named_label_hash): ... here.  Reimplement.
920         (struct language_function): Adjust x_named_labels.
921         * name-lookup.h (struct cp_label_binding): Delete.
922         (struct cp_binding_level): Delete shadowed_labels slot.
923         * decl.c (struct named_label_entry): Add name and outer slots.
924         (pop_label): Rename to ...
925         (check_label_used): ... here.  Don't pop.
926         (note_label, sort_labels): Delete.
927         (pop_labels, pop_local_label): Reimplement.
928         (poplevel): Pop local labels as any other decl. Remove
929         shadowed_labels handling.
930         (named_label_hash::hash, named_label_hash::equal): New.
931         (make_label_decl): Absorb into ...
932         (lookup_label_1): ... here.  Add making_local_p arg, reimplement.
933         (lookup_label, declare_local_label): Adjust.
934         (check_goto, define_label): Adjust.
935         * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
936         * ptree.c (cxx_print_identifier): Don't print identifier binding.
938         * decl.c (identifier_goto): Reduce duplication.
939         (check_previous_goto_1): Likewise.
940         (check_goto): Move var decls to initialization.
941         (check_omp_return, define_label_1, define_label): Likewise.
943 2017-10-25  Jakub Jelinek  <jakub@redhat.com>
945         PR libstdc++/81706
946         * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
947         newdecl to corresponding __builtin_ if any.
949 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
951         PR c++/82466
952         * decl.c (duplicate_decls): Warn for built-in functions declared as
953         non-function, use OPT_Wbuiltin_declaration_mismatch.
955         * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
957 2017-10-24  Paolo Carlini  <paolo.carlini@oracle.com>
959         PR c++/80991
960         * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
961         a TREE_LIST as TRAIT_EXPR_TYPE2.
963 2017-10-24  Mukesh Kapoor  <mukesh.kapoor@oracle.com>
964             Paolo Carlini  <paolo.carlini@oracle.com>
966         PR c++/82307
967         * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
968         enumeration type whose underlying type is fixed.
970 2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
972         PR c++/80449
973         * semantics.c (finish_compound_literal): Check do_auto_deduction
974         return value for error_mark_node.
976 2017-10-23  Jason Merrill  <jason@redhat.com>
978         PR c++/77369 - wrong noexcept handling in C++14 and below
979         * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
981 2017-10-20  Nathan Sidwell  <nathan@acm.org>
983         * class.c (layout_class_type): Cleanup as-base creation, determine
984         mode here.
985         (finish_struct_1): ... not here.
987 2017-10-19  Jakub Jelinek  <jakub@redhat.com>
989         PR c++/82600
990         * typeck.c (check_return_expr): Don't call
991         maybe_warn_about_returning_address_of_local in templates.
993 2017-10-17  Nathan Sidwell  <nathan@acm.org>
995         PR c++/82560
996         * call.c (build_over_call): Don't pass tf_no_cleanup to nested
997         calls.
999         PR middle-end/82546
1000         * cp-objcp-common.c (cp_tree_size): Reformat.  Adjust returns size
1001         of TYPE nodes.
1003 2017-10-13  Jason Merrill  <jason@redhat.com>
1005         PR c++/82357 - bit-field in template
1006         * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
1008 2017-10-13  David Malcolm  <dmalcolm@redhat.com>
1010         * cp-tree.h (maybe_show_extern_c_location): New decl.
1011         * decl.c (grokfndecl): When complaining about literal operators
1012         with C linkage, issue a note giving the location of the
1013         extern "C".
1014         * parser.c (cp_parser_new): Initialize new field
1015         "innermost_linkage_specification_location".
1016         (cp_parser_linkage_specification): Store the location
1017         of the linkage specification within the cp_parser.
1018         (cp_parser_explicit_specialization): When complaining about
1019         template specializations with C linkage, issue a note giving the
1020         location of the extern "C".
1021         (cp_parser_explicit_template_declaration): Likewise for templates.
1022         (maybe_show_extern_c_location): New function.
1023         * parser.h (struct cp_parser): New field
1024         "innermost_linkage_specification_location".
1026 2017-10-12  Nathan Sidwell  <nathan@acm.org>
1028         * cp-tree.h (cp_expr): Add const operator * and operator->
1029         accessors.
1030         (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
1031         TS_CP_WRAPPER, LAST_TS_CP_ENUM.
1033 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
1035         * parser.c (get_required_cpp_ttype): New function.
1036         (cp_parser_error_1): Call it, using the result to call
1037         maybe_suggest_missing_token_insertion.
1039 2017-10-12  David Malcolm  <dmalcolm@redhat.com>
1041         * parser.c (get_matching_symbol): Move to before...
1042         (cp_parser_error): Split out into...
1043         (cp_parser_error_1): ...this new function, merging in content
1044         from...
1045         (cp_parser_required_error): ...here.  Eliminate partial duplicate
1046         of body of cp_parser_error in favor of a call to the new
1047         cp_parser_error_1 helper function.
1049 2017-10-11  Nathan Sidwell  <nathan@acm.org>
1051         * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
1052         (record_mangling): Likewise.
1054 2017-10-10  Nathan Sidwell  <nathan@acm.org>
1056         * name-lookup.c (extern_c_fns): Rename to ...
1057         (extern_c_decls): ... here.
1058         (check_extern_c_conflict, extern_c_linkage_bindings): Update.
1059         (do_pushdecl): Check extern-c fns and vars.
1061         * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
1062         specialization.
1064         * decl2.c (struct mangled_decl_hash): New hash traits.
1065         (mangled_decls): Make hash_table<mangled_decl_hash>.
1066         (generate_mangling_alias, record_mangling): Adjust.
1068 2017-10-10  Jason Merrill  <jason@redhat.com>
1070         More delayed lambda capture fixes.
1071         * call.c (add_function_candidate): Use build_address.
1072         (build_op_call_1): Call mark_lvalue_use early.
1073         (build_over_call): Handle error from build_this.
1074         * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
1075         (cxx_eval_increment_expression): Don't use rvalue().
1076         * cvt.c (convert_to_void): Use mark_discarded_use.
1077         * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR.  Fix
1078         reference handling.  Don't copy the expression.
1079         (mark_discarded_use): New.
1080         * lambda.c (insert_capture_proxy): Add some sanity checking.
1081         (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
1082         * pt.c (register_local_specialization): Add sanity check.
1083         * semantics.c (process_outer_var_ref): Fix check for existing proxy.
1084         * typeck.c (cp_build_addr_expr_1): Handle error from
1085         mark_lvalue_use.
1086         (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
1087         from rvalue.
1089         Handle generic lambda capture in dependent expressions.
1090         * lambda.c (need_generic_capture, dependent_capture_r)
1091         (do_dependent_capture): New.
1092         * pt.c (processing_nonlambda_template): Use need_generic_capture.
1093         * semantics.c (maybe_cleanup_point_expr)
1094         (maybe_cleanup_point_expr_void, finish_goto_stmt)
1095         (maybe_convert_cond): Call do_dependent_capture.
1096         * typeck.c (build_static_cast): Remove dependent capture handling.
1098         * typeck.c (condition_conversion): Assert !processing_template_decl.
1099         * semantics.c (finish_omp_clauses): Don't
1100         fold_build_cleanup_point_expr if processing_template_decl.
1101         (outer_var_p): A temporary can't be from an outer scope.
1102         * pt.c (type_dependent_expression_p): Fix dependency checking of
1103         functions without DECL_TEMPLATE_INFO.
1104         (instantiate_decl): Use lss_copy.
1105         * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
1107         * typeck.c (check_return_expr): Check non-dependent conversion in
1108         templates.
1109         * constraint.cc (check_function_concept): Don't complain about an
1110         empty concept if seen_error.
1112 2017-10-10  Richard Sandiford  <richard.sandiford@linaro.org>
1114         * cvt.c (ignore_overflows): Use wi::to_wide when
1115         operating on trees as wide_ints.
1116         * decl.c (check_array_designated_initializer): Likewise.
1117         * mangle.c (write_integer_cst): Likewise.
1118         * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
1120 2017-10-10  Nathan Sidwell  <nathan@acm.org>
1122         * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
1124 2017-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
1126         PR c++/47791
1127         * decl.c (finish_function): Take a bool intead of an int; adjust.
1128         * cp-tree.h (finish_function): Adjust declaration.
1129         * decl2.c (generate_tls_wrapper, finish_objects,
1130         finish_static_storage_duration_function): Adjust calls.
1131         * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
1132         Likewise.
1133         * method.c (synthesize_method): Likewise.
1134         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1135         * pt.c (instantiate_decl): Likewise.
1136         * parser.c (cp_parser_function_definition_after_declarator,
1137         cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
1138         Likewise.
1139         (cp_parser_ctor_initializer_opt,
1140         cp_parser_ctor_initializer_opt_and_function_body,
1141         cp_parser_function_try_block,
1142         cp_parser_function_definition_after_declarator,
1143         cp_parser_function_transaction): Return void; adjust declarations.
1145 2017-10-06  Nathan Sidwell  <nathan@acm.org>
1147         PR c++/82424
1148         * name-lookup.c (check_local_shadow): Don't try and convert
1149         dependent types.
1151 2017-10-06  Jakub Jelinek  <jakub@redhat.com>
1153         PR c++/82299
1154         * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
1155         init.
1156         * typeck.c (convert_for_assignment): Likewise.
1158         P0704R1 - fixing const-qualified pointers to members
1159         * typeck2.c (build_m_component_ref): For -std=c++2a allow
1160         pointer to const & qualified method on rvalue.
1162 2017-10-06  Nathan Sidwell  <nathan@acm.org>
1164         Use hash_table for extern "C" names
1165         * name-lookup.c (extern_c_fns): Use hash_table.
1166         (check_extern_c_conflict): Adjust.
1167         (c_linkage_bindings): Adjust.
1169         Use hash_table for namespace bindings
1170         * cp-tree.h (struct named_decl_hash): New.
1171         (lang_decl_ns): Change type of bindings field.
1172         * lex.c (maybe_add_lang_decl_raw): Adjust.
1173         * name-lookup.c (find_namespace_slot): Adjust.
1174         (do_pushdecl): Push NULL-named namespace.
1175         (do_push_nested_namespace): Adjust.
1176         (push_namespace): Push anonymous namespace as NULL name.
1178 2017-10-05  Jason Merrill  <jason@redhat.com>
1180         Pass variadic class objects exactly like named by-value args.
1181         * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
1183 2017-10-05  Nathan Sidwell  <nathan@acm.org>
1185         Warn on MVP declarations
1186         * cp-tree.h (struct cp_declarator): Add parenthesized field.
1187         * decl.c (grokdeclarator): Warn about unnecessary parens.
1188         * parser.c (make_declarator): Init parenthesized field.
1189         (cp_parser_direct_declarator): Set parenthesized field.
1191         Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
1192         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1193         SET_IDENTIFIER_GLOBAL_VALUE): Delete.
1194         * name-lookup.h (set_global_binding): Remove NAME parm.
1195         (get_global_binding): New inline fn.
1196         * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
1197         (identifier_global_value): Move to ...
1198         * cp-objcp-common.c (identifier_global_value): ... here.
1199         * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
1200         * decl.c (record_builtin_type, expand_static_init,
1201         grokdeclarator): Adjust.
1202         * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
1203         get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
1204         * except.c (declare_library_fn, build_throw): Adjust.
1205         * init.c (throw_bad_array_length): Adjust.
1206         * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
1208         * decl2.c (record_mangling): Fix spello and formatting from
1209         previous patch.
1211 2017-10-04  Nathan Sidwell  <nathan@acm.org>
1213         Give builtin types the correct name.
1214         * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
1215         * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
1216         rname.
1218 2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>
1219             Andrew Pinski  <apinski@cavium.com>
1221         PR c++/71946
1222         * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
1224 2017-10-04  Nathan Sidwell  <nathan@acm.org>
1226         Move mangling aliases out of global namespace.
1227         * cp-tree.h (record_mangling): New.
1228         (maybe_remove_implicit_alias): Delete.
1229         * decl2.c (mangled_decls): New hash map.
1230         (generate_mangling_alias): Reimplement using mangled_decls.
1231         (record_mangling): New.
1232         * mangle.c (decl_implicit_alias_p,
1233         maybe_remove_implicit_alias): Delete.
1234         (mangle_decl): Use record_mangling.
1235         * name-lookup.c (supplement_binding_1): Remove
1236         maybe_remove_implicit_alias check.
1238 2017-10-04  Jakub Jelinek  <jakub@redhat.com>
1240         PR c++/82373
1241         * error.c (dump_function_decl): If show_return, call dump_type_suffix
1242         on the same return type dump_type_prefix has been called on.
1244 2017-10-04  Jason Merrill  <jason@redhat.com>
1246         PR c++/81525 - broken handling of auto in generic lambda.
1247         * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
1249 2017-10-04  Nathan Sidwell  <nathan@acm.org>
1251         * call.c (convert_arg_to_ellipsis): Correct comment about passing
1252         by reference.
1254 2017-10-02  Richard Sandiford  <richard.sandiford@linaro.org>
1256         * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1257         when comparing the array bounds with an ARRAY_REF index.
1259 2017-09-30  Paolo Carlini  <paolo.carlini@oracle.com>
1261         PR c++/68754
1262         * method.c (defaulted_late_check): Early return if the defaulted
1263         declaration does not match the expected signature.
1265 2017-09-29  Jakub Jelinek  <jakub@redhat.com>
1267         P0683R1 - default member initializers for bit-fields
1268         * cp-tree.h (grokbitfield): Add INIT parameter.
1269         * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1270         if true, parse a conditional-expression rather than
1271         assignment-expression.
1272         (cp_parser_member_declaration): For C++11 and later pass true
1273         as STRICT_P to cp_parser_constant_expression.  Parse C++2A bitfield
1274         NSDMIs.  Adjust grokbitfield caller.  Handle DECL_INITIAL also for
1275         DECL_C_BIT_FIELDs.
1276         (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1277         * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1278         (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1279         * decl2.c (grokbitfield): Add INIT parameter, pass it to
1280         cp_finish_decl.
1281         * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1282         just non-bitfields.
1284         * class.c (check_bitfield_decl): Retrieve and clear width from
1285         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1286         (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1287         DECL_INITIAL.
1288         (remove_zero_width_bit_fields): Adjust comment.
1289         * decl2.c (grokbitfield): Stash width into
1290         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1291         * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1292         DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1294         * parser.c (cp_parser_member_declaration): Parse attributes before
1295         colon of a bitfield in addition to after colon.
1297         * Make-lang.in (check-c++-all): Test also c++2a.
1299 2017-09-28  Jason Merrill  <jason@redhat.com>
1301         PR c++/56973, DR 696 - capture constant variables only as needed.
1302         * expr.c (mark_use): Split out from mark_rvalue_use and
1303         mark_lvalue_use.  Handle lambda capture of constant variables.
1304         (mark_lvalue_use_nonread): New.
1305         * semantics.c (process_outer_var_ref): Don't capture a constant
1306         variable until forced.
1307         * pt.c (processing_nonlambda_template): New.
1308         * call.c (build_this): Check it.
1309         * decl2.c (grok_array_decl): Call mark_rvalue_use and
1310         mark_lvalue_use_nonread.
1311         * init.c (constant_value_1): Don't call mark_rvalue_use.
1312         * typeck.c (build_static_cast): Handle lambda capture.
1314         Use local_specializations to find capture proxies.
1315         * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1316         * lambda.c (build_capture_proxy): Set it.
1317         (add_capture): Pass initializer to build_capture_proxy.
1318         (start_lambda_function): Likewise.
1319         (insert_capture_proxy): Use register_local_specialization.
1320         (is_lambda_ignored_entity): Always ignore proxies.
1321         * name-lookup.c (qualify_lookup): Don't check
1322         is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1323         * semantics.c (process_outer_var_ref): Use
1324         retrieve_local_specialization.
1325         * parser.c (cp_parser_lambda_body): Push local_specializations.
1326         * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1327         (tsubst_lambda_expr): Push local_specializations sooner.
1328         (tsubst_copy_and_build): Don't register_local_specialization.
1330         * call.c (build_special_member_call): Use the return value of
1331         mark_lvalue_use.
1332         * decl.c (compute_array_index_type): Likewise.
1333         * parser.c (cp_parser_oacc_wait_list): Likewise.
1334         * lambda.c (is_normal_capture_proxy): Handle *this capture.
1335         (add_capture): Clarify internal_error message.
1337 2017-09-22  Eric Botcazou  <ebotcazou@adacore.com>
1339         PR bootstrap/81926
1340         * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1342 2017-09-22  Jakub Jelinek  <jakub@redhat.com>
1344         PR sanitizer/81929
1345         * tree.c (struct replace_placeholders_t): Add pset field.
1346         (replace_placeholders_r): Call cp_walk_tree with d->pset as
1347         last argument instead of NULL.  Formatting fix.
1348         (replace_placeholders): Add pset variable, add its address
1349         into data.  Pass &pset instead of NULL to cp_walk_tree.
1351 2017-09-22  David Malcolm  <dmalcolm@redhat.com>
1353         * call.c (get_fndecl_argument_location): New function.
1354         (convert_like_real): Use it  when complaining about argument type
1355         mismatches.
1356         * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1357         * parser.c (make_parameter_declarator): Add "loc" param and use
1358         it to initialize the new field.
1359         (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1360         the "no_parameters" parameter.
1361         (cp_parser_parameter_declaration_list): Set the location of the
1362         result of grokdeclarator to be the parameter's loc, assuming no
1363         errors.
1364         (cp_parser_parameter_declaration): Generate a location for the
1365         parameter and pass to make_parameter_declarator.
1367 2017-09-20  Nathan Sidwell  <nathan@acm.org>
1369         * name-lookup.c (member_name_cmp): Use DECL_UID for final
1370         ordering.
1372 2017-09-20  Jakub Jelinek  <jakub@redhat.com>
1374         P0409R2 - allow lambda capture [=, this]
1375         * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1376         redundant [=, this].
1378 2017-09-18  Jason Merrill  <jason@redhat.com>
1380         PR c++/82069 - ICE with lambda in template
1381         * semantics.c (process_outer_var_ref): Check uses_template_parms
1382         instead of any_dependent_template_arguments_p.
1384 2017-09-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1385             Paolo Carlini  <paolo.carlini@oracle.com>
1387         PR c++/64644
1388         * decl2.c (finish_anon_union): Complain about "anonymous union with
1389         no members" with a pedwarn.
1391 2017-09-15  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1393         * typeck.c (build_reinterpret_cast_1,
1394         build_const_cast_1): Implement -Wcast-align=strict.
1396 2017-09-15  Jakub Jelinek  <jakub@redhat.com>
1398         * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1399         adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1400         to C++17 or -std=gnu++17 or -std=c++17.  Adjust comments.
1401         (cxx_init_decl_processing, next_initializable_field,
1402         is_direct_enum_init, check_initializer, cp_finish_decl,
1403         mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1404         finish_function): Likewise.
1405         * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1406         * pt.c (mark_template_parm, convert_nontype_argument,
1407         instantiate_class_template_1, type_unification_real, unify,
1408         get_partial_spec_bindings, dependent_type_p_r): Likewise.
1409         * typeck.c (cp_build_unary_op): Likewise.
1410         * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1411         * call.c (build_user_type_conversion_1, build_over_call,
1412         build_special_member_call): Likewise.
1413         * lambda.c (begin_lambda_type): Likewise.
1414         * typeck2.c (process_init_constructor_record): Likewise.
1415         * class.c (build_base_field, finalize_literal_type_property,
1416         explain_non_literal_class): Likewise.
1417         * parser.c (cp_parser_diagnose_invalid_type_name,
1418         cp_parser_primary_expression, cp_parser_lambda_introducer,
1419         cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1420         cp_convert_range_for, cp_parser_perform_range_for_lookup,
1421         cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1422         cp_parser_static_assert, cp_parser_simple_type_specifier,
1423         cp_parser_namespace_definition, cp_parser_using_declaration,
1424         cp_parser_init_declarator, cp_parser_type_parameter_key,
1425         cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1426         cp_parser_constructor_declarator_p): Likewise.
1427         * mangle.c (struct globals): Rename need_cxx1z_warning to
1428         need_cxx17_warning.
1429         (write_exception_spec, start_mangling, mangle_decl): Likewise.
1430         * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1431         it.
1432         (check-c++17): New goal.  Use 17 instead of 1z.
1433         (check-c++-all): Use 17 instead of 1z.
1435 2017-09-14  Jakub Jelinek  <jakub@redhat.com>
1437         PR c++/81314
1438         * cp-gimplify.c (omp_var_to_track): Look through references.
1439         (omp_cxx_notice_variable): Likewise.
1441 2017-09-13  Nathan Sidwell  <nathan@acm.org>
1443         Conv-op identifers not in identifier hash table
1444         * lex.c (conv_type_hasher): Make member fns inline.
1445         (make_conv_op_name): Directly clone conv_op_identifier.
1447         Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1448         * cp-tree.h (struct lang_type): Rename methods to members.
1449         (CLASSTYPE_METHOD_VEC): Rename to ...
1450         (CLASSTYPE_MEMBER_VEC): ... this.
1451         * name-lookup.h (get_method_slot): Rename to ...
1452         (get_member_slot): ... this.
1453         (resort_type_method_vec): Rename to ...
1454         (resort_type_member_vec): ... this.
1455         * class.c (add_method, warn_hidden): Adjust.
1456         * search.c (dfs_locate_field_accessor_pre): Adjust.
1457         * name-lookup.c (method_vec_binary_search): Rename to ...
1458         (member_vec_binary_search): ... this and adjust.
1459         (method_vec_linear_search): Rename to ...
1460         (member_vec_linear_search): ... this and adjust.
1461         (fields_linear_search, get_class_binding_direct): Adjust.
1462         (get_method_slot): Rename to ...
1463         (get_member_slot): ... this and adjust.
1464         (method_name_slot): Rename to ...
1465         (member_name_slot): ... this and adjust.
1466         (resort_type_method_vec): Rename to ...
1467         (resort_type_member_vec): ... this and adjust.
1468         (method_vec_append_class_fields): Rename to ...
1469         (member_vec_append_class_fields): ... this and adjust.
1470         (method_vec_append_enum_values): Rename to ...
1471         (member_vec_append_enum_values): ... this and adjust.
1472         (method_vec_dedup): Rename to ...
1473         (member_vec_dedup): ... this and adjust.
1474         (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1475         
1476 2017-09-12  Paolo Carlini  <paolo.carlini@oracle.com>
1478         PR c++/70621
1479         * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1480         returns it; avoid misleading error message.
1482 2017-09-12  Nathan Sidwell  <nathan@acm.org>
1484         Kill CLASSTYPE_SORTED_FIELDS.
1485         * cp-tree.h (struct lang_type): Lose sorted_fields member.
1486         (CLASSTYPE_SORTED_FIELDS): Delete.
1487         * name-lookup.h (set_class_bindings): Add EXTRA arg.
1488         * name-lookup.c (fields_linear_search): New, broken out of ...
1489         (lookup_field_1): ... here.  Delete remainder of function.
1490         (get_class_binding_direct): Reimplement without sorted_fields.
1491         (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1492         (get_method_slot): Call set_class_binding when creating method_vec
1493         on complete type.
1494         (method_name_cmp): Order identically named slots.
1495         (sorted_fields_type_new): Delete.
1496         (field_vc_append_class_fields): Rename to ...
1497         (method_vec_append_class_fields): ... here.  Adjust.
1498         (field_vec_append_enum_values): Renme to ...
1499         (method_vec_append_enum_values): ... here. Adjust.
1500         (method_vec_dedup): New.
1501         (set_class_bindings): Reimplement.
1502         (insert_late_enum_def_bindings): Reimplement.
1504         * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1505         consistency.
1506         (restort_data): Move later.
1507         (method_name_cmp, resort_method_name_cmp): Simplify.
1508         (resort_type_method_vec): Reformat.
1510 2017-09-09  Jason Merrill  <jason@redhat.com>
1512         * constexpr.c (reduced_constant_expression_p): If
1513         CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1515 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
1517         PR bootstrap/81926
1518         * cp-objcp-common.c (struct debug_type_hasher): New class.
1519         (debug_type_hash): New variable.
1520         (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1522 2017-09-08  Jason Merrill  <jason@redhat.com>
1524         PR c++/70029 - ICE with ref-qualifier and -flto
1525         * tree.c (cxx_copy_lang_qualifiers): New.
1526         * cp-tree.h: Declare it.
1527         * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1529 2017-09-06  Jason Merrill  <jason@redhat.com>
1531         PR c++/82053 - ICE with default argument in lambda in template
1532         * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1533         in templates.
1534         (retrieve_specialization): Use lambda_fn_in_template_p.
1535         * cp-tree.h: Declare it.
1537         PR c++/82070 - error with nested lambda capture
1538         * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1539         register_local_specialization.
1541 2017-09-06  Nathan Sidwell  <nathan@acm.org>
1543         * name-lookup.h (lookup_field_1): Delete.
1544         (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1545         * name-lookup.c (lookup_field_1): make static
1546         (method_vec_binary_search, method_vec_linear_search): New.  Broken
1547         out of ...
1548         (get_class_binding_direct): ... here.  Add TYPE_OR_FNS argument.
1549         Do complete search of this level.
1550         (get_class_binding): Adjust.
1551         * decl.c (reshape_init_class): Call get_class_binding.
1552         * search.c (lookup_field_r): Move field searching into
1553         get_class_binding_direct.
1555         * class.c (warn_hidden): Don't barf on non-functions.
1556         * decl2.c (check_classfn): Likewise.  Check template match earlier.
1558         * name-lookup.c (count_fields): Rename to ...
1559         (count_class_fields): ... here.  Take a class, don't count
1560         NULL-named fields.
1561         (add_fields_to_record_type): Rename to ...
1562         (field_vec_append_class_fields): ... here.  Take a class, don't
1563         add NULL-named fields.
1564         (add_enum_fields_to_record_type): Rename to ...
1565         (field_vec_append_enum_values): ... here.
1566         (set_class_bindings): Adjust, assert we added expected number.
1567         (insert_late_enum_def_bindings): Reimplement.  Create vector if
1568         there are now sufficient entries.
1570         * name-lookup.h (lookup_fnfields_slot_nolazy,
1571         lookup_fnfields_slot): Rename to ...
1572         (get_class_binding_direct, get_class_binding): ... here.
1573         * name-lookup.c (lookup_fnfields_slot_nolazy,
1574         lookup_fnfields_slot): Rename to ...
1575         (get_class_binding_direct, get_class_binding): ... here.
1576         * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1577         * call.c (build_user_type_conversion_1): Adjust.
1578         (has_trivial_copy_assign_p): Adjust.
1579         (has_trivial_copy_p): Adjust.
1580         * class.c (get_basefndecls) Adjust.
1581         (vbase_has_user_provided_move_assign) Adjust.
1582         (classtype_has_move_assign_or_move_ctor_p): Adjust.
1583         (type_build_ctor_call, type_build_dtor_call): Adjust.
1584         * decl.c (register_dtor_fn): Adjust.
1585         * decl2.c (check_classfn): Adjust.
1586         * pt.c (retrieve_specialization): Adjust.
1587         (check_explicit_specialization): Adjust.
1588         (do_class_deduction): Adjust.
1589         * search.c (lookup_field_r): Adjust.
1590         (look_for_overrides_here, lookup_conversions_r): Adjust.
1591         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1592         * tree.c (type_has_nontrivial_copy_init): Adjust.
1593         * method.c (lazily_declare_fn): Adjust comment.
1595 2017-09-05  Nathan Sidwell  <nathan@acm.org>
1597         * name-lookup.c (do_class_using_decl): Elide read-once temps.
1598         Move declarations to initializations.
1600         * class.c (add_method): Move slot search and insertion to ...
1601         * name-lookup.c (get_method_slot): ... this new function.
1602         (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1603         * name-lookup.h (get_method_slot): Declare.
1604         * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1605         realistic type.
1606         (grok_special_member_properties): Set
1607         TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1608         Improve TYPE_HAS_CONSTEXPR_CTOR setting.        
1610         * cp-tree.h (lang_decl_base): Rename template_conv_p to
1611         unknown_bound_p.
1612         (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1613         (DECL_CONV_FN_TYPE): FN must be conv op.
1614         (DECL_TEMPLATE_CONV_FN_P): Delete.
1615         (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1616         * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1617         setting.
1619         * class.c (unreverse_member_declarations): Remove extraneous if.
1620         * pt.c (push_template_decl_real): Use string concatenation, not
1621         \<newline>.  Add %<..%>.
1623 2017-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
1625         PR c++/81942
1626         * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1627         * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1628         creating cdtor_label.
1629         * constexpr.c (returns): Add the case of a constructor/destructor
1630         returning via a LABEL_DECL_CDTOR label.
1631         (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1633 2017-09-01  Nathan Sidwell  <nathan@acm.org>
1635         * cp-tree.h (resort_type_method_vec): Move declaration to ...
1636         * name-lookup.h (resort_type_method_vec): ... here.
1637         (set_class_bindings): Lose 2nd arg.
1638         * class.c (finish_struct_1, finish_struct): Adjust
1639         set_class_bindings call.  Don't call finish_struct_methods.
1640         (resort_data, method_name_cmp, resort_method_name_cmp,
1641         resort_type_method_vec, finish_struct_methods): Move to ...
1642         * name-lookup.c (resort_data, method_name_cmp,
1643         resort_method_name_cmp, resort_type_method_vec): ... here.
1644         (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
1646         * class.c (finish_struct): Call set_class_bindings for the
1647         template case too.
1649         * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
1650         Don't call maybe_warn_about_overly_private_class here.
1651         (warn_hidden): Cleanup declarations and comments.
1652         (type_has_user_provided_constructor): No need to check
1653         CLASSTYPE_METHOD_VEC.
1654         (type_has_user_provided_or_explicit_constructor): Likewise.
1655         (classtype_has_move_assign_or_move_ctor_p): Likewise.
1656         (check_bases_and_members): Don't call finish_struct_methods here.
1657         (finish_struct_1): Call finish_struct_methods and
1658         set_class_bindings immediately after layout.  Clear DECL_IN_AGGR_P
1659         here.
1660         (finish_struct): For templates process USING_DECLS and clear
1661         DECL_IN_AGGR_P before calling finish_struct_methods. Call
1662         maybe_warn_about_overly_private_class here.
1664         Revert 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1665         Restore sorted_fields vector.
1666         * cp-tree.h (lang_type): Restore sorted_fields vector.
1667         (CLASSTYPE_SORTED_FIELDS): Restore.
1668         (CLASSTYPE_BINDINGS): Delete.
1669         * name-lookup.c (lookup_field_1): Restore binary search.
1670         (sorted_fields_type_new, count_fields,
1671         add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1672         (set_class_bindings): Revert.
1673         (insert_late_enum_def_binding): Restore field_vec insertion.
1675 2017-09-01  Jakub Jelinek  <jakub@redhat.com>
1677         PR c/81887
1678         * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1680 2017-09-01  Marek Polacek  <polacek@redhat.com>
1682         PR c++/82040
1683         * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1685 2017-08-30  Jason Merrill  <jason@redhat.com>
1687         PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1688         * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1689         (regenerated_lambda_fn_p): New.
1690         (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1691         (tsubst_copy) [VAR_DECL]: Likewise.
1693         PR c++/82030 - ICE inheriting from multiple lambdas
1694         PR c++/80767
1695         * call.c (compare_ics): Handle null candidate.
1697 2017-08-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
1699         Make taking the address of an overloaded function a non-deduced context
1701         * pt.c (unify_overload_resolution_failure): Remove.
1702         (unify_one_argument): Adjust.
1704 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1705             Alan Hayward  <alan.hayward@arm.com>
1706             David Sherwood  <david.sherwood@arm.com>
1708         * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1710 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1711             Alan Hayward  <alan.hayward@arm.com>
1712             David Sherwood  <david.sherwood@arm.com>
1714         * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1716 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
1717             Alan Hayward  <alan.hayward@arm.com>
1718             David Sherwood  <david.sherwood@arm.com>
1720         * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1721         instead of TYPE_MODE.
1723 2017-08-29  Jason Merrill  <jason@redhat.com>
1725         PR c++/81236 - ICE with template-id in generic lambda
1726         * semantics.c (finish_id_expression): Remove special dependent case.
1727         Avoid some later pieces when dependent.
1728         (finish_qualified_id_expr): Do normal BASELINK handling in a
1729         template.  Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1730         (parsing_default_capturing_generic_lambda_in_template): Remove.
1731         * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1732         error for types that will never be complete.
1733         * mangle.c (write_expression): Add sanity check.
1734         * tree.c (build_qualified_name): Add sanity check.
1735         (cp_walk_subtrees): Walk into the class context of a BASELINK.
1736         * lambda.c (add_capture): Improve diagnostic for generic lambda
1737         capture failure.
1738         * call.c (build_new_method_call_1): Print the right constructor
1739         name.
1741         Reimplement handling of lambdas in templates.
1742         * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1743         * decl.c (start_preparsed_function): Call start_lambda_scope.
1744         (finish_function): Call finish_lambda_scope.
1745         * init.c (get_nsdmi): Call start/finish_lambda_scope.
1746         * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1747         * parser.c (cp_parser_function_definition_after_declarator): Don't
1748         call start/finish_lambda_scope.
1749         * pt.c (retrieve_specialization): Ignore lambda functions in
1750         templates.
1751         (find_parameter_packs_r): Ignore capture proxies.  Look into
1752         lambdas.
1753         (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1754         (tsubst_default_argument): Call start/finish_lambda_scope.
1755         (tsubst_function_decl): Handle lambda functions differently.
1756         (tsubst_template_decl): Likewise.
1757         (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1758         proxies.
1759         (tsubst_lambda_expr): Create a new closure rather than instantiate
1760         the one from the template.
1761         (tsubst_copy_and_build): Don't register a specialization of a pack.
1762         (regenerate_decl_from_template): Call start/finish_lambda_scope.
1763         (instantiate_decl): Remove special lambda function handling.
1764         * semantics.c (process_outer_var_ref): Remove special generic lambda
1765         handling.  Don't implicitly capture in a lambda in a template.  Look
1766         for an existing proxy.
1767         * class.c (current_nonlambda_class_type): Use decl_type_context.
1769         * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1770         (LAMBDA_EXPR_RETURN_TYPE): Remove.
1771         (struct tree_lambda_expr): Remove closure and return_type fields.
1772         * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1773         * pt.c (tsubst_copy_and_build): Likewise.
1774         * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1775         (cp_parser_lambda_body): Adjust unspecified return type check.
1776         * ptree.c (cxx_print_lambda_node): Don't print closure or
1777         return type.
1779         PR c++/80935 - wrong C++17 error with lambda
1780         * decl.c (check_for_uninitialized_const_var): Check
1781         is_instantiation_of_constexpr.
1782         * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1783         is_instantiation_of_constexpr.
1784         (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1786         * lambda.c (build_lambda_object): Check for error_mark_node.
1787         * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1788         pack as well.
1789         (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1790         (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1792         PR c++/80767 - unnecessary instantiation of generic lambda
1793         * call.c (convert_like_real): Call build_user_type_conversion_1 if
1794         cand is null.
1795         (add_conv_candidate): Build a ck_user conversion with no candidate.
1797         Fix lambdas in template default argument of inherited ctor.
1798         * method.c (synthesized_method_base_walk): Replace an inherited
1799         template with its specialization.
1800         (synthesized_method_walk): Make inheriting_ctor a pointer.
1801         (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1802         (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1804         * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1805         template, not the function.
1806         (template_guide_p): Adjust.
1808         Support copying local_specializations.
1809         * cp-tree.h (enum lss_policy): New.
1810         (local_specialization_stack): Add policy parameter to default ctor.
1811         * pt.c (local_specialization_stack): Copy local_specializations if
1812         lss_copy.
1814         * constexpr.c (potential_constant_expression_1): Add "now" parm.
1815         (is_constant_expression, require_constant_expression): New.
1816         (is_static_init_expression, is_nondependent_constant_expression)
1817         (is_nondependent_static_init_expression): Drop "potential".
1818         * except.c (build_must_not_throw_expr): Do type conversion on
1819         value-dependent argument.
1820         * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1822         Instantiate default arguments/member initializers once.
1823         * init.c (get_nsdmi): Remember NSDMI instantiations.
1824         * parser.c (inject_this_parameter): Be more picky about
1825         current_class_ptr.
1826         * pt.c (tsubst_copy): Simplify 'this' handling.
1827         (tsubst_default_argument): Remember default argument
1828         instantiations.  Take parameter number.
1829         (tsubst_default_arguments): Pass it.
1830         * call.c (convert_default_arg): Likewise.
1832         Fix default argument conversion failure and SFINAE.
1833         * call.c (build_over_call): Check convert_default_arg result for
1834         error_mark_node.
1835         * parser.c (cp_parser_late_parsing_default_args): Remember
1836         error_mark_node.
1838 2017-08-28  Nathan Sidwell  <nathan@acm.org>
1840         * cp-tree.h (lang_type): Replace sorted_fields vector with
1841         bindings map.
1842         (CLASSTYPE_SORTED_FIELDS): Delete.
1843         (CLASSTYPE_BINDINGS): New.
1844         * decl.c (finish_enum_value_list): Swap args of
1845         insert_late_enum_def_bindings.
1846         * name-lookup.c (lookup_field_1): Replace binary search of sorted
1847         fields with map->get.
1848         (sorted_fields_type_new, count_fields,
1849         add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1850         (add_class_member, add_class_members): New.
1851         (set_class_bindings): Create map and insert.
1852         (insert_late_enum_def_binding): Swap parms.  Use add_clasS_member.
1853         * ptree.c (cxx_print_type): Delete sorted fields printing.
1855         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1856         Delete.
1857         * name-lookup.h (set_class_bindings,
1858         insert_late_enum_def_bindings): Declare.
1859         * decl.c (finish_enum_value_list): Adjust for
1860         insert_late_enum_def_bindings name change.
1861         * class.c (finish_struct_1): Call set_class_bindings.
1862         (count_fields, add_fields_to_record_type,
1863         add_enum_fields_to_record_type, sorted_fields_type_new,
1864         insert_into_classtype_sorted_fields,
1865         insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1866         * name-lookup.h (count_fields, add_fields_to_record_type,
1867         add_enum_fields_to_record_type, sorted_fields_type_new,
1868         set_class_bindings, insert_late_enum_def_bindings): ... here.
1870 2017-08-25  Nathan Sidwell  <nathan@acm.org>
1872         * class.c (method_name_cmp, resort_method_name_cmp): Methods
1873         can never be NULL.
1875         Conversion operators have a special name
1876         * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1877         (conv_op_marker, conv_op_identifier): New.
1878         (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1879         * decl.c (initialize_predefined_identifiers): Add
1880         conv_op_identifier.
1881         (cxx_init_decl_processing): Create conv_op_marker.
1882         * decl2.c (check_classfn): Lookup conv-ops by name.
1883         * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1884         (resort_type_method_vec): Don't skip conv-ops.
1885         (finish_struct_methods, warn_hidden): Likewise.
1886         * name-lookup.h (lookup_all_conversions): Delete.
1887         * name-lookup.c (lookup_conversion_operator): Replace with ...
1888         (extract_conversion_operator): ... this.
1889         (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1890         (lookup_all_conversions): Delete.
1891         * pt.c (check_explicit_specialization): Find conv-ops by name.
1892         * search.c (lookup_conversions_r): Likewise.
1894 2017-08-24  Nathan Sidwell  <nathan@acm.org>
1896         Conversion operators kept on single overload set
1897         * class.c (add_method): Keep all conv-ops on one slot.
1898         * name-lookup.c (lookup_conversion_operator): Pull the desired
1899         conv op out of overload set.
1900         * search.c (lookup_conversions_r): Lose template/non-template
1901         distinction.
1902         (lookup_conversions): Likewise.
1904 2017-08-23  Nathan Sidwell  <nathan@acm.org>
1906         * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1907         lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1908         declatations to ...
1909         * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1910         lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1911         * search.c (lookup_conversion_operator,
1912         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1913         lookup_all_conversions): Move to ...
1914         * name-lookup.c (lookup_conversion_operator,
1915         lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1916         lookup_all_conversions): ... here.
1918         * semantics.c (finish_member_declaration): Move USING_DECL check
1919         earlier.  Always set C++ linkage.  Commonize TYPE_FIELD and
1920         template decl list insertion.
1922         * cp-tree.h (maybe_version_functions): Declare.
1923         * decl.c (decls_match): Break function versioning check to
1924         separate function.  Call it.
1925         (maybe_version_functions): Broken out of decls_match.
1926         * class.c (add_method): Use maybe_version_functions.
1928         * cp-tree.h (print_search_statistics,
1929         reinit_search_statistics): Don't declare.
1930         * search.c (n_fields_searched, n_calls_lookup_field,
1931         n_calls_lookup_field_1, n_calls_lookup_fnfields,
1932         n_calls_lookup_fnfields_1, n_calls_get_base_type,
1933         n_outer_fields_searched, n_contexts_saved): Delete.
1934         (lookup_field_1, lookup_member,
1935         lookup_fnfields_slot_nolazy): Remove stat gathering.
1936         (print_search_statistics, reinit_search_statistics): Delete.
1937         * tree.c (cxx_print_statistics): Don't print search stats.
1939 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1941         * search.c (lookup_field_r): Remove obsolete code for type-named
1942         field in PoD.
1944         * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1945         isn't special.
1946         (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1947         (lookup_field_fuzzy_r): Adjust.
1949 2017-08-21  David Malcolm  <dmalcolm@redhat.com>
1951         * call.c (build_over_call): Pass NULL for new parameter to
1952         check_function_arguments.
1953         * typeck.c (cp_build_function_call_vec): Likewise.
1955 2017-08-21  Nathan Sidwell  <nathan@acm.org>
1957         PR c++/81899
1958         * pt.c (instantiate_class_template_1):
1959         BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1961 2017-08-18  David Malcolm  <dmalcolm@redhat.com>
1963         PR c++/81514
1964         * name-lookup.c (maybe_suggest_missing_header): Convert return
1965         type from void to bool; return true iff a suggestion was offered.
1966         (suggest_alternative_in_explicit_scope): Move call to
1967         maybe_suggest_missing_header to before use of best_match, and
1968         return true if the former offers a suggestion.
1970 2017-08-18  H.J. Lu  <hongjiu.lu@intel.com>
1972         PR c/53037
1973         * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1974         * decl2.c (grokbitfield): Don't allow bit-field with
1975         warn_if_not_aligned type.
1977 2017-08-17  Nathan Sidwell  <nathan@acm.org>
1979         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1980         * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1981         (TYPE_TEMPLATE_INFO): Simplify.
1982         (SET_TYPE_TEMPLATE_INFO): Simplify.
1984         * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1985         don't need lang_type.
1986         (cxx_make_type): Use maybe_add_lang_type_raw return value.
1987         * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1988         TYPE_LANG_SPECIFIC.
1990         * cp-tree.h (struct lang_type): Remove template_info field.
1991         (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1992         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1994 2017-08-14  Martin Sebor  <msebor@redhat.com>
1996         PR c/81117
1997         * error.c (cp_printer): Handle 'G'.
1999 2017-08-11  Martin Liska  <mliska@suse.cz>
2001         * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
2002         TARGET_SUPPORTS_ALIASES.
2003         (handle_tls_init): Likewise.
2004         (note_mangling_alias): Likewise.  Remove ATTRIBUTE_UNUSED for
2005         both arguments.
2006         * optimize.c (can_alias_cdtor): Likewise.
2008 2017-08-11  Jason Merrill  <jason@redhat.com>
2010         PR c++/81671 - nullptr_t template parameter
2011         * pt.c (convert_nontype_argument): Fix nullptr_t check.
2013 2017-08-10  Jason Merrill  <jason@redhat.com>
2015         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
2016         * method.c (synthesized_method_walk): Don't diagnose lack of
2017         operator delete.
2019         PR c++/80452 - Core 1579, implicit move semantics on return/throw
2020         * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
2021         tentatively changed the lvalue to an rvalue.
2022         * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
2023         (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
2024         parameter is an rvalue reference.
2025         * except.c (build_throw): Do maybe-rvalue overload resolution twice.
2026         * typeck.c (check_return_expr): Likewise.
2028 2017-08-10  David Malcolm  <dmalcolm@redhat.com>
2030         * parser.c (cp_parser_error): Update for new param to
2031         c_parse_error.
2032         (class token_pair): New class.
2033         (struct matching_paren_traits): New struct.
2034         (matching_parens): New typedef.
2035         (struct matching_brace_traits): New struct.
2036         (matching_braces): New typedef.
2037         (cp_parser_statement_expr): Convert explicit parsing of
2038         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
2039         class matching_parens, so that the pertinent open parenthesis is
2040         highlighted when there are problems locating the close
2041         parenthesis.
2042         (cp_parser_primary_expression): Likewise.
2043         (cp_parser_compound_literal_p): Remove consumption of opening
2044         paren.
2045         (cp_parser_postfix_expression): Convert explicit parsing of
2046         CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
2047         above.  Use it to consume the opening paren previously consumed by
2048         cp_parser_compound_literal_p.
2049         (cp_parser_parenthesized_expression_list): Likewise.
2050         (cp_parser_unary_expression): Likewise.
2051         (cp_parser_new_expression): Likewise.
2052         (cp_parser_cast_expression): Likewise.
2053         (cp_parser_builtin_offsetof): Likewise.
2054         (cp_parser_trait_expr): Likewise.
2055         (cp_parser_lambda_declarator_opt): Likewise.
2056         (cp_parser_lambda_body): Likewise, for matching_braces.
2057         (cp_parser_compound_statement): Likewise.
2058         (cp_parser_selection_statement): Likewise, for matching_parens.
2059         (cp_parser_iteration_statement): Likewise.
2060         (cp_parser_already_scoped_statement): Likewise, for
2061         matching_braces.
2062         (cp_parser_linkage_specification): Likewise.
2063         (cp_parser_static_assert): Likewise, for matching_parens.
2064         (cp_parser_decltype): Likewise.
2065         (cp_parser_operator): Likewise.
2066         (cp_parser_enum_specifier): Likewise.
2067         (cp_parser_namespace_definition): Likewise.
2068         (cp_parser_direct_declarator): Likewise.
2069         (cp_parser_braced_list): Likewise.
2070         (cp_parser_class_specifier_1): Likewise, for matching_braces.
2071         (cp_parser_constant_initializer): Likewise.
2072         (cp_parser_noexcept_specification_opt): Likewise, for
2073         matching_parens.
2074         (cp_parser_exception_specification_opt): Likewise.
2075         (cp_parser_handler): Likewise.
2076         (cp_parser_asm_specification_opt): Likewise.
2077         (cp_parser_asm_operand_list): Likewise.
2078         (cp_parser_gnu_attributes_opt): Likewise.
2079         (cp_parser_std_attribute_spec): Likewise.
2080         (cp_parser_requirement_parameter_list): Likewise.
2081         (cp_parser_requirement_body): Likewise, for matching_braces.
2082         (cp_parser_compound_requirement): Likewise.
2083         (cp_parser_template_introduction): Likewise.
2084         (cp_parser_sizeof_pack): Likewise, for matching_parens.
2085         (cp_parser_sizeof_operand): Likewise; use it to consume the
2086         opening paren previously consumed by cp_parser_compound_literal_p.
2087         (get_matching_symbol): New function.
2088         (cp_parser_required_error): Add param "matching_location".  Remove
2089         calls to cp_parser_error, instead setting a non-NULL gmsgid, and
2090         handling it if set by calling c_parse_error, potentially with a
2091         secondary location if matching_location was set.
2092         (cp_parser_require): Add param "matching_location", with a default
2093         value of UNKNOWN_LOCATION.
2094         (cp_parser_require_keyword): Update for new param of
2095         cp_parser_required_error.
2096         (cp_parser_objc_encode_expression): Update to class matching_parens
2097         as above.
2098         (cp_parser_objc_defs_expression): Likewise.
2099         (cp_parser_objc_protocol_expression): Likewise.
2100         (cp_parser_objc_selector_expression): Likewise.
2101         (cp_parser_objc_typename): Likewise.
2102         (cp_parser_objc_superclass_or_category): Likewise.
2103         (cp_parser_objc_try_catch_finally_statement): Likewise.
2104         (cp_parser_objc_synchronized_statement): Likewise.
2105         (cp_parser_objc_at_property_declaration): Likewise.
2106         (cp_parser_oacc_single_int_clause): Likewise.
2107         (cp_parser_oacc_shape_clause): Likewise.
2108         (cp_parser_omp_clause_collapse): Likewise.
2109         (cp_parser_omp_clause_default): Likewise.
2110         (cp_parser_omp_clause_final): Likewise.
2111         (cp_parser_omp_clause_if): Likewise.
2112         (cp_parser_omp_clause_num_threads): Likewise.
2113         (cp_parser_omp_clause_num_tasks): Likewise.
2114         (cp_parser_omp_clause_grainsize): Likewise.
2115         (cp_parser_omp_clause_priority): Likewise.
2116         (cp_parser_omp_clause_hint): Likewise.
2117         (cp_parser_omp_clause_defaultmap): Likewise.
2118         (cp_parser_omp_clause_ordered): Likewise.
2119         (cp_parser_omp_clause_schedule): Likewise.
2120         (cp_parser_omp_clause_num_teams): Likewise.
2121         (cp_parser_omp_clause_thread_limit): Likewise.
2122         (cp_parser_omp_clause_aligned): Likewise.
2123         (cp_parser_omp_clause_linear): Likewise.
2124         (cp_parser_omp_clause_safelen): Likewise.
2125         (cp_parser_omp_clause_simdlen): Likewise.
2126         (cp_parser_omp_clause_depend): Likewise.
2127         (cp_parser_omp_clause_device): Likewise.
2128         (cp_parser_omp_clause_dist_schedule): Likewise.
2129         (cp_parser_oacc_clause_async): Likewise.
2130         (cp_parser_omp_critical): Likewise.
2131         (cp_parser_omp_for_loop): Likewise.
2132         (cp_parser_omp_sections_scope): Likewise.
2133         (cp_parser_omp_declare_reduction_exprs): Likewise.
2134         Update for new param to cp_parser_required_error.
2135         (cp_parser_oacc_routine): Likewise.
2136         (cp_parser_transaction_expression): Likewise.
2137         (cp_parser_cilk_simd_vectorlength): Likewise.
2139 2017-08-09  Jason Merrill  <jason@redhat.com>
2141         PR c++/81525 - wrong constant value with generic lambda
2142         * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
2143         (tsubst_copy) [VAR_DECL]: Handle auto.
2145         PR c++/81359 - Unparsed NSDMI error from SFINAE context.
2146         * init.c (get_nsdmi): Add complain parm.
2147         * typeck2.c (digest_nsdmi_init): Add complain parm.
2148         (process_init_constructor_record): Pass complain to get_nsdmi.
2149         * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
2150         * method.c (get_defaulted_eh_spec): Add complain parm.  Pass it into
2151         synthesized_method_walk.
2152         (synthesized_method_walk): Adjust.
2153         (walk_field_subobs): Pass complain to get_nsdmi.
2154         (defaulted_late_check): Skip other checks if deleted.
2155         * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
2156         * call.c (build_aggr_conv): Pass complain to get_nsdmi.
2157         * parser.c (defarg_location): New.
2158         * error.c (location_of): Use it.
2160 2017-08-09  Marek Polacek  <polacek@redhat.com>
2162         * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
2163         * typeck.c (build_binary_op): Change the type of a parameter to bool.
2164         (cp_truthvalue_conversion): Use true instead of 1.
2166 2017-08-08  Marek Polacek  <polacek@redhat.com>
2168         PR c++/81607
2169         * cp-gimplify.c (cp_fold): If folding exposed a branch of
2170         a COND_EXPR, convert it to the original type of the COND_EXPR, if
2171         they differ.               
2173 2017-08-08  Martin Liska  <mliska@suse.cz>
2175         * call.c: Include header files.
2176         * cp-gimplify.c: Likewise.
2177         * cp-ubsan.c: Likewise.
2178         * cvt.c: Likewise.
2179         * init.c: Likewise.
2180         * search.c: Likewise.
2181         * semantics.c: Likewise.
2182         * typeck.c: Likewise.
2184 2017-08-07  Martin Liska  <mliska@suse.cz>
2186         * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
2187         attribute.
2188         (cp_parser_std_attribute): Likewise.
2189         * tree.c: Add new include.
2191 2017-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
2193         PR c++/79790
2194         * pt.c (do_class_deduction): Handle the case of no viable implicit
2195         deduction guides; simplify the code generating implicit deduction
2196         guides.
2198 2017-08-03  Paolo Carlini  <paolo.carlini@oracle.com>
2200         PR c++/71440
2201         * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
2202         destructor as expressions.
2204 2017-08-02  Jakub Jelinek  <jakub@redhat.com>
2206         PR c++/81640
2207         * call.c (build_user_type_conversion_1): Only call
2208         lookup_fnfields_slot if totype is CLASS_TYPE_P.
2210 2017-07-31  Jason Merrill  <jason@redhat.com>
2212         * decl.c (declare_global_var): Set DECL_CONTEXT.
2214 2017-07-31  Jan Hubicka <hubicka@ucw.cz>
2215             Martin Liska  <mliska@suse.cz>
2217         * pt.c (tsubst_copy): Copy PREDICT_EXPR.
2218         * semantics.c (finish_goto_stmt): Build gimple predict
2219         stament.
2220         * constexpr.c (potential_constant_expression_1): Handle
2221         PREDICT_EXPR.
2223 2017-07-31  Martin Liska  <mliska@suse.cz>
2225         PR sanitize/81530
2226         * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
2227         also with current_function_decl non-null equality.
2228         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2229         * decl.c (compute_array_index_type): Likewise.
2230         * init.c (finish_length_check): Likewise.
2231         * typeck.c (cp_build_binary_op): Likewise.
2233 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
2235         * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
2236         DW_AT_export_symbols.
2237         * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
2238         argument, pass it through to the debug hook.
2239         (finish_namespace_using_directive): Adjust
2240         emit_debug_info_using_namespace caller.
2241         (push_namespace): Likewise.  Call it after setting
2242         DECL_NAMESPACE_INLINE_P.
2243         (cp_emit_debug_info_for_using): Pass false as new argument to
2244         the imported_module_or_decl debug hook.
2246 2017-07-28  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
2248         * lex.c (copy_decl): Adjust.
2249         (copy_type): Likewise.
2251 2017-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
2253         PR c++/71570
2254         * lambda.c (add_capture): Early return if we cannot capture by
2255         reference.
2257 2017-07-26  Jason Merrill  <jason@redhat.com>
2259         P0702R1 - List deduction of vector.
2260         * pt.c (do_class_deduction): Special-case deduction from a single
2261         element of related type.
2263 2017-07-26  Leonid Koppel  <lkoppel@uwaterloo.ca>
2265         PR c++/67054 - Inherited ctor with non-default-constructible members
2266         * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2267         when deducing an inheriting constructor.
2269 2017-07-21  Nathan Sidwell  <nathan@acm.org>
2271         * search.c (lookup_conversion_operator): Return overloads.
2272         (lookup_fnfields_idx_nolazy): Absorb into ...
2273         (lookup_fnfields_slot_nolaxy): ... here.
2274         (lookup_fnfields_1): Absorb into ...
2275         (lookup_fnfields_slot): ... here.
2277         Remove special CDtor METHOD_VEC slots.
2278         * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2279         CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2280         (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2281         (CLASSTYPE_DESTRUCTOR): Likewise.
2282         * class (add_method): Don't use special cdtor slots.
2283         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2284         (look_for_overrides_here): Use lookup_fnfields_slot.
2285         * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2287         * call.c (add_candidates): Move decls to initialization.  Don't
2288         use !!.
2290 2017-07-20  Nathan Sidwell  <nathan@acm.org>
2292         Remove TYPE_METHODS.
2293         * class.c (maybe_warn_about_overly_private_class,
2294         finish_struct_methods, one_inheriting_sig, count_fields,
2295         add_fields_to_record_type, check_field_decls, check_methods,
2296         clone_function_decl, set_method_tm_attributes,
2297         finalize_literal_type_property, check_bases_and_members,
2298         create_vtable_ptr, determine_key_method,
2299         unreverse_member_declarations, finish_struct,
2300         add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2301         * decl.c (fixup_anonymous_aggr): Likewise.
2302         * decl2.c (reset_type_linkage_2): Likewise.
2303         * method.c (after_nsdmi_defaulted_late_checks,
2304         lazily_declare_fn): Likewise.
2305         * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2306         * pt.c (instantiate_class_template_1, tsubst_expr,
2307         do_type_instantiation, instantiate_pending_templates): Likewise.
2308         * search.c (lookup_field_1): Likewise.
2309         * semantics.c (finish_member_declaration,
2310         finish_omp_declare_simd_methods): Likewise.
2312 2017-07-19  Nathan Sidwell  <nathan@acm.org>
2314         * class.c (add_implicitly_declared_members): Use
2315         classtype_has_move_assign_or_move_ctor_p.
2316         (classtype_has_move_assign_or_move_ctor,
2317         classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2318         (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2319         * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2320         Replace with ...
2321         (classtype_has_move_assign_or_move_ctor_p): ... this.
2322         * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2323         * tree.c (type_has_nontrivial_copy_init): Adjust.
2325         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2326         PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2328 2017-07-18  Nathan Sidwell  <nathan@acm.org>
2330         * cp-array-notation.c (build_array_notation_ref): Use
2331         TYPE_{MIN,MAX}_VALUE.
2333         * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2334         (add_implicitly_declared_members): Use it.
2335         (type_has_move_constructor, type_has_move_assign): Merge into ...
2336         (classtype_has_move_assign_or_move_ctor): ... this new function.
2337         * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2339 2017-07-17  Volker Reichelt  <v.reichelt@netcologne.de>
2341         * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2342         friend outside class and obsolete auto as storage-class-specifier.
2344 2017-07-17  Nathan Sidwell  <nathan@acm.org>
2346         * class.c (maybe_warn_about_overly_private_class): Ignore public
2347         copy ctors.
2349         * class.c (type_has_user_declared_move_constructor,
2350         type_has_user_declared_move_assign): Combine into ...
2351         (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2352         * cp-tree.h (type_has_user_declared_move_constructor,
2353         type_has_user_declared_move_assign): Combine into ...
2354         (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2355         * method.c (maybe_explain_implicit_delete): Use it.
2356         (lazily_declare_fn): Use it.
2357         * tree.c (type_has_nontrivial_copy_init): Use it.
2359         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2360         semantics, simplify implementation.
2362 2017-07-16  Volker Reichelt  <v.reichelt@netcologne.de>
2364         * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2365         in old-style cast diagnostic.
2366         * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2367         in useless cast diagnostic.
2368         * error.c (type_to_string): Remove enum special handling.
2370 2017-07-14  David Malcolm  <dmalcolm@redhat.com>
2372         * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2373         the header names.
2374         (maybe_suggest_missing_header): Update for addition of '<' and '>'
2375         to above.  Provide a fix-it hint.
2376         * pt.c: Include "gcc-rich-location.h"
2377         (listify): Attempt to add fix-it hint for missing
2378         #include <initializer_list>.
2379         * rtti.c: Include "gcc-rich-location.h".
2380         (typeid_ok_p): Attempt to add fix-it hint for missing
2381         #include <typeinfo>.
2383 2017-07-12  Jason Merrill  <jason@redhat.com>
2385         P0512R0 - Deduction from an initializer list.
2386         * pt.c (do_class_deduction): Do list deduction in two phases.
2388 2017-07-12  Nathan Sidwell  <nathan@acm.org>
2390         * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2391         DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2392         identifier flags.
2393         * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2394         DECL_CXX_DESTRUCTOR explicitly.
2395         * decl2.c (grokclassfn): Likewise.
2396         * friend.c (do_friend): Likewise.
2397         * method.c (make_thunk, make_alias_for,
2398         implicitly_declare_fn): Likewise.
2400 2017-07-11  Jason Merrill  <jason@redhat.com>
2402         Core DR 393
2403         * decl.c (grokparms): Downgrade error about array of unknown bound
2404         to pedwarn and disable it for C++17.
2406 2017-07-11  Nathan Sidwell  <nathan@acm.org>
2408         * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2410 2017-07-10  Martin Sebor  <msebor@redhat.com>
2412         * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2414 2017-07-06  Jason Merrill  <jason@redhat.com>
2416         PR c++/81204 - parse error with dependent template-name
2417         * parser.c (cp_parser_lookup_name): Revert previous change.
2419 2017-07-06  David Malcolm  <dmalcolm@redhat.com>
2421         * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2422         selftest::run_cp_tests.
2423         (selftest::run_cp_tests): New function.
2424         * cp-tree.h (selftest::run_cp_tests): New decl.
2426 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
2428         * parser.c (cp_parser_decomposition_declaration): Replace
2429         decomposition declaration with structured binding in diagnostics.
2430         * decl.c (cp_finish_decomp): Likewise.
2431         (grokdeclarator): Likewise.
2433         PR c++/81258
2434         * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2435         forms of structured binding initializers.
2437 2017-07-03  Paolo Carlini  <paolo.carlini@oracle.com>
2439         PR c++/65775
2440         * decl.c (grokdeclarator): Move checks on function return type after
2441         the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2442         is UNKNOWN_LOCATION fall back to input_location.
2444 2017-07-03  David Malcolm  <dmalcolm@redhat.com>
2446         * parser.c (enum required_token): Fix spelling of
2447         RT_INTERATION to RT_ITERATION.
2448         (cp_parser_iteration_statement): Likewise.
2449         (cp_parser_required_error): Likewise.
2451 2017-06-30  Jason Merrill  <jason@redhat.com>
2453         PR c++/81257 - ICE with invalid ::template.
2454         PR c++/54769 - wrong lookup of dependent template-name.
2455         * parser.c (cp_parser_template_name): Revert part of last change.
2457 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2459         * config-lang.in (gtfiles): Add cp/lex.c.
2460         * cp-tree.h (mangle_convop_name_for_type): Rename ...
2461         (make_conv_op_name): ... here.  Move to lex.
2462         * lambda.c (maybe_add_lambda_conv_op): Update.
2463         * parser.c (cp_parser_conversion_function_id): Update.
2464         * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2465         tsubst_copy_and_build): Update.
2466         * semantics.c (apply_deduced_return_type): Update.
2467         * mangle.c (conv_type_hasher, conv_type_names,
2468         mangle_conv_op_name_for_type): Move to ...
2469         * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2470         ... here.  Rename.
2472 2017-06-30  David Malcolm  <dmalcolm@redhat.com>
2474         PR c++/80014
2475         * parser.c (cp_parser_postfix_expression): Construct a location
2476         for typeid expressions.
2478 2017-06-30  Nathan Sidwell  <nathan@acm.org>
2480         * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2481         declare.
2482         (lookup_all_conversions): Declare.
2483         * class.c (get_basefndecls): Use lookup_fnfields_slot.
2484         * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2485         * decl2.c (check_class_fn): Use lookup_fnfields_slot.  Rework
2486         diagnostics.
2487         * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2488         (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2489         lookup_all_conversions.
2490         * search.c (lookup_fnfields_1): Make static.
2491         (lookup_all_conversions): New.
2492         (class_method_index_for_fn): Delete.
2493         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2494         lookup_fnfields_slot.
2496         * call.c (build_new_method_call_1): Use constructo_name to get
2497         ctor name.  Move argument processing earlier to merge cdtor
2498         handling blocks.
2499         * decl.c (grokfndecl): Cdtors have special names.
2500         * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2501         * pt.c (check_explicit_specialization): Cdtor name is already
2502         special.
2503         * search.c (class_method_index_for_fn): Likewise.
2505         PR c++/81229
2506         * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2507         a matching TYPE_DECL.
2509 2017-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
2511         * class.c (add_method): Change pair of errors to error + inform.
2512         (handle_using_decl): Likewise.
2514 2017-06-29  Jason Merrill  <jason@redhat.com>
2516         * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2518         PR c++/81180 - ICE with C++17 deduction of member class template.
2519         * pt.c (build_deduction_guide): Correct member template handling.
2521         PR c++/81188 - matching decltype of member function call.
2522         * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2524 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2526         PR c++/81247
2527         * parser.c (cp_parser_namespace_definition): Immediately close the
2528         namespace if there's no open-brace.
2529         * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2530         namespace.
2532 2017-06-29  Jason Merrill  <jason@redhat.com>
2534         PR c++/81164 - ICE with invalid inherited constructor.
2535         * search.c (binfo_direct_p): New.
2536         * name-lookup.c (do_class_using_decl): Use it.
2538 2017-06-29  Nathan Sidwell  <nathan@acm.org>
2540         * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2541         VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2542         * decl.c (initialize_predefined_identifiers): Name cdtor special
2543         names consistently.  Use literals for above deleted defines.
2544         (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2546         * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2547         flag.
2549         * call.c (check_dtor_name): Use constructor_name for enums too.
2550         (build_new_method_call_1): Use constructor_name for cdtors and
2551         show ~ for dtor.
2552         * class.c (build_self_reference): Use TYPE_NAME to get name of
2553         self reference.
2554         * name-lookup (constructor_name): Use DECL_NAME directly.
2555         (constructor_name_p): Reimplement.
2556         (push_class_level_binding_1): Use TYPE_NAME directly.
2558         * class.c (finish_struct): Use OVL_P.
2559         (get_vfield_name): Measure constructor_name length.
2560         * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2561         (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2562         * cxx-pretty-print.c (is_destructor_name): Delete.
2563         (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2564         * decl.c (grokfndecl): Move cheap checks first when looking for
2565         implicit extern cness.
2567         * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2568         indentation. Remove unnecessary assignment of constructor name.
2570         Whitespace cleanups.
2571         * call.c (name_as_c_string): Move CONST_CAST to return.
2572         (build_new_method_call_1): Remove unneeded bracing.
2573         * class.c (include_empty_classes): Unbreak line.
2574         * constraint.cc (tsubst_check_constraint): Add space.
2575         * cp-tree.h (lang_decl_ns): Add comment.
2576         (PTRMEM_CST_MEMBER): Break line.
2577         * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2578         (grokdeclarator): Remove lines, move declaration to first use.
2579         * decl2.c (decl_needed_p): Fix indentation.
2580         (c_parse_final_cleanups): Remove blank line.
2581         * method.c (implicitly_declare_fn): Move declaration to first use.
2582         * search.c (current_scope): Add blank lines.
2584 2017-06-28  Jason Merrill  <jason@redhat.com>
2586         PR c++/72764 - ICE with invalid template typename.
2587         * decl.c (build_typename_type): No longer static.
2588         * tree.c (strip_typedefs): Use it instead of make_typename_type.
2590         PR c++/69300 - ICE with self-referential noexcept
2591         * pt.c (maybe_instantiate_noexcept): Check for recursion.
2593         PR c++/61022 - error with variadic template template parm
2594         * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2596         PR c++/72801 - ICE with variadic partial specialization
2597         * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2599         PR c++/55639 - partial specialization with ::template
2600         * parser.c (cp_parser_class_head): Handle ::template.
2602         PR c++/45976 - error with ::template in declarator.
2603         * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2605         PR c++/54769 - wrong lookup of dependent template-name.
2606         * parser.c (cp_parser_template_name): Handle dependent object type.
2607         (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2608         parameter.
2609         (cp_parser_id_expression): Pass it.
2610         (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2612         * parser.c (cp_parser_template_id): Use the range location on the
2613         TEMPLATE_ID_EXPR.
2615         PR c++/81204 - parse error with dependent template-name
2616         * parser.c (cp_parser_lookup_name): Disqualify function templates
2617         after lookup.
2619 2017-06-27  Nathan Sidwell  <nathan@acm.org>
2621         * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2622         initialization point.  Don't unnecessarily check for ctor name.
2624         * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2625         (CLASSTYPE_DESTRUCTOR): ... this.
2626         * class.c (accessible_nvdtor_p,
2627         maybe_warn_about_overly_private_class,
2628         add_implicitly_declared_members,
2629         clone_constructors_and_destructors, type_has_virtual_destructor):
2630         Adjust for CLASSTYPE_DESTRUCTOR.
2631         (deduce_noexcept_on_destructors): Absorb into ...
2632         (check_bases_and_members): ... here.
2633         * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2634         * init.c (build_delete): Likewise.
2635         * parser.c (cp_parser_lookup_name): Likewise.
2636         * pt.c (check_explicit_specialization): Likewise.
2637         * rtti.c (emit_support_tinfos): Likewise.
2638         * search.c (lookup_fnfields_idx_nolazy): Likewise.
2640         Kill IDENTIFIER_TEMPLATE.
2641         * cp-tree.h (lang_identifier): Remove class_template_info field.
2642         (IDENTIFIER_TEMPLATE): Delete.
2643         * name-lookup.c (constructor_name_full): Subsume into ...
2644         (constructor_name): ... here.  Don't check IDENTIFIER_TEMPLATE.
2645         (constructor_name_p): Likewise.
2646         * mangle.c (write_source_name): Likewise.
2647         * ptree.c (cxx_print_identifier): Likewise.
2649 2017-06-27  Marek Polacek  <polacek@redhat.com>
2651         PR bootstrap/81216
2652         * parser.c (cp_parser_already_scoped_statement): Initialize
2653         LOC_AFTER_LABELS.
2655 2017-06-26  Jason Merrill  <jason@redhat.com>
2657         PR c++/81215 - deduction failure with variadic TTP.
2658         * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2660 2017-06-26  Martin Sebor  <msebor@redhat.com>
2662         PR c++/81169
2663         * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2664         to detect casting away cv-qualifiers.
2666 2017-06-26  Nathan Sidwell  <nathan@acm.org>
2668         * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2669         (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2670         identifier.
2671         (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2672         DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2673         (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2674         * decl.c (grok_op_properties): Adjust identifier checking.
2675         * init.c (expand_default_init): Adjust identifier descision.
2676         * method.c (implicitly_declare_fn): Don't use
2677         DECL_ASSIGNMENT_OPERATOR_P.
2678         * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2679         IDENTIFIER_DTOR_P.
2680         * call.c (in_charge_arg_for_name): Reimplement.
2681         (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2682         IDENTIFIER_DTOR_P.
2684 2017-06-26  Marek Polacek  <polacek@redhat.com>
2686         PR c/80116
2687         * parser.c (cp_parser_statement): Add a default argument.  Save the
2688         location of the expression-statement after labels have been parsed.
2689         (cp_parser_implicitly_scoped_statement): Set the location of the
2690         body of the conditional after parsing all the labels.  Call
2691         warn_for_multistatement_macros.
2692         (cp_parser_already_scoped_statement): Likewise.
2694 2017-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
2696         PR c++/62315
2697         * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2698         'typename' in error messages about missing 'typename'.
2700 2017-06-23  Jason Merrill  <jason@redhat.com>
2702         PR c++/79056 - C++17 ICE with invalid template syntax.
2703         * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2704         is a TYPE_DECL.
2705         (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2706         * pt.c (template_placeholder_p): New.
2707         * cp-tree.h: Declare it.
2709 2017-06-23  Marc Glisse  <marc.glisse@inria.fr>
2711         * decl.c (duplicate_decls): Use builtin_structptr_types.
2713 2017-06-22  Nathan Sidwell  <nathan@acm.org>
2715         Reorder IDENTIFIER flags
2716         gcc/cp/
2717         * cp-tree.h (enum cp_identifier_kind): New.
2718         (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2719         IDENTIFIER_KIND_BIT_2): New.
2720         (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2721         (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2722         (C_IS_RESERVED_WORD): Replace with ...
2723         (IDENTIFIER_KEYWORD_P): ... this.
2724         (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2725         (IDENTIFIER_CDTOR_P): ... this.
2726         (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2727         (IDENTIFIER_OPNAME_P): Replace with ...
2728         (IDENTIFIER_ANY_OP_P): ... this.
2729         (IDENTIFIER_ASSIGN_OP_P): New.
2730         (IDENTIFIER_TYPENAME_P): Replace with ...
2731         (IDENTIFIER_CONV_OP_P): ... this.
2732         (NEW_DELETE_OPNAME_P): Replace with ...
2733         (IDENTIFIER_NEWDEL_OP_P): ... this.
2734         (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2735         (get_identifier_kind_name, set_identifier_kind): Declare.
2736         * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2737         (init_operators): Adjust to avoid keywords, use
2738         set_identifier_kind. Copy TYPE_EXPR slot.
2739         (init_reswords): Call set_identifier_kind.
2740         (unqualified_name_lookup_error): Adjust.
2741         * operators.def (TYPE_EXPR): Remove.
2742         * decl.c (struct predefined_identifier): Move into ...
2743         (initialize_predefined_identifiers): ... here.  Call
2744         set_identifier_kind.
2745         (grokfndecl, check_var_type, grokdeclarator): Adjust.
2746         (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2747         space.  Adjust.
2748         * call.c (name_as_c_string): Adjust.
2749         (build_new_method_call_1): Likewise.
2750         * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2751         * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2752         * dump.c (cp_dump_tree): Adjust.
2753         * error.c (dump_decl_name): Adjust.
2754         * mangle.c (write_unqualified_id, write_member_name,
2755         write_expression): Adjust.
2756         (mangle_conv_op_name_for_type): Use set_identifier_kind.
2757         * name-lookup.c (do_class_using_decl): Adjust.
2758         (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2759         * parser.c (cp_lexer_get_preprocessor_token,
2760         cp_parser_direct_declarator): Likewise.
2761         * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2762         tsubst_copy, tsubst_copy_and_build): Adjust.
2763         * ptree.c (cxx_print_identifier): Print identifier kind.
2764         * search.c (lookup_field_r, lookup_member,
2765         lookup_fnfields_idx_nolazy): Adjust.
2766         * semantics.c (finish_id_expression): Adjust..
2767         * typeck.c (cp_build_addr_expr_1): Adjust.
2769 2017-06-21  Jakub Jelinek  <jakub@redhat.com>
2771         PR c++/81154
2772         * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2773         Complain about t not being a variable if t is OVERLOAD even
2774         when processing_template_decl.
2776 2017-06-21  David Malcolm  <dmalcolm@redhat.com>
2778         * parser.c (get_cast_suggestion): New function.
2779         (maybe_add_cast_fixit): New function.
2780         (cp_parser_cast_expression): Capture the location of the closing
2781         parenthesis.  Call maybe_add_cast_fixit when emitting warnings
2782         about old-style casts.
2784 2017-06-20  Jason Merrill  <jason@redhat.com>
2786         PR c++/80972 - C++17 ICE with attribute packed.
2787         * call.c (build_over_call): Allow a TARGET_EXPR from reference
2788         binding.
2790 2017-06-20  Nathan Sidwell  <nathan@acm.org>
2792         * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2793         (nelts_identifier): Delete.
2794         * decl.c (initialize_predefined_identifiers): Remove nelts.
2796         PR c++/67074 - namespace aliases
2797         * decl.c (duplicate_decls): Don't error here on mismatched
2798         namespace alias.
2799         * name-lookup.c (name_lookup::add_value): Matching namespaces are
2800         not ambiguous.
2801         (diagnose_name_conflict): Namespaces are never redeclarations.
2802         (update_binding): An alias can match a real namespace.
2804 2017-06-19  Jason Merrill  <jason@redhat.com>
2806         PR c++/80562 - ICE with constexpr if.
2807         * semantics.c (finish_if_stmt_cond): Call
2808         instantiate_non_dependent_expr.
2810         PR c++/80829 - ICE with constexpr copy of base subobject.
2811         * constexpr.c (clear_no_implicit_zero): New.
2812         (cxx_eval_call_expression): Call it.
2814 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2816         PR c++/81124
2817         PR c++/79766
2818         * name-lookup.c (set_decl_namespace): Don't follow using
2819         directives and ignore using decls.  Only check overly-explicit
2820         scope after discovering decl.
2822 2017-06-19  Jason Merrill  <jason@redhat.com>
2824         PR c++/81073 - constexpr and static var in statement-expression.
2825         * typeck2.c (store_init_value): Always call
2826         require_potential_constant_expression.
2827         * pt.c (convert_nontype_argument): Likewise.
2828         * constexpr.c (potential_constant_expression_1): Adjust message.
2829         Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2830         * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2832 2017-06-19  Nathan Sidwell  <nathan@acm.org>
2834         * pt.c (coerce_template_parms): Fix indentation.
2835         (tsubst_decl): Remove repeated SET_DECL_RTL.  Move VAR_P handling
2836         in to single block.
2838         PR c++/81119
2839         * name-lookup.c (update_binding): Only warn about constructors
2840         hidden by functions.
2842 2017-06-17  Jason Merrill  <jason@redhat.com>
2844         PR c++/60063 - -Wunused-local-typedefs and templates.
2845         * decl2.c (is_late_template_attribute): Return false for "used".
2847         PR c++/70844 - -Wuseless-cast and inheriting constructor.
2848         * method.c (forward_parm): Suppress warn_useless_cast.
2850 2017-06-16  Jason Merrill  <jason@redhat.com>
2852         PR c++/81045 - Wrong type-dependence with auto return type.
2853         * pt.c (type_dependent_expression_p): An undeduced auto outside the
2854         template isn't dependent.
2855         * call.c (build_over_call): Instantiate undeduced auto even in a
2856         template.
2858         PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2859         * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2860         set longer for a generic lambda.
2862         PR c++/80614 - Wrong mangling for C++17 noexcept type
2863         * mangle.c (write_type): Put the eh spec back on the function type.
2865         PR c++/81102 - Wrong error with partial specialization.
2866         * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2867         types.  Do type deduction later.
2869         PR c++/81074 - ICE with partial specialization of member template.
2870         PR c++/71747
2871         * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2873         PR c++/80831 - ICE with -fsyntax-only.
2874         * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2876         PR c++/80639 - ICE with invalid PMF initialization.
2877         PR c++/80043 - ICE with -fpermissive
2878         * typeck.c (convert_for_assignment): Recurse when instantiate_type
2879         returns without an error.
2881 2017-06-16  Nathan Sidwell  <nathan@acm.org>
2883         * pt.c (tsubst_baselink): Fix & clarify formatting.
2885         * cp-tree.h (build_this_parm, cp_build_parm_decl,
2886         build_artificial_parm): Add FN parm.
2887         * decl.c (start_cleanup_fn): Adjust.
2888         (build_this_parm): Add FN parm, pass it through.
2889         (grokfndecl): Adjust parm building.
2890         * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2891         (build_artificial_parm): Add FN parm, pass through.
2892         (maybe_retrofit_in_chrg): Adjust parm building.
2893         (start_static_storage_duration_function): Likwise.
2894         * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2895         * method.c (implicitly_declare_fn): Likewise.
2896         * parser.c (inject_this_parameter): Likewise.
2898         Symbol tables are insert only.
2899         * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2900         derive from pointer_hash.  Make undeletable.
2902         * class.c (resort_type_method_vec): Avoid potential unsigned
2903         overflow.
2905         Don't defer noexcept_deferred_spec.
2906         * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2907         * decl.c (cxx_init_decl_processing): Initialize
2908         noexcept_deferred_spec.
2909         * except.c (unevaluated_noexcept_spec): Delete.
2910         * class.c (deduce_noexcept_on_destructor): Use
2911         noexcept_deferred_spec directly.
2912         * method.c (implicitly_declare_fn): Likewise.
2914         Make keyed_classes a vector.
2915         * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2916         (keyed_classes): Declare as vector.
2917         * decl.c (keyed_classes): Define.
2918         (cxx_init_decl_processing): Allocate it.
2919         (record_key_method_defined): Use vec_safe_push.
2920         * class.c (finish_struct_1): Likewise.
2921         * pt.c (instantiate_class_template_1): Likewise.
2922         * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2924         Make rtti lazier
2925         * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2926         TK_VMI_CLASS_TYPES, TK_MAX.  Delete TK_FIXED.
2927         (tinfo_names): New.
2928         (typeid_ok_p): Add quotes to error messages.  Use get_tinfo_desc.
2929         (get_tinfo_decl): Use get_tinfo_desc.
2930         (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2931         (create_pseudo_type_info): Delete.
2932         (get_pseudo_ti_index): Just determine the index.
2933         (get_tinfo_desc): New.  Create all types lazily.
2934         (create_tinfo_types): Just allocate the descriptor array.
2935         (emit_support_tinfos): Use non-inserting type lookup.  Set builtin
2936         location.
2938 2017-06-15  Martin Sebor  <msebor@redhat.com>
2940         PR c++/80560
2941         * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2942         functions.
2943         (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2944         (build_cxx_call): Call maybe_warn_class_memaccess.
2946 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
2948         * cp-gimplify.c (cp_genericize_r): Turn most of the function
2949         into a switch (TREE_CODE (stmt)) statement from long else if
2950         sequence.
2952 2017-06-13  Jakub Jelinek  <jakub@redhat.com>
2954         PR c++/80973
2955         * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2956         argument even if it has REFERENCE_TYPE.
2958         PR c++/80984
2959         * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2960         BLOCK_VARS (outer) chain.
2961         (cxx_omp_const_qual_no_mutable): Likewise.
2963 2017-06-13  Martin Liska  <mliska@suse.cz>
2965         PR sanitize/78204
2966         * class.c (build_base_path): Use sanitize_flags_p.
2967         * cp-gimplify.c (cp_genericize_r): Likewise.
2968         (cp_genericize_tree): Likewise.
2969         (cp_genericize): Likewise.
2970         * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2971         * decl.c (compute_array_index_type): Likewise.
2972         (start_preparsed_function): Likewise.
2973         * decl2.c (one_static_initialization_or_destruction): Likewise.
2974         * init.c (finish_length_check): Likewise.
2975         * lambda.c (maybe_add_lambda_conv_op): Likewise.
2976         * typeck.c (cp_build_binary_op): Likewise.
2977         (build_static_cast_1): Likewise.
2979 2017-06-11  Jason Merrill  <jason@redhat.com>
2981         * error.c (dump_expr): Use is_this_parameter.
2983         * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2984         id_equal.
2986 2017-06-09  Jason Merrill  <jason@redhat.com>
2988         Missing bits from N4268, constant evaluation for all non-type args.
2989         * call.c (build_converted_constant_expr): Rename from
2990         build_integral_nontype_arg_conv, handle all types.
2991         * pt.c (convert_nontype_argument): In C++17 call it for all types.
2992         Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2993         * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2995         Overhaul pointer-to-member conversion and template argument handling.
2996         * call.c (standard_conversion): Avoid creating ck_pmem when the
2997         class type is the same.
2998         * cvt.c (can_convert_qual): Split from
2999         perform_qualification_conversions.
3000         * constexpr.c (cxx_eval_constant_expression): Check it.
3001         * typeck.c (convert_ptrmem): Only cplus_expand_constant if
3002         adjustment is necessary.
3003         * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
3004         (convert_nontype_argument): Avoid redundant error.
3006         * call.c (convert_like_real): Remove "inner" parameter.
3007         Don't replace a constant with its value.
3008         * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
3010         * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
3011         nullptr_node.
3013         * parser.c (cp_parser_constant_expression): Check
3014         potential_rvalue_constant_expression after decay_conversion.
3015         * pt.c (convert_nontype_argument): Don't require linkage in C++17.
3017         PR c++/80384 - ICE with dependent noexcept-specifier
3018         * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
3019         noexcept-specifier.
3021         * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
3023 2017-06-09  Jan Hubicka  <hubicka@ucw.cz>
3025         * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
3026         * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
3027         (excpet.c): Mark terminate as cold.
3029 2017-06-08  Jakub Jelinek  <jakub@redhat.com>
3031         PR c/81006
3032         * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
3033         to sizetype before size_binop.
3035         PR c++/81011
3036         * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
3037         to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
3038         and OMP_CLAUSE_SHARED_READONLY flags.
3040 2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
3042         * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
3044 2017-06-07  Nathan Sidwell  <nathan@acm.org>
3046         * class.c (layout_class_type): Restructure overlong-bitfield tpe
3047         search.
3049 2017-06-07  Jonathan Wakely  <jwakely@redhat.com>
3051         PR c++/80990
3052         * pt.c (do_class_deduction): Build qualified type.
3054 2017-06-06  Nathan Sidwell  <nathan@acm.org>
3056         * name-lookup.c (suggest_alternatives_for): Use qualified lookup
3057         sans using directives.  Don't walk into inline namespaces.
3059         PR c++/80979
3060         * name-lookup.c (adl_class_only): Don't add visible friends.
3062 2017-06-05  Volker Reichelt  <v.reichelt@netcologne.de>
3064         * parser.c (cp_parser_base_specifier): Fix typos in error messages.
3066 2017-06-02  Nathan Sidwell  <nathan@acm.org>
3068         Remove lang_type_ptrmem.
3069         * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
3070         into ...
3071         (lang_type_class): ... this.  Reorder bitfields.  Rename to ...
3072         (lang_type): ... this.  Delete old definition.
3073         (lang_type_ptrmem): Delete.
3074         (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC.  Adjust uses.
3075         (LANG_TYPE_PTRMEM_CHECK): Delete.
3076         (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
3077         (TYPE_PTRMEMFUNC_TYPE): New.  Use TYPE_LANG_SLOT_1.
3078         * decl.c (build_ptrmemfunc_type): Adjust.
3079         * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
3080         (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
3081         
3082         * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
3083         setting.
3084         
3085         Remove cp_binding_level::namespaces
3086         * name-lookup.h (cp_binding_level): Lose namespaces field.
3087         * name-lookup.c (add_decl_to_level): Chain namespaces on the names
3088         list.
3089         (suggest_alternatives_for): Adjust for namespace list.  Do
3090         breadth-first search.
3091         * decl2.c (collect_source_refs): Namespaces are on the regulr
3092         list.
3093         (collect_ada_namespace): Likewise.
3095 2017-06-02  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3097         * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
3098         warning.
3100 2017-06-01  Ville Voutilainen  <ville.voutilainen@gmail.com>
3102         PR c++/80812
3103         * method.c (constructible_expr): Strip array types before calling
3104         build_value_init.
3106 2017-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
3108         PR c++/80896
3109         * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
3110         for case INDIRECT_REF too in the main switch.
3112 2017-05-31  Jason Merrill  <jason@redhat.com>
3114         PR c++/80840 - ICE with constexpr and reference
3115         * pt.c (convert_nontype_argument): Don't test whether a decl is
3116         value-dependent when binding to a reference.
3118 2017-05-31  Nathan Sidwell  <nathan@acm.org>
3120         * cp-tree.h (lang_decl_slector): New enum.
3121         (lang_decl_base): Make selector an enum.  Drop decomposition_p
3122         field.
3123         (lang_decl): Use enum for discrimination.
3124         (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
3125         LANG_DECL_DEOMP_CHECK): Use enum.
3126         (DECL_DECOMPOSITION_P): Use selector value.
3127         (SET_DECL_DECOMPOSITION_P): Delete.
3128         (retrofit_lang_decl): Lose SEL parm.
3129         (fit_decomposition_lang_decl): Declare.
3130         * decl.c (cp_finish_decomp, grokdeclarator): Use
3131         fit_decomposition_lang_decl.
3132         * lex.c (maybe_add_lang_decl_raw): New. Broken out of
3133         retrofit_lang_decl.
3134         (set_decl_linkage): New.  Broken out of retrofit_lang_decl.  Use enum.
3135         (fit_decomposition_lang_decl): Likewise.
3136         (retrofit_lang_decl): Use worker functions.
3137         (cxx_dup_lang_specific_decl): Use selector enum.
3138         (maybe_add_lang_type_raw): New.  Broken out of ...
3139         (cxx_make_type_name): ... here.  Call it.
3141 2017-05-30  Jason Merrill  <jason@redhat.com>
3143         PR c++/80856 - ICE with local extern in template
3144         * semantics.c (finish_call_expr): Replace a local extern overload
3145         set in a template with the IDENTIFIER_NODE.
3147 2017-05-30  David Malcolm  <dmalcolm@redhat.com>
3149         * call.c (perform_implicit_conversion_flags): Convert
3150         "from %qT to %qT" to "from %qH to %qI" in diagnostic.
3151         (print_conversion_rejection): Replace pairs of %qT with
3152         %qH and %qI in various places.
3153         (build_user_type_conversion_1): Likewise.
3154         (build_integral_nontype_arg_conv): Likewise.
3155         (build_conditional_expr_1): Likewise.
3156         (convert_like_real): Likewise.
3157         (convert_arg_to_ellipsis): Likewise.
3158         (joust): Likewise.
3159         (initialize_reference): Likewise.
3160         * cvt.c (cp_convert_to_pointer): Likewise.
3161         (cp_convert_to_pointer): Likewise.
3162         (convert_to_reference): Likewise.
3163         (ocp_convert): Likewise.
3164         * error.c (cp_printer): Gain bool and const char ** parameters.
3165         (struct deferred_printed_type): New struct.
3166         (class cxx_format_postprocessor): New class.
3167         (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
3168         to pp->m_format_postprocessor.
3169         (comparable_template_types_p): New function.
3170         (newline_and_indent): New function.
3171         (arg_to_string): New function.
3172         (print_nonequal_arg): New function.
3173         (print_template_differences): New function.
3174         (type_to_string_with_compare): New function.
3175         (print_template_tree_comparison): New function.
3176         (append_formatted_chunk): New function.
3177         (add_quotes): New function.
3178         (cxx_format_postprocessor::handle): New function.
3179         (defer_phase_2_of_type_diff): New function.
3180         (cp_printer): Add "quoted" and "buffer_ptr" params.  Implement
3181         %H and %I.
3182         * typeck.c (cp_build_binary_op): Replace pairs of %qT with
3183         %qH and %qI in various places.
3184         (convert_member_func_to_ptr): Likewise.
3185         (build_reinterpret_cast_1): Likewise.
3186         (convert_for_assignment): Likewise.
3187         * typeck2.c (check_narrowing): Likewise.
3189 2017-05-30  Nathan Sidwell  <nathan@acm.org>
3191         Kill IDENTIFIER_NAMESPACE_BINDINGS
3192         * cp-tree.h (lang_identifier): Delete namespace_bindings.
3193         (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
3194         (lang_decl_ns): Add bindings.
3195         (DECL_NAMESPACE_BINDINGS): New.
3196         * lex.c (retrofit_lang_decl): Create namespace hash table.
3197         * name-lookup.c (find_namespace_slot): Change to use hash-map.
3198         * ptree.c (cxx_print_binding): Delete.
3199         (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
3201         * cp-tree.def (OVERLOAD): Fix comment.
3202         * cp-tree.h: Fix comments and whitespace.
3203         * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
3204         * name-lookup.c (add_decl_to_level): Assert not class.
3205         (check_local_shadow): Use OVL_P.
3206         (pushdecl_with_scope_1): Rename to ...
3207         (do_pushdecl_with_Scope): ... here.
3208         (do_nonmember_using_decl): Use qualified_namespace_lookup return
3209         value.
3210         (push_class_level_binding_1): Use OVL_P.
3211         (pushdecl_namespace_level): Use do_pushdecl_with_scope.
3212         (pushtag_1): Rename to ...
3213         (do_pushtag): ... here.  Adjust do_pushdecl_with_scope call.
3214         (pushtag): Adjust.
3215         (store_class_bindings): Do not time here.
3216         * name-lookup.h (pushdecl_outermost_localscope): Reorder.
3217         * pt.c (listify): Declare argvec at point of initialization.
3219         PR c++/80913
3220         * name-lookup.c (add_decl_to_level): Assert not making a circular
3221         chain.
3222         (update_binding): Don't prematurely slide artificial decl.
3224 2017-05-29  Alexandre Oliva <aoliva@redhat.com>
3226         * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
3228 2017-05-29  Nathan Sidwell  <nathan@acm.org>
3230         PR c++/80891 (#1,#5)
3231         * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
3232         * name-lookup.c (name_lookup): Add deduping field.
3233         (name_lookup::preserve_state, name_lookup::restore_state): Deal
3234         with deduping.
3235         (name_lookup::add_overload): New.
3236         (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
3237         (name_lookup::search_adl): Set deduping.  Don't unmark here.
3238         * pt.c (most_specialized_instantiation): Revert previous change,
3239         Assert not given duplicates.
3240         * tree.c (lookup_mark): Just mark the underlying decls.
3241         (lookup_maybe_add): Dedup using marked decls.
3243         PR c++/80891 (#4)
3244         * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
3245         * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
3247         Stat hack representation
3248         * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
3249         MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
3250         (stat_hack): New.
3251         (find_namespace_binding): Replace with ...
3252         (find_namespace_slot): ... this.
3253         (find_namespace_value): New.
3254         (name_lookup::search_namespace_only,
3255         name_lookup::adl_namespace_only): Adjust.
3256         (update_binding): Add SLOT parameter, adjust.
3257         (check_local_shadow): Use find_namespace_value.
3258         (set_local_extern_decl_linkage): Likewise.
3259         (do_pushdecl): Adjust for namespace slot.
3260         (push_local_binding): Assert not a namespace binding.
3261         (check_for_out_of_scope_variable): Use find_namespace_value.
3262         (set_identifier_type_value_with_scope): Likewise.
3263         (get_namespace_binding): Likewise.
3264         (set_namespace_binding): Delete.
3265         (set_global_binding): Directly update the binding.
3266         (finish_namespace_using_decl): Likewise.
3267         (lookup_type_scope_1): Use find_namespace_slot and update.
3268         (do_push_nested_namespace): Use find_namespace_value.
3270         PR c++/80891 (#1)
3271         * pt.c (most_specialized_instantiation): Cope with duplicate
3272         instantiations.
3274         PR c++/80891 (#3)
3275         * cp-tree.h (build_min_nt_call_vec): Declare.
3276         * decl.c (build_offset_ref_call_from_tree): Call it.
3277         * parser.c (cp_parser_postfix_expression): Likewise.
3278         * pt.c (tsubst_copy_and_build): Likewise.
3279         * semantics.c (finish_call_expr): Likewise.
3280         * tree.c (build_min_nt_loc): Keep unresolved lookups.
3281         (build_min): Likewise.
3282         (build_min_non_dep): Likewise.
3283         (build_min_non_dep_call_vec): Likewise.
3284         (build_min_nt_call_vec): New.
3286         PR c++/80891 (#2)
3287         * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3288         (ovl_used): New.
3289         (lookup_keep): Call it.
3291 2017-05-26  Nathan Sidwell  <nathan@acm.org>
3293         Implement DR2061
3294         * name-lookup.c (push_inline_namespaces): New.
3295         (push_namespace): Look inside inline namespaces.
3297         Inline and using namespace representation change.
3298         * cp-tree.h (struct lang_decl_ns): Delete ns_using.  Add usings,
3299         inlinees as vector.
3300         (DECL_NAMESPACE_USING): Adjust.
3301         (DECL_NAMESPACE_INLINEES): New.
3302         * name-lookup.h (struct cp_binding_level): Change usings
3303         representation.
3304         * name-lookup.c (name_lookup::do_queue_usings,
3305         name_lookup::queue_usings): Adjust.
3306         (name_lookup::search_namespace, name_lookup::search_usings,
3307         name_lookup::queue_namespace): Adjust.
3308         (name_lookup::adl_namespace_only): Adjust.
3309         (add_using_namespace, push_namespace): Push onto vector.
3310         (pop_namespace): Add timing logic.
3312         * call.c (build_operator_new_call): Do namelookup and ADL here.
3313         (build_new_op_1): Likewise.
3314         * name-lookup.h (lookup_function_nonclass): Delete declaration.
3315         (do_using_directive): Likewise.
3316         * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3317         declare early.
3318         (struct scope_binding): Delete.
3319         (EMPTY_SCOPE_BINDING): Delete.
3320         (set_decl_namespace): Use OVL_P.
3321         (finish_local_using_decl): Lose unnecesary checks.
3322         (lookup_function_nonclass): Delete.
3323         (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3325         * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3326         (ovl_iterator): Add allow_inner field.  Adjust ctor.  Make
3327         unduplicatable.
3328         (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3329         (lkp_iterator): Add outer field.  Adjust ctor.
3330         (lkp_iterator::operator++): New.
3331         (lookup_mark, lookup_maybe_add): Declare.
3332         * name-lookup.c (name_lookup): Delete fn_set member.
3333         (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3334         and mark lookup.
3335         (name_lookup::add_value): Use lookup_add directly.
3336         (name_lookup::add_fns: Use lookup_maybe_add.
3337         (name_lookup::search_adl): Mark and unmark fns.
3338         (pushdecl): Adjust.
3339         * pt.c (check_explicit_specialization): Use lookup_add directly.
3340         * ptree.c (cxx_print_xnode): Show complete overload structure.
3341         * tree.c (lookup_mark, lookup_maybe_add): New.
3343         * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3345 2017-05-26  Jakub Jelinek  <jakub@redhat.com>
3347         * cp-tree.h (struct lang_decl_decomp): New type.
3348         (struct lang_decl): Add u.decomp.
3349         (LANG_DECL_DECOMP_CHECK): Define.
3350         (DECL_DECOMPOSITION_P): Note it is set also on the vars
3351         for user identifiers.
3352         (DECL_DECOMP_BASE): Define.
3353         (retrofit_lang_decl): Add extra int = 0 argument.
3354         * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3355         use it to influence the selector choices and for selector
3356         0 to non-zero transition copy old content.
3357         (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3358         * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3359         !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR.  Adjust warning
3360         wording if decl is a structured binding.
3361         (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3362         Set DECL_DECOMP_BASE.  Ignore DECL_READ_P sets from initialization
3363         of individual variables for tuple structured bindings.
3364         (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3365         Clear DECL_DECOMP_BASE.
3366         * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3367         * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3368         is expected.
3369         * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3370         DECL_VALUE_EXPR.
3372 2017-05-25  Jason Merrill  <jason@redhat.com>
3374         PR c++/80605 - __is_standard_layout and zero-length array
3375         * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3377 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3379         Kill OVL_CURRENT, OVL_NEXT.
3380         * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3381         * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3382         (consider_binding_level): Use OVL_FIRST.
3383         (cp_emit_debug_info_for_using): Use lkp_iterator.
3384         * pt.c (check_explicit_specialization): Use ovl_iterator.       
3386         Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3387         * cp-tree.h (lang_decl_ns): Remove ns_users field.
3388         (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3389         (TREE_INDIRECT_USING): Delete.
3390         * name-lookup.h (is_associated_namespace): Delete.
3391         * name-lookup.c (name_lookup::search_usings,
3392         name_lookup::do_queue_usings): Usings are always direct.
3393         (is_associated_namespace): Delete.
3394         (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3395         (namespace_ancestor_1, namespace_ancestor): Delete.
3396         (push_using_directive_1, push_using_directive): Delete.
3397         (add_using_namespace_1): Delete.
3398         (add_using_namespace): Reimplement.
3399         (emit_debug_info_using_namespace): New.
3400         (finish_namespace_using_directive, finish_local_using_directive,
3401         push_namespace): Adjust.
3402         * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3404 2017-05-25  Volker Reichelt  <v.reichelt@netcologne.de>
3406         * semantics.c (finish_handler_parms): Warn about non-reference type
3407         catch handlers.
3409 2017-05-25  Nathan Sidwell  <nathan@acm.org>
3411         Reimplement unqualified namespace lookup.
3412         * name-lookup.c (name_lookup::using_pair,
3413         name_lookup::using_queue): New typedefs.
3414         (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3415         name_lookup::queue_usings): New.
3416         (name_lookup::search_unqualified): New.
3417         (merge_functions, same_entity_p, ambiguous_decl,
3418         unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3419         lookup_using_namespace): Delete.
3420         (lookup_name_real_1): Adjust.
3422         Reimplement qualified namespace lookup.
3423         * name-lookup.c (name_lookup::flags): New member.  Adjust ctor.
3424         (name_lookup::ambiguous, name_lookup::add_value,
3425         name_lookup::add_type, name_lookup::process_binding): New.
3426         (name_lookup::search_namespace_only,
3427         name_lookup::search_namespace, name_lookup::search_usings): New.
3428         (name_lookup::search_qualified): New.
3429         (do_nonmember_using_decl, suggest_alternatives_for,
3430         lookup_qualified_name): Adjust.
3431         (tree_vec_contains): Delete.
3432         (qualified_lookup_using_namespace): Rename to ...
3433         (qualified_namespace_lookup): ... here.  Reimplement.
3435         Reimplement ADL.
3436         * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3437         * name-lookup.h (lookup_arg_dependent): Return plain tree.
3438         * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3439         arg_assoc_args_vec, arg_assoc_type, add_function,
3440         arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3441         arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3442         lookup_arg_dependent_1): Delete.
3443         (name_lookup): New lookup object.
3444         (name_lookup::preserve_state, name_lookup::restore_state,
3445         name_lookup::mark_seen, name_lookup::find_and_mark,
3446         name_lookup::add_fns, name_lookup::adl_namespace_only,
3447         name_lookup::adl_namespace, name_lookup::adl_class_only,
3448         name_lookup::adl_bases, name_lookup::adl_class,
3449         name_lookup::adl_expr, name_lookup::adl_type,
3450         name_lookup::adl_template_arg, name_lookup::search_adl): New.
3451         (lookup_arg_dependent): Return a plain tree.  Adjust.
3452         (is_associated_namespace): Move later.
3453         
3454 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3456         * friend.c (do_friend): Remove check for existing decl.
3457         * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3458         * name-lookup.c (push_local_binding): Directly look for binding.
3459         (lookup_name_innermost_nonclass_level_1): Delete.
3460         (lookup_name_innermost_nonclass_level): Delete.
3462         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3464         * cp-tree.h (cp_free_lang_data): Add extern.
3465         (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3466         ATTRIBUTE_PURE.
3467         (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3468         * typeck.c (type_unknown_p): Delete.
3469         * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3470         overload management.
3471         (dependent_name): Likewise.
3472         (decl_anon_ns_mem_p): Simplify.
3474 2017-05-24  Jonathan Wakely  <jwakely@redhat.com>
3476         PR c++/80544
3477         * tree.c (reshape_init): Use unqualified type for direct enum init.
3478         * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3479         (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3480         non-class destination types.
3481         (build_const_cast_1): Strip cv-quals from destination types.
3482         (build_static_cast, build_reinterpret_cast, build_const_cast)
3483         (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3485 2017-05-24  Martin Sebor  <msebor@redhat.com>
3487         PR c/80731
3488         * call.c (fully_fold_internal): Adjust.
3490 2017-05-24  Nathan Sidwell  <nathan@acm.org>
3492         * cp-tree.h (ovl_skip_hidden): Declare.
3493         * tree.c (ovl_skip_hidden): New.
3494         * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3495         (lookup_arg_dependent_1): Likewise.
3496         (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3497         (hidden_name_p, remove_hidden_names): Delete.
3498         (lookup_name_real_1): Do not strip hidden names.
3499         * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3501         * cp-tree.h (OVL_HIDDEN_P): New.
3502         (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3503         (ovl_iterator::reveal_node): Declare.
3504         * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3505         (ovl_insert): Order on hiddenness.
3506         (ovl_iterator::reveal_node): New.
3507         * name-lookup.c (anticipated_builtin_p): New.
3508         (supplement_binding_1): Use it.
3509         (set_local_extern_decl_linkage): Use hidden_p.
3510         (do_pushdecl): Deal with unhiding a hidden decl, use
3511         anticipated_builtin_p.
3512         (do_nonmember_using_decl): Use anticipated_decl_p.
3513         (lookup_name_real_1): Use DECL_HIDDEN_P.
3515 2017-05-23  Jason Merrill  <jason@redhat.com>
3517         -Wunused and C++17 structured bindings
3518         * decl.c (poplevel): Don't warn about unused structured bindings,
3519         only real variables.
3520         * error.c (dump_simple_decl): Handle structured bindings.
3521         * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3523 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3525         * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3526         * name-lookup.c (create_local_binding): New.
3527         (update_binding): New.
3528         (pushdecl_maybe_friend_1): Rename to ...
3529         (do_pushdecl): ... this.  Reimplement.
3530         (pushdecl): Adjust.
3531         (push_overloaded_decl_1, push_overloaded_decl): Delete.
3533 2017-05-23  Jason Merrill  <jason@redhat.com>
3535         PR c++/80396 - built-in for make_integer_sequence.
3536         * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3537         (expand_integer_pack, expand_builtin_pack_call): New.
3538         (find_parameter_packs_r): Check builtin_pack_call_p.
3539         (check_for_bare_parameter_packs): Handle it.
3540         (tsubst_pack_expansion): Call expand_builtin_pack_call.
3541         (declare_integer_pack): New.
3542         (init_template_processing): Call it.
3543         * decl2.c (mark_used): Check builtin_pack_fn_p.
3545 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3547         * name-lookup.c (find_namespace_binding): New.
3548         (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3549         (set_identifier_type_value_with_scope): Use find_namespace_binding.
3550         (find_binding, cp_binding_level_find_binding_for_name,
3551         binding_for_name, namespace_binding_1): Delete.
3552         (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3553         (get_namespace_binding, set_namespace_binding,
3554         finish_namespace_using_decl, unqualified_namespace_lookup_1,
3555         qualified_lookup_using_namespace, lookup_type_scope_1,
3556         lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3558         PR c++/80866
3559         * parser.c (cp_parser_template_id): Keep the lookup when stashing
3560         the template_id.
3562         * cp-tree.h (DECL_HIDDEN_P): New.
3563         * name-lookup.c (set_decl_context,
3564         set_local_extern_decl_linkage): New, broken out of ...
3565         (pushdecl_maybe_friend_1): ... here.  Call them.
3567 2017-05-23  Thomas Schwinge  <thomas@codesourcery.com>
3569         * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3570         "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3571         "VECTOR_LENGTH".
3573 2017-05-23  Nathan Sidwell  <nathan@acm.org>
3575         * cp-tree.h (OVL_P): New.
3576         * name-lookup.h (push_local_binding): Delete.
3577         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3578         (finish_namespace_using_decl, finish_local_using_decl): ... here
3579         * name-lookup.c (add_decl_to_level): Swap args.
3580         (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3581         (diagnose_name_conflict): Check contexts are same for redecl.
3582         (update_local_overload): New.
3583         (compparms_for_decl_and_using): Rename to ...
3584         (matching_fn_p): ... here.
3585         (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3586         push_local_bindings call.
3587         (push_local_binding): Make static, replace FLAGS arg with
3588         IS_USING.
3589         (validate_nonmember_using_decl): Use OVL_FIRST.
3590         (do_nonmember_using_decl): Use in/out parameters.  Use
3591         lkp_iterator and simplify.
3592         (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3593         (finish_namespace_using_decl, finish_local_using_decl): ... here.
3594         Adjust.
3595         (lookup_type_current_level): Delete.
3596         * parser.c (cp_parser_using_declaration): Adjust.
3597         * pt.c (tsubst_expr): Adjust.
3599 2017-05-22  Nathan Sidwell  <nathan@acm.org>
3601         * name-lookup.h (parse_using_directive): Replace with ...
3602         (finish_namespace_using_directive): ... this and ...
3603         (finish_local_using_directive): ... this.
3604         * name-lookup.c (add_using_namespace_1): Move later.
3605         (add_using_namespace): Move later, add namespace_p arg, remove
3606         indirect arg.
3607         (push_using_directive_1): Directly recurse.
3608         (do_using_directive, parse_using_directive): Delete, split into ...
3609         (finish_namespace_using_directive): ... this and ...
3610         (finish_local_using_directive): ... this.
3611         (push_namespace): Use add_using_namespace.
3612         * parser.c (cp_parser_using_directive): Call
3613         finish_namespace_using_directive or finish_local_using_directive.
3614         * pt.c (tsubst_expr): Call finish_local_using_directive.
3616         * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3617         * cp-tree.h (raw_dump_id): Declare.
3618         * decl2.c (raw_dump_id): Define.
3619         (dump_tu): Use raw_dump_id.
3621         * config-lang.in (gtfiles): Sort list, break lines.
3623         * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3624         (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3625         ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3626         CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3627         CPTI_RETHROW_FN): New.
3628         (noexcept_deferred_spec): New.
3629         (terminate_node, call_unexpected_node): Rename to ...
3630         (terminate_fn, call_unexpected_fn): ... here.
3631         (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3632         allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3633         * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3634         (init_exception_processing): Adjust.
3635         (declare_library_fn): Create and push the fns here.
3636         (do_get_exception_ptr, do_begin_catch, do_end_catch,
3637         do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3638         declare_library_fn use.
3639         (unevaluated_noexcept_spec): Adjust.
3640         * cp-gimplify.c (genericize_eh_spec_block,
3641         gimplify_most_not_throw_expr): Adjust.
3643         * name-lookup.c (pushdecl_top_level,
3644         pushdecl_top_level_and_finish): Move after namespace pushing and
3645         popping functions.
3646         (push_to_top_level): Rename to ...
3647         (do_push_to_top_level): ... here.  Remove timing code.
3648         (pop_from_top_level_1): Rename to ...
3649         (do_pop_from_top_level): ... here.
3650         (do_push_nested_namespace, do_pop_nested_namespace)
3651         (push_to_top_level): New wrapper for do_push_to_top_level.
3652         (pop_from_top_level): Adjust.
3653         (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3655 2017-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3657         * config-lang.in (gtfiles): Add c-family/c-format.c,
3658         except.c, init.c, lambda.c and friend.c.
3659         * class.c (dvirt_fn): Move out of function scope,
3660         add GTY attribute.
3661         * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3662         * init.c (fn): Likewise.
3663         * lambda.c (ptr_id, max_id): Likewise.
3664         * friend.c (global_friend): Add GTY attribute.
3666 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3668         * call.c (add_list_candidates): Use OVL_FIRST.
3669         (build_new_method_call_1): Likewise.
3670         * cp-tree.h (OVL_SINGLE_P): New.
3671         (TYPE_HIDDEN_P): New.
3672         * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3673         * dump.c (cp_tump_tree): Adjust overload dumping.
3674         * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3675         printing.
3676         * method.c (lazily_declare_fn): Assert we added it.
3677         * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3678         OVL_FIRST.
3679         (cp_parser_template_name): Use lkp_iterator.
3680         * pt.c (begin_template_parm_list): Fixup comment.
3681         (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3682         * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3683         (ovl_scope): Use lkp_iterator.
3685 2017-05-19  Thomas Schwinge  <thomas@codesourcery.com>
3687         * parser.c (cp_parser_omp_clause_default): Handle
3688         "OMP_CLAUSE_DEFAULT_PRESENT".
3690         * parser.c (cp_parser_omp_clause_default): Avoid printing more
3691         than one syntax error message.
3693 2017-05-19  Nathan Sidwell  <nathan@acm.org>
3695         * class.c (class_dump_id): Define.
3696         (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3697         * cp-objcp-common.c (cp_register_dumps): New.
3698         * cp-objcp-common.h (cp_register_dumps): Declare.
3699         (LANG_HOOKS_REGISTER_DUMPS): Override.
3700         * cp-tree.h (class_dump_id): Declare.
3702 2017-05-18  Nathan Sidwell  <nathan@acm.org>
3704         * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3705         (OVL_USED_P): New.
3706         (lookup_keep): Declare.
3707         * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3708         * pt.c (tsubst_copy): Assert lookup is persistent.
3709         * semantics.c (finish_call_expr): Use lkp_iterator, call
3710         lookup_keep.
3711         * tree.c (ovl_copy): New.
3712         (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3713         (lookup_keep): New.
3715         * cp-tree.h (OVL_USED): Replace with ...
3716         (OVL_USING_P): ... this.
3717         (ovl_iterator::using_p): Adjust.
3718         * name-lookup.c (push_overloaded_decl_1,
3719         do_nonmember_using_decl): Adjust.
3720         * search.c (lookup_field_r): Adjust.
3721         * tree.c (ovl_insert, ovl_scope): Adjust.
3723         * cp-tree.h (lookup_add): Swap args.
3724         (ovl_cons, build_overload): Delete.
3725         * name-lookup.c (add_function, push_overloaded_decl_1,
3726         do_nonmember_using_decl, merge_functions, remove_hidden_names):
3727         Use lookup_add, ovl_insert.
3728         * pt.c (check_explicit_specialization): Use lookup_add.
3729         (do_class_deduction): Likewise. Refactor if.
3730         * tree.c (lookup_add): Swap args.
3731         (ovl_cons, build_overload): Delete.
3733         * name-lookup.c (find_local_binding): New, broken out of ...
3734         (lookup_name_innermost_nonclass_level_1): ... here.  Call it.
3735         (set_namespace_binding): Swap scope & name args.
3736         (namespace_binding_1): Likewise.
3737         (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3738         (push_overloaded_decl_1): Likewise.
3739         (set_global_binding): Likewise.
3740         (get_namespace_binding): Adjust namespace_binding_1 call.
3742 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3744         * cp-tree.h (default_hash_traits <lang_identifier *>): New
3745         specialization.
3746         * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3747         (extern_c_fns): New hash table.
3748         (check_extern_c_conflict): New, broken out of ...
3749         (pushdecl_maybe_friend_1): ... here.  Call it.
3750         (c_linkage_bindings): Just look in hash table.
3752 2017-05-17  Ville Voutilainen  <ville.voutilainen@gmail.com>
3754         PR c++/80654
3755         PR c++/80682
3756         Implement new C++ intrinsics __is_assignable and __is_constructible.
3757         * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3758         (is_xible): New.
3759         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3760         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3761         * method.c (constructible_expr): Set cp_unevaluated.
3762         (is_xible_helper): New.
3763         (is_trivially_xible): Adjust.
3764         (is_xible): New.
3765         * parser.c (cp_parser_primary_expression): Handle
3766         RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3767         (cp_parser_trait_expr): Likewise.
3768         * semantics.c (trait_expr_value): Handle
3769         CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3771 2017-05-17  Nathan Sidwell  <nathan@acm.org>
3773         * cp-tree.h (ovl_iterator::using_p): New predicate.
3774         (ovl_iterator::remove_node): New worker.
3775         (ovl_insert): Declare.
3776         * tree.c (ovl_insert): New.
3777         (ovl_iterator::remove_node): New.
3778         * class.c (add_method): Use ovl_iterator, ovl_insert.
3779         (clone_function_decl): Fix description.
3780         (clone_constructors_and_destructors): Use ovl_iterator.
3782         * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3783         (maybe_warn_about_overly_private_class): Use ovl_iterator.
3784         (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3785         (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3786         (get_base_fndecls): Use ovl_iterator.
3787         (warn_hidden): Use OVL_NAME, ovl_iterator.
3788         (add_implicitly_declared_members): Use ovl_iterator.
3789         * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3790         flatten nested if.
3791         (finish_shorthand_constraint): Simplify, use ovl_make.
3792         * pt.c (make_constrained_auto): Simplify.  Use ovl_make.
3793         * search.c (shared_member_p): Use ovl_iterator.
3794         (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3795         (lookup_conversion_operator): Use OVL_FIRST.
3796         (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3797         (look_for_overrides_here): Use ovl_iterator.
3798         (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3799         * typeck.c (build_x_unary_op): Use ovl_make.
3801 2017-05-17  Martin Liska  <mliska@suse.cz>
3803         * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3804         use it instead of int type.
3805         (dump_vtable): Likewise.
3806         (dump_vtt): Likewise.
3807         * decl2.c (dump_tu): Likewise.
3809 2017-05-16  David Malcolm  <dmalcolm@redhat.com>
3811         * call.c (enforce_access): Add access_failure_info * param and use
3812         it to record access failures.
3813         * cp-tree.h (class access_failure_info): New class.
3814         (enforce_access): Add access_failure_info * param, defaulting to
3815         NULL.
3816         (lookup_member): Likewise.
3817         (locate_field_accessor): New function decl.
3818         (perform_or_defer_access_check): Add access_failure_info * param,
3819         defaulting to NULL.
3820         * search.c (lookup_member): Add access_failure_info * param and
3821         pass it on to call to perform_or_defer_access_check.
3822         (matches_code_and_type_p): New function.
3823         (field_access_p): New function.
3824         (direct_accessor_p): New function.
3825         (reference_accessor_p): New function.
3826         (field_accessor_p): New function.
3827         (struct locate_field_data): New struct.
3828         (dfs_locate_field_accessor_pre): New function.
3829         (locate_field_accessor): New function.
3830         * semantics.c (perform_or_defer_access_check): Add
3831         access_failure_info * param, and pass it on to call to
3832         enforce_access.
3833         * typeck.c (access_failure_info::record_access_failure): New method.
3834         (access_failure_info::maybe_suggest_accessor): New method.
3835         (finish_class_member_access_expr): Pass an access_failure_info
3836         instance to the lookup_member call, and call its
3837         maybe_suggest_accessor method afterwards.
3839 2017-05-16  Marek Polacek  <polacek@redhat.com>
3841         PR sanitizer/80536
3842         PR sanitizer/80386
3843         * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3845 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3847         * name-lookup.c (check_local_shadow): New, broke out of ...
3848         (pushdecl_maybe_friend_1): ... here.  Call it.
3850         * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3851         (ovl_first): Move inline definition to end of file.
3852         (ovl_make, lookup_add): Declare.
3853         (get_fns, get_first_fn): Make pure.
3854         * tree.c (ovl_cache): New.
3855         (ovl_make, lookup_add): New.
3856         * pt.c (do_class_deduction): Don't add candidates that will be
3857         elided.
3859         * call.c (build_user_type_conversion_1): Use OVL_FIRST.
3860         (print_error_for_call_failure): Use OVL_NAME.
3861         (build_op_call_1): Use ovl_iterator.
3862         (add_candidates): Use OVL_FIRST & lkp_iterator.
3863         (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3864         lkp_iterator.
3865         * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3866         (type_has_user_nondefault_constructor,
3867         in_class_defaulted_default_constructor,
3868         type_has_user_provided_constructor,
3869         type_has_user_provided_or_explicit_constructor,
3870         type_has_non_user_provided_default_constructor,
3871         vbase_has_user_provided_move_assign,
3872         type_has_move_constructor, type_has_move_assign,
3873         type_has_user_declared_move_constructor,
3874         type_has_user_declared_move_assign,
3875         type_build_ctor_call, type_build_dtor_call,
3876         type_requires_array_cookie, explain_non_literal_class): Likewise.
3877         (finish_struct): Use lkp_iterator.
3878         (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3879         (note_name_declared_in_class): Use OVL_NAME.
3880         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3881         (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3882         cxx_pretty_printer::expression): Likewise.
3883         * decl2.c (check_classfn): Use ovl_iterator.
3884         * pt.c (retrieve_specialization): Use ovl_iterator.
3885         * tree.c (cp_tree_equal): Use lkp_iterator.
3886         (type_has_nontrivial_copy_init): Use ovl_iterator.
3888         * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3889         check is_overloaded_fn.
3891 2017-05-16  Martin Liska  <mliska@suse.cz>
3893         * parser.c (cp_lexer_print_token): Add default value for flags
3894         argument of print_gimple_stmt, print_gimple_expr,
3895         print_generic_stmt and print_generic_expr.
3897 2017-05-16  Nathan Sidwell  <nathan@acm.org>
3899         * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3900         iterators.
3901         (MAYBE_BASELINK_FUNCTIONS): New.
3902         * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3903         * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3904         * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3905         * method.c (inherited_ctor_binfo): Use ovl_iterator.
3906         (binfo_inherited_from): Likewise.
3907         * parser.c (lookup_literal_operator): Use lkp_iterator.
3908         * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3909         (print_candidates_1): Likewise.
3910         (determine_specialization): Likewise.
3911         (resolve_overloaded_unification): Likewise.
3912         (resolve_nondeduced_context): Likewise.
3913         (type_dependent_expression_p): Likewise.
3914         (dependent_template_p): Likewise.
3915         * ptree.c (cxx_print_xnode): Likewise.
3916         * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3917         (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3918         * typeck.c (check_template_keyword): Use lkp_iterator.
3920         * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3921         (ovl_first): New.
3922         * constexpr.c (function_concept_check): Use OVL_FIRST.
3923         * cvt.c (build_expr_type_conversion): Likewise.
3924         * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3925         * decl2.c (mark_used): Use OVL_FIRST.
3926         * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3927         (dump_expr, location_of): Use OVL_FIRST.
3928         * friend.c (do_friend): Use OVL_NAME.
3929         * init.c (build_offset_ref): Use OVL_FIRST.
3930         * mangle.c (write_member_name): Likewise.
3931         (write_expression): Use OVL_NAME.
3932         * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3933         * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3934         * pt.c (check_explicit_specialization): Use OVL_FIRST.
3935         (check_template_shadow): Likewise.
3936         (tsubst_template_args): Use OVL_NAME.
3937         (tsubst_baselink): Use OVL_FIRST.
3938         * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3939         * tree.c (get_first_fn): Use OVL_FIRST.
3940         * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3941         (cp_build_addr_expr_1): Use OVL_FIRST.
3943         * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3944         peeking.
3945         * semantics.c (finish_id_expression): Directly init local var.
3946         (finish_omp_reduction_clause): Use really_overloaded_fn.
3947         * tree.c (get_fns): Document.  Assert we got an overload.
3948         (get_first_fn) Document.
3949         * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3950         really_overloaded_fn.
3951         * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
3953         * cp-tree.h (SCOPE_DEPTH): New.
3954         * name-lookup.h (is_nested_namespace): Declare.
3955         * name-lookup.c (is_nested_namespace): New.
3956         (is_ancestor): Use it.
3957         (set_decl_namespace): Likewise.
3958         (push_namespace): Set SCOPE_DEPTH.
3959         * pt.c (check_specialization_namespace): Use is_nested_namespace.
3960         (check_unqualigied_spec_or_inst): Likewise.
3962 2017-05-15  Nathan Sidwell  <nathan@acm.org>
3964         PR c++/79369
3965         * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3966         * name-lookup.h (push_namespace): Return int, add make_inline arg.
3967         * name-lookup.c (push_namespace): Deal with inline directly.
3968         Return pushed count.
3969         * parser.c (cp_parser_namespace_definition): Adjust for
3970         push_namespace change.
3972 2017-05-11  Nathan Sidwell  <nathan@acm.org>
3974         * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3975         LANG_HOOKS_PUSHDECL): Move to ...
3976         * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3977         LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3978         * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3980         * name-lookup.h (pushdecl): Add default friend parm.
3981         (pushdecl_maybe_friend): Delete.
3982         (pushdecl_top_level): Add default friend parm.
3983         (pushdecl_top_level_maybe_friend): Delete.
3984         * name-lookup.c (pushdecl_maybe_friend): Delete.
3985         (pushdecl): Add is_friend parm.
3986         (pushdecl_top_level): Add is friend_parm.
3987         (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3988         (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3989         * friend.c (do_friend): Adjust.
3990         * pt.c (tsubst_friend_class): Adjust.
3992         Revert pushdecl_top_level_and_finish name change.
3993         * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3994         * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3995         * decl.c (cp_make_fname_decl): Adjust.
3996         * decl2.c (get_guard, handle_tls_init):  Adjust.
3997         * rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.
3999         * name-lookup.c (pushdecl_outermost_localscope): Always
4000         conditionally stop timer.
4002         * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
4003         * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
4005         * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
4006         pushtag_top_level_maybe_friend,
4007         pushdecl_top_level_and_finish): Move declarations to ...
4008         * name-lookup.h: ... here.  Group pushdecl variants.
4009         (pushdecl_top_level_and_finish): Rename to ...
4010         (pushdecl_top_level_with_init): ... here.
4011         * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
4012         * decl2.c (get_guard, handle_tls_init): Likewise.
4013         * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
4014         * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
4015         * method.c (implicitly_declare_fn): Likewise.
4016         * searchc (node_debug_info_needed): Likewise.
4017         * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
4018         (pushdecl_top_level_with_init): ... here.
4019         (pop_everything): Use namespace_bindings_p.
4021         * name-lookup.h (pop_binding): Rename to pop_local_binding.
4022         (getdecls): Rename to get_local_decls.
4023         * name-lookup.c (pop_binding): Rename to ...
4024         (pop_local_binding): ... here.
4025         (pop_bindings_and_leave_scope): Adjust.
4026         (getdecls): Rename to ...
4027         (get_local_decls): ... here.  Assert local scope.
4028         * decl.c (poplevel): Assert not namespace.  Adjust and simplify
4029         logic.
4030         (store_parm_decls): Adjust get_local_decls call.
4031         (parser.c (synthesize_implicit_template_parm): Likewise.
4033 2017-05-11  Ville Voutilainen  <ville.voutilainen@gmail.com>
4035         PR c++/80682
4036         * method.c (is_trivially_xible): Reject void types.
4038 2017-05-10  Nathan Sidwell  <nathan@acm.org>
4040         * class.c (handle_using_decl): Always use OVL_CURRENT.
4041         (resolve_address_of_overloaded_function): Move iterator decl into
4042         for scope.  Don't strip anticipated decls here.
4044         * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
4045         printing.
4046         (print_candidates): Adjust.
4048         * cp-tree.h (build_new_function_call): Lose koenig_p arg.  Fix
4049         line breaking.
4050         * call.c (build_new_function_call): Lose koenig_p arg.  Remove
4051         koenig_p handling here.
4052         * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
4053         (tsubst_omp_clauses): Likewise.
4054         (do_class_deduction): Adjust buld_new_function_call calls.
4055         * semantics.c (finish_call_expr): Likewise.
4057 2017-05-10  Jason Merrill  <jason@redhat.com>
4059         * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
4060         (unify_type_mismatch, unify_parameter_pack_mismatch)
4061         (unify_ptrmem_cst_mismatch, unify_expression_unequal)
4062         (unify_parameter_pack_inconsistent, unify_inconsistency)
4063         (unify_vla_arg, unify_method_type_error, unify_arity)
4064         (unify_arg_conversion, unify_no_common_base)
4065         (unify_inconsistent_template_template_parameters)
4066         (unify_template_deduction_failure)
4067         (unify_template_argument_mismatch)
4068         (unify_overload_resolution_failure): Call unify_invalid.
4070         CWG 1847 - Clarifying compatibility during partial ordering
4071         * pt.c (more_specialized_fn): No order between two non-deducible
4072         parameters.
4074         * pt.c (dependent_type_p): Make sure we aren't called with
4075         global_type_node.
4077         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4078         * pt.c (convert_template_argument): Just return an argument pack.
4079         (coerce_template_parameter_pack, template_parm_to_arg)
4080         (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
4081         (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
4082         Don't set the type of a NONTYPE_ARGUMENT_PACK.
4083         * parser.c (make_char_string_pack, make_string_pack): Likewise.
4085 2017-05-10  Nathan Sidwell  <nathan@acm.org>
4087         * cp-tree.h (add_method, clone_function_decl): Change last arg to
4088         bool.
4089         * class.c (add_method): Change third arg to bool.  Adjust.
4090         (one_inheriting_sig, one_inherited_ctor): Adjust.
4091         (clone_function_decl): Change 2nd arg to bool.  Adjust.
4092         (clone_constructors_and_destructors): Adjust.
4093         * lambda.c (maybe_add_lambda_conv_op): Adjust.
4094         * method.c (lazily_declare_fn): Adjust.
4095         * pt.c (tsubst_decl, instantiate_template_1): Adjust.
4096         * semantics.c (finish_member_declaration): Adjust.
4098 2017-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
4100         PR c++/80145
4101         * decl.c (finish_function): To improve error recovery, change the
4102         logic for calling apply_deduced_return_type.
4104 2017-05-09  Jason Merrill  <jason@redhat.com>
4106         PR c++/80605 - __is_standard_layout and empty base
4107         * class.c (check_bases): Ignore empty bases.
4109         PR c++/70979 - literal class and closure types
4110         * class.c (finalize_literal_type_property): Handle closures
4111         specifically.
4112         (explain_non_literal_class): Likewise.
4114         PR c++/66297, DR 1684 - literal class and constexpr member fns
4115         * constexpr.c (is_valid_constexpr_fn): Only complain about
4116         non-literal enclosing class in C++11.
4117         * class.c (finalize_literal_type_property): Likewise.
4119 2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
4121         PR c++/80186
4122         * pt.c (tsubst_decl): Early return error_mark_node if
4123         grok_ctor_properties returns false.
4125 2017-05-09  Jason Merrill  <jason@redhat.com>
4127         PR c++/70167 - array prvalue treated as lvalue
4128         * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
4129         (enum fcl_t): New.
4130         * semantics.c (finish_compound_literal): Add fcl_context parameter.
4131         Only make a static variable for C99 syntax.
4132         * parser.c (cp_parser_postfix_expression): Pass it.
4133         * pt.c (tsubst_copy_and_build): Likewise.
4134         * call.c (extend_ref_init_temps): Set
4135         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
4137 2017-05-09  Nathan Sidwell  <nathan@acm.org>
4139         * cp-lang.c (get_global_decls, cxx_pushdecl): New.
4140         (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
4141         * name-lookup.h (pushdecl_top_level): Declare.
4143 2017-05-08  Jason Merrill  <jason@redhat.com>
4145         PR c++/80178 - parameter passing for uncopyable classes
4146         * tree.c (type_has_nontrivial_copy_init): True for classes with only
4147         deleted copy/move ctors.
4148         (remember_deleted_copy, maybe_warn_parm_abi): New.
4149         * decl.c (require_complete_types_for_parms, check_function_type):
4150         Call maybe_warn_parm_abi.
4151         * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
4153 2017-05-08  Nathan Sidwell  <nathan@acm.org>
4155         * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
4156         (start_preparsed_function): Do decl pushing before setting
4157         current_funciton_decl and announcing it.
4159         * name-lookup.h (pushdecl_with_scope): Replace with ...
4160         (pushdecl_outermost_localscope): ... this.
4161         * name-lookup.c (pushdecl_with_scope): Replace with ...
4162         (pushdecl_outermost_localscope): ... this.
4163         (pushdecl_namespace_level): Adjust.
4164         * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
4165         * lambda.c (insert_capture_proxy): Likewise.
4167         * class.c (build_vtbl_initializer): Don't shadow outer variable
4168         with static var.
4170         Revert _binding -> _value change.
4171         * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
4172         (get_namespace_binding, set_global_binding): ... these.
4173         * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
4174         (get_namespace_binding, set_global_binding): ... these.
4175         (arg_assoc_namespace, pushdecl_maybe_friend_1,
4176         check_for_out_of_scope_variable, push_overloaded_decl_1,
4177         lookup_name_innermost_nonclass_level, push_namespace): Adjust.
4178         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
4179         SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
4180         * decl.c (poplevel): Adjust.
4181         * pt.c (make_constrained_auto): Likewise.
4183 2017-05-07  Volker Reichelt  <v.reichelt@netcologne.de>
4185         PR translation/80280
4186         * call.c (print_z_candidate): Fix quoting.
4188 2017-05-05  David Malcolm  <dmalcolm@redhat.com>
4190         * error.c (pedwarn_cxx98): Replace report_diagnostic
4191         with diagnostic_report_diagnostic.
4193 2017-05-05  Nathan Sidwell  <nathan@acm.org>
4195         * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
4196         (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
4197         (IDENTIFIER_NAMESPACE_VALUE): Delete.
4198         * name-lookup.h (namespace_binding, set_namespace_binding): Replace
4199         with ...
4200         (get_namespace_value, set_global_value): ... these.
4201         (get_global_value_if_present, is_typename_at_global_scope): Delete.
4202         * decl.c (poplevel): Use get_namespace_value.
4203         (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
4204         * class.c (build_vtbl_initializer): Stash library decl in
4205         static var. Use IDENTIFIER_GLOBAL_VALUE.
4206         * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
4207         do_allocate_exception, do_free_exception, build_throw): Likewise.
4208         * init.c (throw_bad_array_new_length): Likewise.
4209         * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
4210         * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
4211         check_for_our_of_scope_variable, push_overloaded_decl_1): Use
4212         get_namespace_value.
4213         (set_namespace_binding_1): Rename to
4214         (set_namespace_binding): ... here.
4215         (set_global_value): New.
4216         (lookup_name_innermost_nonclass_level_1, push_namespace): Use
4217         get_namespace_value.
4218         * pt.c (listify): Use get_namespace_value.
4220         * call.c (make_temporary_var_for_ref_to_temp): Push decl into
4221         current scope.
4222         * lex.c (unqualified_name_lookup_error): Likewise.
4224         * class.c (alter_class): Use retrofit_lang_decl directly.
4225         * decl.c (push_local_name, dupliate_decls): Likewise.
4226         * semantics.c (omp_privatize_field): Likewise.
4228         Kill walk_namespaces.
4229         * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
4230         * decl.c (walk_namespaces_r, walk_namespaces): Delete.
4232         Kill per-namespace static_decls.
4233         * cp-tree.h (static_decls): Declare.
4234         (wrapup_globals_for_namespace,
4235         diagnose_inline_vars_for_namespace): Replace with ...
4236         (wrapup_namespace_globals): ... this.
4237         * decl.c (static_decls): Define.
4238         (wrapup_globals_for_namespace,
4239         diagnose_inline_vars_for_namespace): Replace with ...
4240         (wrapup_namespace_globals): ... this.
4241         (cxx_init_decl_processing): Initialize static_decls.
4242         * decl2.c (c_parse_final_cleanups): Adjust.
4243         * name-lookup.h (cp_binding_level): Remove static_decls member.
4244         * name-lookup.c (add_decl_to_level): Adjust.
4245         (begin_scope): Adjust.
4247 2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
4249         PR c++/71577
4250         * decl.c (reshape_init): Unconditionally return error_mark_node
4251         upon error about too many initializers.
4253 2017-05-04  Nathan Sidwell  <nathan@acm.org>
4255         * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4257 2017-05-04  Martin Sebor  <msebor@redhat.com>
4259         PR translation/80280
4260         * call.c (print_z_candidate): Add missing quoting to %D and other
4261         like directives.
4262         (build_op_call_1): Same.
4263         * constraint.cc (diagnose_check_constraint): Same.
4264         * mangle.c (mangle_decl): Same.
4265         * name-lookup.c (cp_binding_level_debug): Same.
4266         (set_decl_namespace): Same.
4267         * parser.c (cp_parser_tx_qualifier_opt): Same.
4268         * pt.c (print_candidates_1): Same.
4269         (check_template_variable): Same.
4270         (tsubst_default_argument): Same.
4271         (most_specialized_partial_spec): Same.
4272         * semantics.c (omp_reduction_lookup): Same.
4273         * tree.c (check_abi_tag_redeclaration): Same.
4274         * typeck.c (comptypes): Same.
4275         * typeck2.c (abstract_virtuals_error_sfinae): Same.
4277 2017-05-04  Nathan Sidwell  <nathan@acm.org>
4279         More global trees.
4280         * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4281         CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4282         CPTI_INIT_LIST_IDENTIFIER.
4283         (global_namespace, global_type_node, global_identifier,
4284         anon_identifier, init_list_identifier): New.
4285         * decl.c (global_type_node, global_scope_name): Delete.
4286         (initialize_predefined_identifiers): Add new identifiers.
4287         (cxx_init_decl_processing): Adjust.
4288         * name-lookup.h (global_namespace, global_type_node): Delete.
4289         * name-lookup.c (global_namespace, anonymous_namespace_name,
4290         get_anonymous_namespace_name): Delete.
4291         (namespace_scope_ht_size, begin_scope, pushtag_1,
4292         push_namespace): Adjust,
4293         * call.c (type_has_extended_temps): Use init_list_identifier.
4294         * pt.c (listify): Likewise.
4296         * name-lookup.c: Reorder functions to make merging from modules
4297         branch simpler.
4299 2017-05-03  Jason Merrill  <jason@redhat.com>
4301         * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4303 2017-05-03  Nathan Sidwell  <nathan@acm.org>
4305         * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4306         along with #defines, to before name-lookup include.
4308 2017-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
4310         * pt.c (is_auto_or_concept): Remove.
4311         (type_uses_auto_or_concept): Remove, unused.
4312         (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4313         * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4314         * cp-tree.h (is_auto_or_concept): Remove.
4316 2017-05-01  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>
4318         PR c++/80038
4319         * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4320         add pedigree operation and detach call here.
4321         * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4322         cilk_cp_gimplify_call_params_in_spawned_fn.
4323         (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4324         * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4326 2017-04-29  Volker Reichelt  <v.reichelt@netcologne.de>
4328         * parser.c (cp_parser_member_declaration): Add fix-it hints for
4329         stray comma and missing semicolon at end of member declaration.
4331 2017-04-27  Volker Reichelt  <v.reichelt@netcologne.de>
4333         * parser.c (cp_parser_cast_expression): Add target type of cast to
4334         diagnostic.
4335         * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4337 2017-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
4339         * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4340         return type to bool.
4341         * cp-tree.h (grok_ctor_properties): Update.
4343 2017-04-26  Volker Reichelt  <v.reichelt@netcologne.de>
4345         * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4346         information to diagnostic of invalid colon in nested-name-specifier.
4348 2017-04-25  Volker Reichelt  <v.reichelt@netcologne.de>
4350         * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4351         diagnostic of invalid class/struct keyword after enum.
4353 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4355         * parser.c (cp_parser_member_declaration): Add fix-it hint
4356         for removing stray semicolons.
4358 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4360         * name-lookup.c (get_std_name_hint): New function.
4361         (maybe_suggest_missing_header): New function.
4362         (suggest_alternative_in_explicit_scope): Call
4363         maybe_suggest_missing_header.
4365 2017-04-25  David Malcolm  <dmalcolm@redhat.com>
4367         PR c++/80177
4368         * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4369         candidate type of bm from tree to const char *.
4370         (consider_binding_level): Likewise.
4371         (lookup_name_fuzzy): Likewise, using this to merge the best
4372         result from the preprocessor into bm, rather than immediately
4373         returning, so that better matches from reserved words can "win".
4374         Guard the rejection of keywords that don't start decl-specifiers
4375         so it only happens for FUZZY_LOOKUP_TYPENAME.
4377 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4379         * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4380         (start_enum): Likewise.
4381         (build_enumerator): Likewise. Use %qE instead of plain %E.
4382         * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4383         %<%D%> in diagnostics.
4384         (cp_parser_elaborated_type_specifier): Likewise.
4385         * pt.c (make_pack_expansion): Use %qT and %qE instead of
4386         %<%T%> and %<%E%> in diagnostics.
4387         (tsubst_pack_expansion): Likewise.
4389 2017-04-24  David Malcolm  <dmalcolm@redhat.com>
4391         PR c++/80016
4392         * parser.c (cp_parser_unary_expression):  Generate a location
4393         range for alignof and sizeof expressions.
4395 2017-04-24  Volker Reichelt  <v.reichelt@netcologne.de>
4397         * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4398         error message.
4399         (cp_parser_virt_specifier_seq_opt): Likewise.
4400         (set_and_check_decl_spec_loc): Likewise twice.
4402 2017-04-21  Jason Merrill  <jason@redhat.com>
4404         PR c++/80179 - ICE with initialized flexible array member.
4405         * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4407 2017-04-21  Richard Biener  <rguenther@suse.de>
4409         * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4410         (copy_type): Likewise.
4411         * lex.c (copy_decl): Pass down mem-stat info.
4412         (copy_type): Likewise.
4414 2017-04-20  Jonathan Wakely  <jwakely@redhat.com>
4416         PR c++/80473
4417         * init.c (build_new_1): Suppress notes about over-aligned new when
4418         the warning is suppressed.
4420 2017-04-20  Volker Reichelt  <v.reichelt@netcologne.de>
4422         * parser.c (cp_parser_member_declaration): Add warning with fixit
4423         information for extra semicolon after in-class function definition.
4425 2017-04-20  Jakub Jelinek  <jakub@redhat.com>
4427         PR middle-end/80423
4428         * tree.c (build_cplus_array_type): Call build_array_type
4429         with the intended TYPE_TYPELESS_STORAGE flag value, instead
4430         of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4431         on the shared type.
4433 2017-04-18  Marek Polacek  <polacek@redhat.com>
4435         PR c++/80244 - ICE with attribute in template alias.
4436         * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4438         PR c++/80241 - ICE with alignas pack expansion.
4439         * error.c (dump_expr): Handle TREE_LIST.
4440         * parser.c (cp_parser_std_attribute_list): Return error_mark if
4441         make_pack_expansion returns an error.
4443 2017-04-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
4445         PR c++/80287
4446         * class.c (fixup_may_alias): Fix all type variants.
4448 2017-04-17  Jason Merrill  <jason@redhat.com>
4450         PR c++/80415 - wrong error with default arg and array reference.
4451         * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4453         * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4455 2017-04-15  Alexandre Oliva <aoliva@redhat.com>
4457         * decl.c (name_unnamed_type): Split out of...
4458         (grokdeclarator): ... this.
4459         * decl.h (name_unnamed_type): Declare.
4461 2017-04-12  Richard Biener  <rguenther@suse.de>
4462         Bernd Edlinger  <bernd.edlinger@hotmail.de>
4464         PR middle-end/79671
4465         * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4466         for arrays of character or std::byte type.
4468 2017-04-11  Jason Merrill  <jason@redhat.com>
4470         PR c++/80294 - ICE with constexpr and inheritance.
4471         * constexpr.c (reduced_constant_expression_p):
4472         A null constructor element is non-constant.
4473         (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4474         returning an empty base.
4476 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4478         PR c++/80370
4479         * decl.c (cp_finish_decomp): If processing_template_decl on
4480         non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4481         change their DECL_VALUE_EXPR nor cp_finish_decl them.  Instead make
4482         sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4483         processing.
4484         * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4485         with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4486         dependent.
4488 2017-04-11  Jakub Jelinek  <jakub@redhat.com>
4490         PR c++/80363
4491         * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4493 2017-04-10  Jakub Jelinek  <jakub@redhat.com>
4495         PR c++/80176
4496         * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4497         operand, if it is a static member function, recurse on the
4498         BASELINK.
4500 2017-04-10  Marek Polacek  <polacek@redhat.com>
4502         PR sanitizer/80348
4503         * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
4504         ORIG_TYPE earlier and not only when shortening.
4506 2017-04-07  Jason Merrill  <jason@redhat.com>
4508         PR c++/80356 - ICE with reference to function template argument.
4509         PR c++/79294
4510         * pt.c (convert_nontype_argument_function): Adjust type even with a
4511         value-dependent argument.
4513         PR c++/80267 - ICE with nested capture of reference
4514         PR c++/60992
4515         * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4517 2017-04-07  Marek Polacek  <polacek@redhat.com>
4519         PR sanitizer/80348
4520         * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4522         PR c++/80095
4523         * call.c (build_over_call): Don't check cxx_dialect.
4524         * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4525         whether SUB is a CONSTRUCTOR.
4526         * init.c (build_new_1): Don't check cxx_dialect.
4527         * tree.c (replace_placeholders): Add a function comment.  Return if
4528         not in C++14, or if the object isn't a (member of a) class.
4529         * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4530         TYPE is CLASS_TYPE_P.
4532 2017-04-05  Jakub Jelinek  <jakub@redhat.com>
4534         PR c++/80309
4535         * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4536         of a loop doing vec_safe_push of NULL.  Formatting fixes.
4537         (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4538         to newidx before calling canonical_type_parameter on newtype.
4540 2017-04-04  Volker Reichelt  <v.reichelt@netcologne.de>
4542         PR c++/80296
4543         * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4544         UNARY_PLUS_EXPR case.
4546 2017-04-03  Jason Merrill  <jason@redhat.com>
4548         * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4550 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
4552         * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4553         * decl2.c (one_static_initialization_or_destruction): Likewise.
4554         * name-lookup.c (store_bindings): Likewise.
4555         * parser.c (make_call_declarator): Likewise.
4556         * pt.c (check_explicit_specialization): Likewise.
4558 2017-04-03  Jason Merrill  <jason@redhat.com>
4560         PR sanitizer/79993 - ICE with VLA initialization from string
4561         PR c++/69487 - wrong VLA initialization from string
4562         * init.c (finish_length_check): Split out from build_vec_init.
4563         (build_vec_init): Handle STRING_CST.
4564         * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4565         (digest_init_r): Don't give a STRING_CST VLA type.
4567 2017-03-31  Jakub Jelinek  <jakub@redhat.com>
4569         PR c++/79572
4570         * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4571         REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
4572         for NOP_EXPR to REFERENCE_TYPE.
4574         PR libstdc++/80251
4575         * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4576         * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4577         CPTK_IS_AGGREGATE.
4578         * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4579         Remove extraneous parens.
4580         (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4581         * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4582         (cp_parser_trait_expr): Likewise.
4584 2017-03-27  Jakub Jelinek  <jakub@redhat.com>
4586         PR middle-end/80162
4587         * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4588         * typeck.c (cxx_mark_addressable): Likewise.  Look through
4589         VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4590         to ARRAY_TYPE.
4591         (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4593 2017-03-24  Jason Merrill  <jason@redhat.com>
4595         PR c++/77339 - ICE with invalid use of alias template.
4596         * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4597         alias template.
4599 2017-03-24  Marek Polacek  <polacek@redhat.com>
4601         PR c++/80119
4602         * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4603         doesn't have side effects.
4605 2017-03-23  Jason Merrill  <jason@redhat.com>
4607         PR c++/80150 - ICE with overloaded variadic deduction.
4608         * pt.c (try_one_overload): Remove asserts.
4610         PR c++/77563 - missing ambiguous conversion error.
4611         * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4613 2017-03-23  Marek Polacek  <polacek@redhat.com>
4615         * cp-tree.h: Remove a C_RID_YYCODE reference.
4617 2017-03-22  Jakub Jelinek  <jakub@redhat.com>
4619         PR c++/80141
4620         * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4621         case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4622         processing_template_decl.
4624 2017-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
4626         PR c++/77752
4627         * name-lookup.c (pushtag_1): Add check for bogus, non template,
4628         std::initializer_list.
4630 2017-03-21  Jakub Jelinek  <jakub@redhat.com>
4632         PR c++/35878
4633         * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4635 2017-03-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
4637         PR c++/35878
4638         * init.c (std_placement_new_fn_p): New.
4639         (build_new_1): Call it.
4641 2017-03-20  Jason Merrill  <jason@redhat.com>
4643         PR c++/80096 - ICE with C++17 non-type auto.
4644         * pt.c (tsubst): Delay tsubst of type of template non-type
4645         parameter.
4647         PR c++/79519 - ICE with deleted template friend.
4648         * decl.c (grokdeclarator): Complain about misplaced function
4649         definition using =, as well.
4651         PR c++/79640 - infinite recursion with generic lambda.
4652         * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4653         before substituting its initializer.
4655 2017-03-20  Marek Polacek  <polacek@redhat.com>
4656             Paolo Carlini  <paolo.carlini@oracle.com>
4658         PR c++/80059 - ICE with noexcept and __transaction_atomic
4659         * except.c (build_must_not_throw_expr): Call
4660         instantiate_non_dependent_expr.
4662 2017-03-19  Jason Merrill  <jason@redhat.com>
4664         PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4665         * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4666         reference decomposition.
4668         PR c++/80077 - error with constexpr and -fno-elide-constructors.
4669         * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4670         expanding trivial constructor.
4672 2017-03-17  Jason Merrill  <jason@redhat.com>
4674         PR c++/78345 - ICE initializing array from lambda.
4675         * init.c (build_aggr_init): Check array initializer.
4676         (build_vec_init): Check the type of a CONSTRUCTOR.
4678         PR c++/80073 - C++17 ICE with virtual base.
4679         * decl.c (xref_basetypes): Also check for indirect vbases.
4681 2017-03-16  Jason Merrill  <jason@redhat.com>
4683         * decl.c (start_enum): std::byte aliases anything.
4685         PR c++/79797
4686         * constexpr.c (lookup_placeholder): Tweak.
4688 2017-03-15  Jason Merrill  <jason@redhat.com>
4690         PR c++/80043 - ICE with -fpermissive
4691         * typeck.c (convert_for_assignment): Handle instantiate_type
4692         not giving an error.
4694 2017-03-14  Nathan Sidwell  <nathan@acm.org>
4696         PR c++/79393 DR 1658 workaround
4697         * method.c (synthesized_method_base_walk): Inihibit abstract class
4698         virtual base access check here.
4699         (synthesized_method_walk): Not here.
4701 2017-03-13  Nathan Sidwell  <nathan@acm.org>
4703         PR c++/79393 DR 1658 workaround
4704         * method.c (synthesized_method_walk): Check vbases of abstract
4705         classes for dtor walk.
4707 2017-03-10  David Malcolm  <dmalcolm@redhat.com>
4709         PR translation/79848
4710         * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4712 2017-03-10  Jason Merrill  <jason@redhat.com>
4714         PR c++/79960 - alias templates and partial ordering
4715         * pt.c (comp_template_args): Add partial_order parm.
4716         (template_args_equal): Likewise.
4717         (comp_template_args_porder): New.
4718         (get_partial_spec_bindings): Use it.
4720 2017-03-10  Marek Polacek  <polacek@redhat.com>
4722         PR c++/79967
4723         * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4725 2017-03-10  Jakub Jelinek  <jakub@redhat.com>
4727         PR c++/79899
4728         * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4729         Use XALLOCAVEC macro.
4731         PR c++/79896
4732         * decl.c (finish_enum_value_list): If value is error_mark_node,
4733         don't copy it and change its type.
4734         * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4735         of CONST_DECL is error_mark_node.
4737 2017-03-09  Marek Polacek  <polacek@redhat.com>
4739         PR c++/79900 - ICE in strip_typedefs
4740         * tree.c (strip_typedefs): Skip the attribute handling if T is
4741         a variant type which hasn't been updated yet.
4743         PR c++/79687 - wrong code with pointer-to-member
4744         * init.c (constant_value_1): Break if the variable has a dynamic
4745         initializer.
4747 2017-03-08  Jason Merrill  <jason@redhat.com>
4749         PR c++/79797 - ICE with self-reference in array DMI.
4750         * constexpr.c (lookup_placeholder): Split out...
4751         (cxx_eval_constant_expression): ...from here.
4753 2017-03-07  Jakub Jelinek  <jakub@redhat.com>
4755         PR c/79834
4756         * parser.c (cp_parser_omp_cancellation_point,
4757         cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4758         cp_parser_omp_target_update): Change "may only be used in compound
4759         statements" diagnostics, such that the same translatable string is
4760         used for all pragmas.
4761         (cp_parser_pragma): Likewise.  Use error_at instead of
4762         cp_parser_error for that diagnostics.
4764 2017-03-06  Marek Polacek  <polacek@redhat.com>
4766         PR c++/79796 - ICE with NSDMI and this pointer
4767         * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4768         replace_placeholders.
4770 2017-03-06  Jakub Jelinek  <jakub@redhat.com>
4772         PR c++/79822
4773         * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4774         ({ (void) 0; }).
4776 2017-03-06  Jason Merrill  <jason@redhat.com>
4778         Revert "Allow deduction guides to look into primary template."
4779         * cp-tree.h, parser.c, pt.c, search.c: Revert.
4781 2017-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
4783         PR c++/70266
4784         * except.c (build_must_not_throw_expr): Perform the implicit
4785         conversions on the condition.
4787 2017-03-03  Jason Merrill  <jason@redhat.com>
4789         * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4790         -Wc++1z-compat.
4792         Core issues 2273 and 2277
4793         * call.c (joust): Adjust using-declaration tiebreaker to handle
4794         the intermediate base case.
4795         * method.c (strip_inheriting_ctors): Just return the argument if
4796         !flag_new_inheriting_ctors.
4798 2017-03-03  Richard Biener  <rguenther@suse.de>
4800         PR c++/79825
4801         * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4803 2017-03-03  Marek Polacek  <polacek@redhat.com>
4805         PR c++/79791
4806         * typeck.c (string_conv_p): In C++11, always call pedwarn with
4807         OPT_Wwrite_strings.
4809 2017-03-02  Jason Merrill  <jason@redhat.com>
4811         Update overload resolution with deduction guides.
4812         * pt.c (do_class_deduction): Always build the copy guide.
4813         (copy_guide_p, template_guide_p): New.
4814         (build_deduction_guide): Remember the original constructor.
4815         * call.c (joust): Prefer the copy guide and non-template guides.
4817         Allow deduction guides to look into primary template.
4818         * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4819         (struct cp_decl_specifier_seq): Add constructor_p.
4820         * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4821         (cp_parser_init_declarator): Check it.  Set ctor_dtor_or_conv_p.
4822         Clear deduction_guide_type.  Don't handle deduction guide names.
4823         (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4824         (cp_parser_direct_declarator): Likewise.  Handle deduction guides.
4825         (cp_parser_member_declaration, cp_parser_cache_defarg)
4826         (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4827         * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4828         (build_deduction_guide): Set deduction_guide_type.
4829         (dependent_scope_p): Check deduction_guide_type.
4830         * search.c (lookup_member): Likewise.
4832 2017-03-02  Jakub Jelinek  <jakub@redhat.com>
4834         PR c++/79782
4835         * init.c (mark_exp_read_r): New function.
4836         (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4837         whole arguments instead of plain mark_exp_read on TREE_LIST values.
4839 2017-03-01  Jason Merrill  <jason@redhat.com>
4841         Class template argument deduction in new-expression
4842         * init.c (build_new): Handle deduction from no initializer.
4843         * parser.c (cp_parser_new_expression): Don't require a single
4844         expression for class template deduction.
4845         * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4846         class template placeholder.
4847         * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4848         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4849         (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4851 2017-03-01  Jakub Jelinek  <jakub@redhat.com>
4853         PR c++/79746
4854         * init.c (emit_mem_initializers): When not constructing vbases of
4855         abstract classes, mark arguments as read for
4856         -Wunused-but-set-parameter.
4858 2017-02-28  Jason Merrill  <jason@redhat.com>
4860         Class template argument deduction refinements
4861         * call.c (joust): Move deduction guide tiebreaker down.
4862         * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4863         deduction with no initializer.
4864         * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4865         (do_class_deduction): Use that rather than special case.
4866         (do_auto_deduction): Handle null initializer.
4868 2017-02-28  Jakub Jelinek  <jakub@redhat.com>
4870         * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4871         instead of just cond ? "..." : "...".
4872         (grokdeclarator): Likewise.
4873         (build_enumerator): Likewise.
4874         * init.c (build_new_1): Likewise.
4875         * call.c (build_new_method_call_1): Likewise.
4876         * parser.c: Include intl.h.
4877         (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4878         "enter"/"exit" keyword.
4879         (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4880         message.
4882 2017-02-27  Jason Merrill  <jason@redhat.com>
4884         PR c++/71568 - SFINAE forming pointer to member function
4885         * init.c (build_offset_ref): Check the return value of
4886         perform_or_defer_access_check.
4888 2017-02-27  Marek Polacek  <polacek@redhat.com>
4890         * decl.c (expand_static_init): Add missing } in a comment.
4892 2017-02-27  Volker Reichelt  <v.reichelt@netcologne.de>
4894         * init.c: Include intl.h.
4895         (build_new_1): Move message strings into pedwarn to make them
4896         -Wformat-security friendly. Mark string for translation.
4897         * pt.c (tsubst_copy_and_build): Mark string for translation.
4898         Make the pointer const.
4899         * semantics.c (finish_id_expression): Mark strings for translation.
4901 2017-02-25  Jakub Jelinek  <jakub@redhat.com>
4903         * call.c (build_op_delete_call): Make msg1 and msg2 const.
4905 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
4907         PR c++/79588
4908         * call.c (build_over_call): Call check_function_arguments even for
4909         -Wrestrict, adjust check_function_arguments caller.
4910         * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4911         here.
4912         * typeck.c (cp_build_function_call_vec): Adjust
4913         check_function_arguments caller.
4915 2017-02-24  Marek Polacek  <polacek@redhat.com>
4917         PR translation/79705
4918         * decl.c (check_redeclaration_exception_specification): Mark a string
4919         for translation.  Make the pointer const.
4921 2017-02-23  Paolo Carlini  <paolo.carlini@oracle.com>
4923         PR c++/79361
4924         * pt.c (register_specialization): Check duplicate_decls return value
4925         for error_mark_node and pass it back.
4927 2017-02-22  Jason Merrill  <jason@redhat.com>
4929         PR c++/79679 - missing destructor for argument
4930         * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4931         conversions.
4933         * pt.c (do_class_deduction): Handle 0 argument case.
4935 2017-02-22  Jakub Jelinek  <jakub@redhat.com>
4937         PR c++/79664
4938         * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4939         SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4940         * constexpr.c (potential_constant_expression_1): Handle
4941         OMP_*, OACC_* and CILK_* trees.  Use error_at with
4942         EXPR_LOC_OR_LOC (t, input_location) computed early
4943         instead of error, or error_at with location_of (t).
4945 2017-02-22  Marek Polacek  <polacek@redhat.com>
4947         PR c++/79653
4948         * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4949         if the alignas expression is erroneous.
4950         * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4951         error_mark_node.
4953         PR c++/79657
4954         * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4956 2017-02-21  Jason Merrill  <jason@redhat.com>
4958         PR c++/50308 - wrong deprecated warning with ADL
4959         PR c++/17729 - duplicate deprecated warning
4960         * semantics.c (finish_id_expression): Only call mark_used on a
4961         function if we aren't building a call.
4963         PR c++/41727 - ICE with partial spec of partial instantiation
4964         * pt.c (process_partial_specialization): For now, don't check more
4965         specialized if there is more than one level of args.
4967 2017-02-21  Marek Polacek  <polacek@redhat.com>
4969         PR c++/79535
4970         * cp-tree.h (maybe_reject_flexarray_init): Declare.
4971         * init.c (maybe_reject_flexarray_init): No longer static.
4972         Add check for current_function_decl.
4973         * parser.c (cp_parser_late_parse_one_default_arg): Reject
4974         a default mem-initializer for a flexible array.
4976 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4977             Paolo Carlini  <paolo.carlini@oracle.com>
4979         PR c++/79654
4980         * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4981         on error.
4982         * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4983         decl after the decomposition artificial decl has error_mark_node.
4984         * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4985         instead of just == error_mark_node comparison.
4987 2017-02-21  Jakub Jelinek  <jakub@redhat.com>
4989         PR sanitizer/79589
4990         * decl.c: Include gimplify.h.
4991         (cp_finish_decomp): Make sure there is no sharing of trees
4992         in between DECL_VALUE_EXPR of decomposition decls.
4994         PR c++/79655
4995         * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4997         PR c++/79639
4998         * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4999         call cplus_expand_constant on it first.
5001 2017-02-19  Jason Merrill  <jason@redhat.com>
5003         PR c++/78139 - destructor needed by new-expression
5004         * call.c (build_special_member_call): Use tf_no_cleanup.
5006         PR c++/78282 - auto template and pack expansion
5007         * pt.c (find_parameter_packs_r): Don't walk into the type of
5008         templates other than template template-parameters.
5010         PR c++/79606 - ICE with this->base_member in NSDMI
5011         * class.c (build_base_path): Check processing_template_decl.
5013         PR c++/79607 - ICE with T{} initializer
5014         * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
5016         PR c++/79566 - elaborated-type-specifier in range for
5017         * parser.c (cp_parser_simple_declaration): Fix check for type
5018         definition.
5020         PR c++/79400 - confusing suggestion of 'noexcept'
5021         * parser.c (cp_parser_exception_specification_opt): Remove
5022         suggestion for deprecated dynamic exception-specification.
5024         PR c++/79470 - partial ordering with reference parameters
5025         * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
5027         PR c++/79500 - ICE with non-template deduction guide
5028         * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
5029         DECL_TEMPLATE_RESULT.
5031         PR c++/79580 - ICE with compound literal
5032         * parser.c (cp_parser_class_head): If we're in the middle of an
5033         expression, use ts_within_enclosing_non_class.
5035         PR c++/79503 - inherited ctor taking base class
5036         * call.c (add_function_candidate): Also check that
5037         DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
5039 2017-02-19  Paolo Carlini  <paolo.carlini@oracle.com>
5041         PR c++/79380
5042         * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
5043         argument.
5045 2017-02-19  Eric Fiselier  <eric@efcs.ca>
5046             Jonathan Wakely  <jwakely@redhat.com>
5048         PR c++/69523
5049         * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
5050         control warning about literal suffix identifiers without a leading
5051         underscore.
5053 2017-02-17  Jason Merrill  <jason@redhat.com>
5055         PR c++/79508 - lookup error with member template
5056         * parser.c (cp_parser_template_name): Clear
5057         parser->context->object_type if we aren't doing lookup.
5059         PR c++/78690 - ICE with using and global type with same name
5060         * pt.c (type_dependent_object_expression_p): True for
5061         IDENTIFIER_NODE.
5063         PR c++/79549 - C++17 ICE with non-type auto template parameter pack
5064         * pt.c (convert_template_argument): Just return an auto arg pack.
5065         (tsubst_template_args): Don't tsubst an auto pack type.
5067         PR c++/79556 - C++17 ICE with non-type auto
5068         * pt.c (do_auto_deduction): Don't try to deduce from null type.
5070         PR c++/79533 - C++17 ICE with temporary cast to reference
5071         * call.c (build_over_call): Conversion to a reference prevents copy
5072         elision.
5074 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
5075             Jason Merrill  <jason@redhat.com>
5077         PR c++/79502 - lost nodiscard attribute
5078         * pt.c (apply_late_template_attributes): Do apply non-dependent
5079         attributes to types.
5081 2017-02-16  Jason Merrill  <jason@redhat.com>
5083         PR c++/78572 - ICE with self-modifying array initializer
5084         * constexpr.c (cxx_eval_store_expression): The object we're
5085         initializing is outside the constant-expression.
5086         (cxx_eval_call_expression): Set ctx->call.
5088         PR c++/79050 - ICE with undeduced auto and LTO
5089         * decl.c (poplevel): Remove undeduced auto decls.
5091 2017-02-16  Jakub Jelinek  <jakub@redhat.com>
5093         PR c++/79512
5094         * parser.c (cp_parser_omp_target): For -fopenmp-simd
5095         ignore #pragma omp target even when not followed by identifier.
5097 2017-02-15  Jason Merrill  <jason@redhat.com>
5098             Jakub Jelinek  <jakub@redhat.com>
5100         PR c++/79464 - ICE in IPA with omitted constructor parms
5101         * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
5102         (adjust_clone_args): Adjust.
5103         (add_method): Remember omitted parms.
5104         * call.c (add_function_candidate): Likewise.
5105         * mangle.c (write_method_parms): Likewise.
5106         * method.c (ctor_omit_inherited_parms): Return false if there are no
5107         parms to omit.
5109 2017-02-15  Martin Sebor  <msebor@redhat.com>
5111         PR c++/79363
5112         * init.c (maybe_reject_flexarray_init): New function.
5113         (perform_member_init): Call it.
5115 2017-02-15  Jakub Jelinek  <jakub@redhat.com>
5117         PR c++/79301
5118         * parser.c (cp_parser_std_attribute): Don't pedwarn about
5119         [[deprecated]] with -std=c++11 and [[fallthrough]] with
5120         -std=c++11 and -std=c++14.
5122         PR c++/79288
5123         * decl.c (grokdeclarator): For static data members, handle thread_p
5124         only after handling inline.
5126 2017-02-14  Marek Polacek  <polacek@redhat.com>
5128         PR c++/79420
5129         PR c++/79463
5130         * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
5131         clobbering if the postfix expression isn't an EXPR_P.
5133 2017-02-13  Jason Merrill  <jason@redhat.com>
5135         PR c++/79461 - ICE with lambda in constexpr constructor
5136         * constexpr.c (build_data_member_initialization): Ignore
5137         initialization of a local variable.
5139 2017-02-13  Jakub Jelinek  <jakub@redhat.com>
5141         * init.c (warn_placement_new_too_small): Add missing space in
5142         diagnostics.
5143         * parser.c (cp_parser_oacc_declare): Likewise.
5144         * mangle.c (maybe_check_abi_tags): Likewise.
5146         PR c++/79232
5147         * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
5148         on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
5149         in the rightmost operand.
5151 2017-02-13  Nathan Sidwell  <nathan@acm.org>
5153         PR c++/79296 - ICE mangling localized template instantiation
5154         * decl2.c (determine_visibility): Use template fn context for
5155         local class instantiations.
5157 2017-02-11  Jason Merrill  <jason@redhat.com>
5159         PR c++/77659 - ICE with new and C++14 aggregate NSDMI
5160         * init.c (build_new): Make backups of any CONSTRUCTORs in init.
5161         (build_new_1): Use replace_placeholders.
5162         * tree.c (replace_placeholders_t): Also track whether we've seen a
5163         placeholder.
5164         (replace_placeholders, replace_placeholders_r): Adjust.
5165         * cp-tree.h: Adjust.
5167         PR c++/77790 - ICE with auto function in C++11 mode
5168         * decl.c (undeduced_auto_decl): Remove C++14 limitation.
5169         (require_deduced_type): Add complain parm, return bool.
5170         * cp-tree.h: Adjust.
5171         * decl2.c (mark_used): Use require_deduced_type.
5173 2017-02-10  Jason Merrill  <jason@redhat.com>
5175         PR c++/78908 - template ops and bitfields
5176         * tree.c (build_min_non_dep): Use unlowered_expr_type.
5178         PR c++/78897 - constexpr union
5179         * constexpr.c (cxx_eval_store_expression): A store to a union member
5180         erases a previous store to another member.
5182         PR c++/71285 - member of fold-expression
5183         * semantics.c (finish_unary_fold_expr)
5184         (finish_binary_fold_expr): Use null type for fold-expressions.
5186         PR c++/79401 - protected inherited constructor
5187         * call.c (enforce_access): For inheriting constructor, find a base
5188         binfo in the path we already have.
5190 2017-02-10  Marek Polacek  <polacek@redhat.com>
5192         PR c++/79435
5193         * pt.c (type_dependent_expression_p): Check if the expression type
5194         is null.
5196         PR c++/79184
5197         * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
5198         if warnings shouldn't be given.
5200 2017-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
5202         PR c++/71737
5203         * pt.c (tsubst_decl): Don't try to preserve a typedef that names
5204         an error_mark_node as type.
5206 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
5207             Jason Merrill  <jason@redhat.com>
5209         PR c++/79143
5210         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
5211         from pattern to type.
5213 2017-02-09  Jason Merrill  <jason@redhat.com>
5215         PR c++/79316 - default argument in deduction guide
5216         PR c++/79350 - explicit deduction guide
5217         * parser.c (cp_parser_constructor_declarator_p)
5218         (cp_parser_direct_declarator): Parse deduction guides more like
5219         constructors.
5220         * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
5221         * tree.c (special_function_p): Return it.
5222         * decl.c (check_special_function_return_type): Handle it.
5223         (grokdeclarator, grokfndecl): Adjust.
5224         (cp_finish_decl): Pass flags to do_auto_deduction.
5225         * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
5226         * pt.c (dguide_name_p): Take a const_tree.
5227         (do_class_deduction): Handle explicit.
5228         (do_auto_deduction): Pass flags through.
5229         (build_deduction_guide): Copy explicit flag.
5231 2017-02-09  Jakub Jelinek  <jakub@redhat.com>
5233         PR c++/79429
5234         * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
5235         non-pragma_compound context here.
5236         (cp_parser_omp_target): Likewise.
5237         (cp_parser_pragma): Don't call push_omp_privatization_clauses and
5238         parsing for ordered and target omp pragmas in non-pragma_stmt
5239         non-pragma_compound contexts.
5241         PR c/79431
5242         * parser.c (cp_parser_oacc_declare): Formatting fix.
5243         (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
5244         automatic variables.
5246 2016-02-09  Nathan Sidwell  <nathan@codesourcery.com>
5247             Chung-Lin Tang  <cltang@codesourcery.com>
5249         * parser.c (cp_parser_oacc_clause_tile): Disallow collapse.  Fix
5250         parsing.  Parse constant expression. Remove semantic checking.
5251         (cp_parser_omp_clause_collapse): Disallow tile.
5252         (cp_parser_omp_for_loop): Deal with tile clause.  Don't emit a parse
5253         error about missing for after already emitting one.  Use more
5254         conventional for idiom for unbounded loop.
5255         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5256         * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5257         (finish_omp_for): Deal with tile clause.
5259 2017-02-07  Nathan Sidwell  <nathan@acm.org>
5261         * method.c (synthesized_method_base_walk): New.  Broken out of ...
5262         (synthesized_method_walk): ... here.  Call it.  Cleanup
5263         initializations.
5265 2017-02-07  Patrick Palka  <ppalka@gcc.gnu.org>
5267         PR c++/79360
5268         * typeck2.c (process_init_constructor_union): Consider only
5269         FIELD_DECLs when looking for an NSDMI.
5271 2017-02-06  Jason Merrill  <jason@redhat.com>
5273         PR c++/71193 - incomplete types in templates
5274         * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5275         handle incomplete type by pedwarning and then treating as dependent.
5277 2017-02-06  Jakub Jelinek  <jakub@redhat.com>
5279         PR c++/79379
5280         * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5281         (potential_constant_expression_1): Likewise.
5283         PR c++/79377
5284         * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5285         allow one fewer than expected arguments if flag_permissive.
5287         PR c++/79372
5288         * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5289         * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5290         with error_mark_node type.
5292 2017-02-03  Jason Merrill  <jason@redhat.com>
5294         PR c++/78689 - ICE on constructor with label
5295         * optimize.c (maybe_clone_body): Replace omitted parameters with
5296         null lvalues.
5297         * class.c (build_clone): Fix logic for omitting inherited parms.
5299         PR c++/12245 - excessive memory use
5300         * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5301         back in.  Don't cache constants.
5302         (maybe_constant_init): Don't cache constants.
5304         PR c++/79294 - ICE with invalid template argument
5305         * pt.c (convert_nontype_argument_function): Check value-dependence.
5306         (convert_nontype_argument): Don't check it here for function ptrs.
5308 2017-02-02  Richard Biener  <rguenther@suse.de>
5310         PR cp/14179
5311         * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5312         it lazily on the first changed element only and copy it
5313         fully upfront, only storing changed elements.
5315 2017-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
5317         PR c++/69637
5318         * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5319         to the width.
5321 2017-01-31  Jakub Jelinek  <jakub@redhat.com>
5323         PR c++/79304
5324         * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5325         after ARROW_EXPR.
5327 2017-01-31  David Malcolm  <dmalcolm@redhat.com>
5329         PR c++/79298
5330         * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5331         any namespace aliases.
5333 2017-01-31  Nathan Sidwell  <nathan@acm.org>
5335         PR c++/79290
5336         * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5338         PR c++/67273
5339         PR c++/79253
5340         * pt.c: (instantiate_decl): Push to top level when current
5341         function scope doesn't match.  Only push lmabda scope stack when
5342         pushing to top.
5344         * cp-tree.h (instantiate_decl): Make defer_ok bool.
5345         * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5346         (instantiate_decl): Simplify and reorder state saving and restoration.
5348         PR c++/79264
5349         * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5350         * semantics.c (finish_member_declaration): Assert class is being
5351         defined.
5353 2017-01-30  Alexandre Oliva <aoliva@redhat.com>
5355         Introduce C++ support in libcc1.
5356         * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5357         (ansi_opname): Rename to...
5358         (cp_operator_id): ... this.  Adjust all callers.
5359         (ansi_assopname): Rename to...
5360         (cp_assignment_operator_id): ... this.  Adjust all callers.
5361         (cp_literal_operator_id): Declare.
5362         (set_global_friend): Declare.
5363         (is_global_friend): Declare.
5364         (enum cp_oracle_request): New type.
5365         (cp_binding_oracle_function): New type.
5366         (cp_binding_oracle): Declare.
5367         (cp_finish_injected_record_type): Declare.
5368         * friend.c (global_friend): New var.
5369         (set_global_friend): New fn.
5370         (is_global_friend): New fn.
5371         (is_friend): Call is_global_friend.
5372         * name-lookup.c (cp_binding_oracle): New var.
5373         (query_oracle): New fn.
5374         (qualified_lookup_using_namespace): Call query_oracle.
5375         (lookup_name_real_1): Likewise.
5376         * parser.c (cp_literal_operator_id): Drop static.
5377         * search.c (friend_accessible_p): Call is_global_friend.
5378         * semantics.c (is_this_parameter): Accept a variable if the
5379         binding oracle is enabled.
5381 2017-01-27  Jason Merrill  <jason@redhat.com>
5383         PR c++/78771 - ICE with inherited constructor.
5384         * call.c (build_over_call): Call deduce_inheriting_ctor here.
5385         * pt.c (tsubst_decl): Not here.
5386         * class.c (add_method): Or here.
5387         * method.c (deduce_inheriting_ctor): Handle clones.
5388         (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5390 2017-01-27  Adam Butcher  <adam@jessamine.co.uk>
5392         PR c++/64382
5393         * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5394         New function.
5395         * cp/cp-tree.h: Declare it.
5396         * cp/semantics.c (finish_id_expression): Resolve names within a default
5397         capturing generic lambda defined within a template prior to
5398         instantiation to allow for captures to be added to the closure type.
5400 2017-01-26  Jakub Jelinek  <jakub@redhat.com>
5402         PR c++/68727
5403         * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5404         * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5405         * parser.c (cp_parser_builtin_offsetof): Pass result of
5406         build_static_cast of null_pointer_node to finish_offsetof.
5407         * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5408         it for -Winvalid-offsetof pedwarn instead of trying to guess
5409         original offsetof type from EXPR.  Save OBJECT_PTR as a new
5410         second operand to OFFSETOF_EXPR.
5411         * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5412         finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5413         as OBJECT_PTR.
5415 2017-01-26  Jason Merrill  <jason@redhat.com>
5417         * name-lookup.c (parse_using_directive): Deprecate strong using.
5419         PR c++/79176 - lambda ICE with -flto -Os
5420         * decl2.c (vague_linkage_p): Handle decloned 'tors.
5421         * tree.c (decl_linkage): Likewise.
5423 2017-01-25  Martin Sebor  <msebor@redhat.com>
5425         * decl.c (grokdeclarator): Fix a typo in a comment.
5427 2017-01-25  Jakub Jelinek  <jakub@redhat.com>
5429         PR c++/78896
5430         * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5431         lambda expressions.
5433         PR c++/77914
5434         * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5435         OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5437 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
5439         PR lto/79061
5440         * decl.c (cxx_init_decl_processing): Pass main_input_filename
5441         to build_translation_unit_decl.
5443 2017-01-24  Jakub Jelinek  <jakub@redhat.com>
5445         PR c++/79205
5446         * cp-gimplify.c (cp_genericize_r): Add result of
5447         convert_from_reference on invisiref parm to p_set.
5449 2017-01-24  Nathan Sidwell  <nathan@acm.org>
5451         PR c++/78469 - defaulted ctor and inaccessible dtor
5452         * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5453         * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5454         * tree.c (build_target_expr): Check tf_no_cleanup.
5456         PR c++/79118 - anon-members and constexpr
5457         * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5458         ctor decl.  Recursively check anonymous members.
5459         (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5460         call.
5461         (explain_invalid_constexpr_fn): Likewise.
5463 2017-01-23  Nathan Sidwell  <nathan@acm.org>
5465         PR c++/71710 - template using directive of field
5466         * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5467         check earlier.
5469         PR c++/71406 - ICE with scope-ref'd template id exprs
5470         PR c++/77508
5471         * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5472         before breaking up TEMPLATE_ID_EXPR.
5474 2017-01-20  Nathan Sidwell  <nathan@acm.org>
5476         PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5477         * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5479 2017-01-20  David Malcolm  <dmalcolm@redhat.com>
5481         PR c++/77829
5482         PR c++/78656
5483         * cp-tree.h (suggest_alternatives_for): Add bool param.
5484         (suggest_alternative_in_explicit_scope): New decl.
5485         * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5486         that isn't the global one, call new function
5487         suggest_alternative_in_explicit_scope, only calling
5488         suggest_alternatives_for if it fails, and disabling near match
5489         searches fort that case.  When SCOPE is the global namespace,
5490         pass true for new param to suggest_alternatives_for to allow for
5491         fuzzy name lookups.
5492         * lex.c (unqualified_name_lookup_error): Pass true for new param
5493         to suggest_alternatives_for.
5494         * name-lookup.c (consider_binding_level): Add forward decl.
5495         (suggest_alternatives_for): Add "suggest_misspellings" param,
5496         using it to conditionalize the fuzzy name-lookup code.
5497         (suggest_alternative_in_explicit_scope): New function.
5498         * parser.c (cp_parser_primary_expression): When calling
5499         finish_id_expression, pass location of id_expression rather
5500         than that of id_expr_token.
5501         (cp_parser_id_expression): Convert local "unqualified_id" from
5502         tree to cp_expr to avoid implicitly dropping location information.
5504 2017-01-20  Marek Polacek  <polacek@redhat.com>
5506         PR c/64279
5507         * call.c (build_conditional_expr_1): Warn about duplicated branches.
5508         * semantics.c (finish_expr_stmt): Build statement using the proper
5509         location.
5511 2017-01-19  Jason Merrill  <jason@redhat.com>
5513         US 20 - forwarding references and class template argument deduction
5514         * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5515         * pt.c (push_template_decl_real): Set it.
5516         (maybe_adjust_types_for_deduction): Check it.
5517         (rewrite_template_parm): Copy it.
5519         US 19 - deduction guides and constructors
5520         * call.c (joust): Prefer deduction guides to constructors.
5521         * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5522         (deduction_guide_p): Check DECL_P.
5524         * decl.c (check_initializer): Always use build_aggr_init for array
5525         decomposition.
5527         PR c++/79130 - decomposition and direct-initialization
5528         * init.c (build_aggr_init): Communicate direct-initialization to
5529         build_vec_init.
5530         (build_vec_init): Check for array copy sooner.
5531         * parser.c (cp_parser_decomposition_declaration): Remove call to
5532         build_x_compound_expr_from_list.
5534 2017-01-18  Jason Merrill  <jason@redhat.com>
5536         PR c++/68666 - member variable template-id
5537         * typeck.c (finish_class_member_access_expr): Handle variable
5538         template-id.
5539         * pt.c (lookup_and_finish_template_variable): No longer static.
5540         * cp-tree.h: Declare it.
5542 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5544         PR c++/78488
5545         * call.c (build_over_call): When checking ellipsis conversions for
5546         an inherited ctor, make sure there is at least one conversion.
5548 2017-01-18  Jason Merrill  <jason@redhat.com>
5550         PR c++/78894 - ICE with class deduction and default arg
5551         * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5553 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5555         PR c++/77489
5556         * mangle.c (write_discriminator): Reorganize abi warning check.
5558 2017-01-18  Nathan Sidwell  <nathan@acm.org>
5560         * cp-tree.h: Clarify exception spec node comment.
5561         * except.c (nothrow_spec_p): Simplify by checking node-equality.
5563         PR c++/79091
5564         * mangle.c (write_exception_spec): Check nothrow explicitly.
5565         (write_encoding): Don't increment processing_template_decl around
5566         encoding.
5568 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5570         PR c++/70182
5571         * mangle.c (write_template_args): Add "on" for operator names.
5573 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>
5575         PR c++/77489
5576         * mangle.c (write_discriminator): Handle discriminator >= 10.
5578 2017-01-17  Nathan Sidwell  <nathan@acm.org>
5580         PR c++/61636
5581         * cp-tree.h (maybe_generic_this_capture): Declare.
5582         * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5583         (maybe_resolve_dummy): ... here.  Call it.
5584         (maybe_generic_this_capture): New.
5585         * parser.c (cp_parser_postfix_expression): Speculatively capture
5586         this in generic lambda in unresolved member function call.
5587         * pt.c (tsubst_copy_and_build): Force hard error from failed
5588         member function lookup in generic lambda.
5590 2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
5592         PR c++/70565
5593         * cp-array-notation.c (expand_array_notation_exprs): Handle
5594         OMP_PARALLEL.
5596 2017-01-11  Jason Merrill  <jason@redhat.com>
5598         PR c++/78337 - ICE on invalid with generic lambda
5599         * semantics.c (process_outer_var_ref): Check if containing_function
5600         is null.  Move inform call under complain test.
5602 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5604         PR c++/77812
5605         * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5606         is a new overload.
5608 2017-01-11  Nathan Sidwell  <nathan@acm.org>
5610         * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5612 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
5614         PR c++/78341
5615         * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5616         assertion.  Formatting fix.
5618         PR c++/72813
5619         * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5620         writing PCH file.
5622 2017-01-10  David Malcolm  <dmalcolm@redhat.com>
5624         PR c++/77949
5625         * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5626         a missing semicolon if we have a valid insertion location for
5627         the fix-it hint.
5629 2017-01-10  Jason Merrill  <jason@redhat.com>
5631         FI 20, decomposition declaration with parenthesized initializer.
5632         * parser.c (cp_parser_decomposition_declaration): Use
5633         cp_parser_initializer.
5635 2017-01-09  Jason Merrill  <jason@redhat.com>
5637         Implement P0195R2, C++17 variadic using.
5638         * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5639         * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5640         * error.c (dump_decl): Likewise.
5642 2017-01-09  Jakub Jelinek  <jakub@redhat.com>
5644         PR translation/79019
5645         PR translation/79020
5646         * semantics.c (finish_omp_clauses): Add missing whitespace to
5647         translatable strings.
5648         * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5650 2017-01-07  Jason Merrill  <jason@redhat.com>
5652         PR c++/78948 - instantiation from discarded statement
5653         * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5654         * cp-tree.h (in_discarded_stmt): Declare it.
5655         (struct saved_scope): Add discarded_stmt bitfield.
5656         (in_discarded_stmt): New macro.
5657         * decl2.c (mark_used): Check it.
5658         * parser.c (cp_parser_selection_statement): Adjust.
5659         (cp_parser_jump_statement): Adjust.
5661 2017-01-05  Jakub Jelinek  <jakub@redhat.com>
5663         PR c++/78931
5664         * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5665         REFERENCE_REF_P, set tt to its operand.
5667         PR c++/78890
5668         * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5669         unions even for C++11 and later.
5671 2017-01-05  Nathan Sidwell  <nathan@acm.org>
5673         PR c++/78765
5674         * pt.c (convert_nontype_argument): Don't try and see if integral
5675         or enum expressions are constants prematurely.
5677 2017-01-04  Marek Polacek  <polacek@redhat.com>
5679         PR c++/64767
5680         * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5681         a zero character literal.
5683 2017-01-04  Jakub Jelinek  <jakub@redhat.com>
5685         PR c++/78949
5686         * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5687         vector type.
5689         PR c++/78693
5690         * parser.c (cp_parser_simple_declaration): Only complain about
5691         inconsistent auto deduction if auto_result doesn't use auto.
5693         * parser.c (cp_parser_simple_declaration): Diagnose function
5694         declaration among more than one init-declarators with auto
5695         specifier.
5697         PR c++/71182
5698         * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5699         assertion, as lexer->buffer may be NULL.
5701 2017-01-04  Marek Polacek  <polacek@redhat.com>
5703         PR c++/77545
5704         PR c++/77284
5705         * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5707 2017-01-04  Nathan Sidwell  <nathan@acm.org>
5709         PR c++/66735
5710         * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5711         (lambda_capture_field_type): Update prototype.
5712         * lambda.c (lambda_capture_field_type): Add is_reference parm.
5713         Add referenceness here.
5714         (add_capture): Adjust lambda_capture_field_type call, refactor
5715         error checking.
5716         * pt.c (tsubst): Adjust lambda_capture_field_type call.
5718 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
5720         Update copyright years.
5722 Copyright (C) 2017 Free Software Foundation, Inc.
5724 Copying and distribution of this file, with or without modification,
5725 are permitted in any medium without royalty provided the copyright
5726 notice and this notice are preserved.