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