1 2021-09-10 Jakub Jelinek <jakub@redhat.com>
3 * parser.c (cp_parser_omp_atomic): Allow acq_rel on atomic read/write
4 and acq_rel/acquire clauses on update.
5 * semantics.c (finish_omp_atomic): Adjust c_finish_omp_atomic caller.
7 2021-09-08 Richard Biener <rguenther@suse.de>
10 * cp-tree.h (ANON_AGGR_TYPE_FIELD): New define.
11 * decl.c (fixup_anonymous_aggr): Wipe RTTI info put in
12 place on invalid code.
13 * decl2.c (reset_type_linkage): Guard CLASSTYPE_TYPEINFO_VAR
15 * module.cc (trees_in::read_class_def): Likewise. Reconstruct
17 * semantics.c (finish_member_declaration): Populate
18 ANON_AGGR_TYPE_FIELD for anon aggregate typed members.
19 * typeck.c (lookup_anon_field): Remove DFS search and return
20 ANON_AGGR_TYPE_FIELD directly.
22 2021-09-07 Jakub Jelinek <jakub@redhat.com>
25 * constexpr.c (maybe_save_constexpr_fundef): Save body even for
26 constexpr deleting dtors.
27 (cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
30 2021-09-07 Marcel Vollweiler <marcel@codesourcery.com>
32 * parser.c (cp_parser_omp_flush): Parse 'seq_cst' clause on 'flush'
34 * semantics.c (finish_omp_flush): Handle MEMMODEL_SEQ_CST.
36 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
38 * coroutines.cc (register_local_var_uses): Do not mangle
39 frame entries for the outermost scope. Record the outer
40 scope as nesting depth 0.
42 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
44 * coroutines.cc (coro_build_artificial_var): New.
45 (build_actor_fn): Use var builder, rename vars to use
46 implementation namespace.
47 (coro_rewrite_function_body): Likewise.
48 (morph_fn_to_coro): Likewise.
50 2021-09-03 Iain Sandoe <iain@sandoe.co.uk>
52 * coroutines.cc (transform_local_var_uses): Record
53 frame offset expressions as DECL_VALUE_EXPRs instead of
56 2021-09-03 Patrick Palka <ppalka@redhat.com>
59 * call.c (build_this_conversion): New function, split out from
60 add_function_candidate.
61 (add_function_candidate): New parameter shortcut_bad_convs.
62 Document it. Use build_this_conversion. Stop at the first bad
63 argument conversion when shortcut_bad_convs is true.
64 (add_template_candidate_real): New parameter shortcut_bad_convs.
65 Use build_this_conversion to check the 'this' conversion before
66 attempting deduction. When the rejection reason code is
67 rr_bad_arg_conversion, pass -1 instead of 0 as the viable
68 parameter to add_candidate. Pass 'convs' to add_candidate.
69 (add_template_candidate): New parameter shortcut_bad_convs.
70 (add_template_conv_candidate): Pass false as shortcut_bad_convs
71 to add_template_candidate_real.
72 (add_candidates): Prefer to shortcut bad conversions during
73 overload resolution under the assumption that we'll eventually
74 see a strictly viable candidate. If this assumption turns out
75 to be false, re-process the non-strictly viable candidates
76 without shortcutting those bad conversions.
78 2021-09-03 Jason Merrill <jason@redhat.com>
80 * pt.c (limit_bad_template_recursion): Suppress -Wunused for decls
81 we decide not to instantiate.
83 2021-09-03 Jakub Jelinek <jakub@redhat.com>
86 * class.c (build_base_field): Use SET_DECL_FIELD_ABI_IGNORED
87 instead of writing to DECL_FIELD_ABI_IGNORED.
88 (layout_class_type): Likewise. In the place where zero-width
89 bitfields used to be removed, use
90 SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD on those fields instead.
92 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
94 * call.c (build_over_call): Handle unavailable state in addition to
96 * class.c (type_build_ctor_call): Likewise.
97 (type_build_dtor_call): Likewise.
98 * cp-tree.h: Rename cp_warn_deprecated_use to
99 cp_handle_deprecated_or_unavailable.
100 * decl.c (duplicate_decls): Merge unavailability.
101 (grokdeclarator): Handle unavailability in addition to deprecation.
102 (type_is_unavailable): New.
103 (grokparms): Handle unavailability in addition to deprecation.
104 * decl.h (enum deprecated_states): Add
105 UNAVAILABLE_DEPRECATED_SUPPRESS.
106 * decl2.c (cplus_decl_attributes): Propagate unavailability to
108 (cp_warn_deprecated_use): Rename to ...
109 (cp_handle_deprecated_or_unavailable): ... this and amend to handle
110 the unavailable case. It remains a warning in the case of deprecation
111 but becomes an error in the case of unavailability.
112 (cp_warn_deprecated_use_scopes): Handle unavailability.
113 (mark_used): Likewise.
114 * parser.c (cp_parser_template_name): Likewise.
115 (cp_parser_template_argument): Likewise.
116 (cp_parser_parameter_declaration_list): Likewise.
117 * typeck.c (build_class_member_access_expr): Likewise.
118 (finish_class_member_access_expr): Likewise.
119 * typeck2.c (build_functional_cast_1): Likewise.
121 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
123 * coroutines.cc (build_actor_fn): Add begin/finish clauses
124 to the initial test in the actor function.
126 2021-09-01 Iain Sandoe <iain@sandoe.co.uk>
128 * coroutines.cc (await_statement_walker): Use build_stmt and
129 add_stmt instead of build1 and finish_expr_stmt.
131 2021-08-31 Jason Merrill <jason@redhat.com>
133 * coroutines.cc (flatten_await_stmt): Fix copyo.
134 * decl.c (reshape_init_class): Simplify.
135 * module.cc (module_state::read_language): Add null check.
136 * parser.c (build_range_temp): Avoid type_uses_auto.
137 (cp_parser_class_specifier_1): Add null check.
139 2021-08-31 Patrick Palka <ppalka@redhat.com>
142 * call.c (rejection_reason::call_varargs_p): Rename this
143 previously unused member to ...
144 (rejection_reason::least_p): ... this.
145 (arity_rejection): Add least_p parameter.
146 (add_template_candidate_real): When there are explicit
147 template arguments, check that the arity of the call agrees with
148 the arity of the function before attempting deduction.
149 (print_arity_information): Add least_p parameter.
150 (print_z_candidate): Adjust call to print_arity_information.
152 2021-08-31 Martin Sebor <msebor@redhat.com>
154 * parser.c (cp_parser_selection_statement): Use direct initialization
157 2021-08-31 Jason Merrill <jason@redhat.com>
159 * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel.
161 2021-08-31 Jason Merrill <jason@redhat.com>
164 * cp-tree.h (FNDECL_MANIFESTLY_CONST_EVALUATED): New.
165 * constexpr.c (cxx_eval_call_expression): Set it.
166 * pt.c (neglectable_inst_p): Check it.
168 2021-08-31 Marcel Vollweiler <marcel@codesourcery.com>
170 * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num'
171 and 'ancestor' in 'target device' clauses.
172 * semantics.c (finish_omp_clauses): Error handling. Constant device ids must
173 evaluate to '1' if 'ancestor' is used.
175 2021-08-30 Jason Merrill <jason@redhat.com>
178 * cp-tree.h (struct lang_type): Add erroneous bit-field.
179 (CLASSTYPE_ERRONEOUS): New.
180 * pt.c (limit_bad_template_recursion): Check it.
181 (instantiate_class_template_1): Set it.
183 2021-08-30 Jason Merrill <jason@redhat.com>
185 * constexpr.c (cxx_eval_outermost_constant_expr): Copy
186 expr location to result.
188 2021-08-30 Jason Merrill <jason@redhat.com>
191 * cp-tree.h (cxx_constant_value_sfinae): Declare.
192 * constexpr.c (cxx_constant_value_sfinae): New.
193 * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
194 (tsubst_copy_and_build) [CALL_EXPR]: Call
195 maybe_fold_fn_template_args.
197 2021-08-30 Jason Merrill <jason@redhat.com>
199 * parser.c (cp_parser_simple_requirement): Warn about missing
202 2021-08-27 Jason Merrill <jason@redhat.com>
204 * typeck2.c (build_x_arrow): Do set TREE_TYPE when operand is
207 2021-08-25 Andrew Pinski <apinski@marvell.com>
210 * cp-objcp-common.c (cxx_block_may_fallthru): Handle
211 CLEANUP_STMT for the case which will be try/finally.
213 2021-08-25 Jakub Jelinek <jakub@redhat.com>
216 * init.c (build_value_init_noctor): Ignore unnamed zero-width
219 2021-08-23 Jakub Jelinek <jakub@redhat.com>
221 * parser.c (cp_parser_omp_clause_num_tasks,
222 cp_parser_omp_clause_grainsize): Parse the optional strict: modifier.
224 2021-08-20 Jakub Jelinek <jakub@redhat.com>
226 * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
227 PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
228 (cp_parser_omp_error): New function.
229 (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
231 2021-08-20 Jakub Jelinek <jakub@redhat.com>
233 * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
234 comma at the end of list. Don't parse closing paren here...
235 (cp_parser_omp_clause_depend): ... but here instead.
237 2021-08-19 Patrick Palka <ppalka@redhat.com>
240 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
242 2021-08-19 Jakub Jelinek <jakub@redhat.com>
244 * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
245 and optionally consume token if current token is CPP_EOF,
246 CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
248 2021-08-19 Jakub Jelinek <jakub@redhat.com>
250 * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
251 instead of cp_parser_skip_to_pragma_eol.
253 2021-08-18 Patrick Palka <ppalka@redhat.com>
257 * cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
258 * decl.c (reshape_init_r): Set it.
259 * pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
260 iff CONSTRUCTOR_BRACES_ELIDED_P.
262 2021-08-18 Patrick Palka <ppalka@redhat.com>
265 * pt.c (convert_template_argument): Pass LOOKUP_IMPLICIT to
268 2021-08-18 Jakub Jelinek <jakub@redhat.com>
270 * parser.c (cp_parser_omp_nothing): New function.
271 (cp_parser_pragma): Handle PRAGMA_OMP_NOTHING.
273 2021-08-18 Jakub Jelinek <jakub@redhat.com>
275 * parser.c (cp_parser_omp_ordered): Return true instead of
276 false after emitting errors that the directive is not allowed in
278 (cp_parser_omp_target_update): Likewise.
279 (cp_parser_omp_cancellation_point): Change return type from void to
280 bool, return false if the directive should be ignored in pragma_stmt
282 (cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data):
283 Change return type from tree to bool, return false if the
284 directive should be ignored in pragma_stmt contexts.
285 (cp_parser_omp_target): Adjust callers of cp_parser_omp_target_*_data,
286 return their result directly.
287 (cp_parser_pragma): For PRAGMA_OMP_CANCELLATION_POINT return what
288 cp_parser_omp_cancellation_point returned. Return true instead of
289 false after emitting errors that the directive is not allowed in
292 2021-08-17 Jakub Jelinek <jakub@redhat.com>
295 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE.
296 (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
297 (fold_builtin_is_corresponding_member, next_common_initial_seqence,
298 layout_compatible_type_p): Declare.
299 * parser.c (cp_parser_primary_expression): Handle
300 RID_IS_LAYOUT_COMPATIBLE.
301 (cp_parser_trait_expr): Likewise.
302 * cp-objcp-common.c (names_builtin_p): Likewise.
303 * constraint.cc (diagnose_trait_expr): Handle
304 CPTK_IS_LAYOUT_COMPATIBLE.
305 * decl.c (cxx_init_decl_processing): Register
306 __builtin_is_corresponding_member builtin.
307 * constexpr.c (cxx_eval_builtin_function_call): Handle
308 CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin.
309 * semantics.c (is_corresponding_member_union,
310 is_corresponding_member_aggr, fold_builtin_is_corresponding_member):
312 (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE.
313 (finish_trait_expr): Likewise.
314 * typeck.c (next_common_initial_seqence, layout_compatible_type_p):
316 * cp-gimplify.c (cp_gimplify_expr): Fold
317 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
319 * tree.c (builtin_valid_in_constant_expr_p): Handle
320 CP_BUILT_IN_IS_CORRESPONDING_MEMBER.
321 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
322 CPTK_IS_LAYOUT_COMPATIBLE.
323 * class.c (remove_zero_width_bit_fields): Remove.
324 (layout_class_type): Don't call it.
326 2021-08-17 Jakub Jelinek <jakub@redhat.com>
328 * parser.c (OMP_SCOPE_CLAUSE_MASK): Define.
329 (cp_parser_omp_scope): New function.
330 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_SCOPE.
331 * pt.c (tsubst_expr): Handle OMP_SCOPE.
333 2021-08-12 Jakub Jelinek <jakub@redhat.com>
335 * parser.c (cp_parser_omp_clause_name): Parse filter clause name.
336 (cp_parser_omp_clause_filter): New function.
337 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FILTER.
338 (OMP_MASKED_CLAUSE_MASK): Define.
339 (cp_parser_omp_masked): New function.
340 (cp_parser_omp_parallel): Handle parallel masked.
341 (cp_parser_omp_construct, cp_parser_pragma): Handle PRAGMA_OMP_MASKED.
342 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_FILTER.
343 * pt.c (tsubst_omp_clauses): Likewise.
344 (tsubst_expr): Handle OMP_MASKED.
346 2021-08-12 Sergei Trofimovich <siarheit@google.com>
349 * pt.c (tsubst_copy_and_build): Use build_ptrmemfunc_access_expr
350 to construct ptrmemfunc expression instantiation.
352 2021-08-12 Tobias Burnus <tobias@codesourcery.com>
354 * parser.c (cp_parser_omp_clause_proc_bind): Accept
355 'primary' as alias for 'master'.
357 2021-08-12 Jakub Jelinek <jakub@redhat.com>
359 * cp-tree.h (omp_declare_target_attr): New type.
360 (struct saved_scope): Change type of omp_declare_target_attribute
361 from int to vec<omp_declare_target_attr, va_gc> * and move it.
362 * parser.c (cp_parser_omp_declare_target): Instead of
363 incrementing scope_chain->omp_declare_target_attribute, push
364 a struct containing parser->lexer->in_omp_attribute_pragma to
366 (cp_parser_omp_end_declare_target): Instead of decrementing
367 scope_chain->omp_declare_target_attribute, pop a structure
368 from it. Diagnose mismatching declare target vs.
369 end declare target syntax.
370 * semantics.c (finish_translation_unit): Use vec_safe_length
371 and vec_safe_truncate on scope_chain->omp_declare_target_attributes.
372 * decl2.c (cplus_decl_attributes): Use vec_safe_length
373 on scope_chain->omp_declare_target_attributes.
375 2021-08-12 Jakub Jelinek <jakub@redhat.com>
377 * parser.c (cp_parser_lambda_body): Add temp overrides
378 for parser->{omp_declare_simd,oacc_routine,omp_attrs_forbidden_p}.
379 (cp_parser_statement): Restore parser->omp_attrs_forbidden_p for
380 cp_parser_declaration_statement.
381 (cp_parser_default_argument): Add temp override for
382 parser->omp_attrs_forbidden_p.
383 (cp_parser_late_parsing_omp_declare_simd): Diagnose declare simd
384 or declare variant in attribute syntax on a declaration immediately
385 following an OpenMP construct in pragma syntax.
387 2021-08-12 Jakub Jelinek <jakub@redhat.com>
390 * method.c (cat_tag_for): Return cc_last for !CLASS_TYPE_P
391 or for classes not in std namespace.
393 2021-08-12 Jakub Jelinek <jakub@redhat.com>
395 * name-lookup.c (finish_using_directive): Diagnose omp::directive
396 or omp::sequence attributes on using-directive.
398 2021-08-12 Jakub Jelinek <jakub@redhat.com>
400 * parser.c (cp_parser_block_declaration): Call
401 cp_parser_using_directive for C++11 attributes followed by
402 using namespace tokens.
403 (cp_parser_using_directive): Parse C++11 attributes at the start
404 of the directive rather than at the end, only parse GNU attributes
407 2021-08-12 Patrick Palka <ppalka@redhat.com>
410 * constexpr.c (cxx_eval_store_expression): Handle the lval=true
411 case in the early exit code path for empty stores with mismatched
414 2021-08-11 Patrick Palka <ppalka@redhat.com>
418 * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR.
419 * decl.c (local_variable_p_walkfn): Don't walk into unevaluated
421 * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never
422 reject uses of local variables in unevaluated contexts.
423 * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment
424 cp_unevaluated_operand. Use cp_walk_tree directly instead of
425 WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead
426 of TREE_OPERAND directly.
428 2021-08-11 Jakub Jelinek <jakub@redhat.com>
431 * decl2.c (var_defined_without_dynamic_init): Return true for
432 DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor.
434 2021-08-11 Patrick Palka <ppalka@redhat.com>
437 * parser.c (maybe_adjust_declarator_for_dguide): New, split
439 (cp_parser_init_declarator): ... here.
440 (cp_parser_member_declaration): Use it.
442 2021-08-11 Patrick Palka <ppalka@redhat.com>
445 * parser.c (cp_parser_parameter_declaration_list): Don't call
446 grokdeclarator if cp_parser_error_occurred.
447 (cp_parser_parameter_declaration): Simulate an error if we see
448 the beginning of a CTAD form, i.e. if we see an opening brace
449 after the decl-specifier-seq and the type is a CTAD placeholder.
451 2021-08-10 Jakub Jelinek <jakub@redhat.com>
453 * parser.c (cp_parser_member_declaration): Move odsd declaration
454 before cp_parser_using_declaration call to avoid errors with
457 2021-08-10 Jakub Jelinek <jakub@redhat.com>
459 * parser.h (struct cp_omp_declare_simd_data): Remove
460 in_omp_attribute_pragma and clauses members, add loc and attribs.
461 (struct cp_oacc_routine_data): Remove loc member, add clauses
463 * parser.c (cp_finalize_omp_declare_simd): New function.
464 (cp_parser_handle_statement_omp_attributes): Mention in
465 function comment the function is used also for
466 attribute-declaration.
467 (cp_parser_handle_directive_omp_attributes): New function.
468 (cp_parser_statement): Don't call
469 cp_parser_handle_statement_omp_attributes if statement doesn't
470 have attribute-specifier-seq at the beginning at all or if
471 if those attributes don't appertain to the statement.
472 (cp_parser_simple_declaration): Call
473 cp_parser_handle_directive_omp_attributes and
474 cp_finalize_omp_declare_simd.
475 (cp_parser_explicit_instantiation): Likewise.
476 (cp_parser_init_declarator): Initialize prefix_attributes
477 only after parsing declarators.
478 (cp_parser_direct_declarator): Call
479 cp_parser_handle_directive_omp_attributes and
480 cp_finalize_omp_declare_simd.
481 (cp_parser_member_declaration): Likewise.
482 (cp_parser_single_declaration): Likewise.
483 (cp_parser_omp_declare_simd): Don't initialize
484 data.in_omp_attribute_pragma, instead initialize
485 data.attribs[0] and data.attribs[1].
486 (cp_finish_omp_declare_variant): Remove
487 in_omp_attribute_pragma argument, instead use
488 parser->lexer->in_omp_attribute_pragma.
489 (cp_parser_late_parsing_omp_declare_simd): Adjust
490 cp_finish_omp_declare_variant caller. Handle attribute-syntax
491 declare simd/variant.
493 2021-08-06 Tamar Christina <tamar.christina@arm.com>
495 * cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
496 * decl.c (cxx_simulate_enum_decl): Likewise.
498 2021-08-04 Jakub Jelinek <jakub@redhat.com>
501 * parser.c (cp_parser_default_argument): Temporarily override
502 parser->omp_declare_simd and parser->oacc_routine to NULL.
504 2021-08-02 Patrick Palka <ppalka@redhat.com>
507 * logic.cc (formula::formula): Use emplace_back instead of
509 (formula::branch): Insert a copy of m_current directly after
510 m_current instead of at the end of the list.
511 (formula::erase): Define.
512 (decompose_formula): Remove.
513 (decompose_antecedents): Remove.
514 (decompose_consequents): Remove.
515 (derive_proofs): Remove.
516 (max_problem_size): Remove.
517 (diagnose_constraint_size): Remove.
518 (subsumes_constraints_nonnull): Rewrite directly in terms of
519 decompose_clause and derive_proof, interleaving decomposition
520 with implication checking. Remove limit on constraint complexity.
521 Use formula::erase to free the current clause before moving on to
524 2021-07-31 Jason Merrill <jason@redhat.com>
527 * decl.c (fixup_anonymous_aggr): Clear TYPE_NEEDS_CONSTRUCTING
530 2021-07-31 Jason Merrill <jason@redhat.com>
532 * ptree.c (cxx_print_type) [TYPE_PACK_EXPANSION]: Also print
533 PACK_EXPANSION_PATTERN.
535 2021-07-31 Jakub Jelinek <jakub@redhat.com>
537 * parser.c (cp_parser_declaration): Handle OpenMP directives
538 in attribute-declaration.
540 2021-07-30 Jakub Jelinek <jakub@redhat.com>
543 * cp-tree.h (enum cp_trait_kind): Add
544 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
545 (enum cp_built_in_function): Add
546 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS.
547 (fold_builtin_is_pointer_inverconvertible_with_class): Declare.
548 * parser.c (cp_parser_primary_expression): Handle
549 RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
550 (cp_parser_trait_expr): Likewise.
551 * cp-objcp-common.c (names_builtin_p): Likewise.
552 * constraint.cc (diagnose_trait_expr): Handle
553 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
554 * decl.c (cxx_init_decl_processing): Register
555 __builtin_is_pointer_interconvertible_with_class builtin.
556 * constexpr.c (cxx_eval_builtin_function_call): Handle
557 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin.
558 * semantics.c (pointer_interconvertible_base_of_p,
559 first_nonstatic_data_member_p,
560 fold_builtin_is_pointer_inverconvertible_with_class): New functions.
561 (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
562 (finish_trait_expr): Likewise. Formatting fix.
563 * cp-gimplify.c (cp_gimplify_expr): Fold
564 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
565 fndecl_built_in_p just once.
567 * tree.c (builtin_valid_in_constant_expr_p): Handle
568 CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call
569 fndecl_built_in_p just once.
570 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
571 CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF.
573 2021-07-30 Jason Merrill <jason@redhat.com>
575 * class.c (finish_struct_anon): Improve comment.
576 * decl.c (fixup_anonymous_aggr): Reject anonymous struct
579 2021-07-30 Jakub Jelinek <jakub@redhat.com>
581 * parser.c (cp_parser_statement): Rollback attributes not just
582 when std_attrs is non-NULL, but whenever
583 cp_parser_std_attribute_spec_seq parsed any tokens.
585 2021-07-30 Jakub Jelinek <jakub@redhat.com>
588 * parser.c (cp_parser_skip_std_attribute_spec_seq): Add a forward
590 (cp_parser_declaration): Parse empty-declaration and
591 attribute-declaration.
592 (cp_parser_toplevel_declaration): Don't parse empty-declaration here.
594 2021-07-28 Martin Sebor <msebor@redhat.com>
596 * init.c: Include new header.
598 2021-07-27 Marek Polacek <polacek@redhat.com>
602 * cp-gimplify.c (cp_fold): Remove {LE,LT,GE,GT_EXPR} from
604 * typeck.c (cp_build_binary_op): Reject ordered comparison
605 of two null pointers.
607 2021-07-26 Jakub Jelinek <jakub@redhat.com>
609 * parser.h (struct cp_lexer): Add orphan_p member.
610 * parser.c (cp_parser_statement): Don't change in_omp_attribute_pragma
611 upon restart from CPP_PRAGMA handling. Fix up condition when a lexer
612 should be destroyed and adjust saved_tokens if it records tokens from
613 the to be destroyed lexer.
614 (cp_parser_omp_section_scan): New function.
615 (cp_parser_omp_scan_loop_body): Use it. If
616 parser->lexer->in_omp_attribute_pragma, allow optional comma
618 (cp_parser_omp_sections_scope): Use cp_parser_omp_section_scan.
620 2021-07-23 Jakub Jelinek <jakub@redhat.com>
622 * parser.h (struct cp_parser): Add omp_attrs_forbidden_p member.
623 * parser.c (cp_parser_handle_statement_omp_attributes): Diagnose
624 mixing of attribute and pragma syntax directives when seeing
625 omp::directive if parser->omp_attrs_forbidden_p or if attribute syntax
626 directives are followed by OpenMP pragma.
627 (cp_parser_statement): Clear parser->omp_attrs_forbidden_p after
628 the cp_parser_handle_statement_omp_attributes call.
629 (cp_parser_omp_structured_block): Add disallow_omp_attrs argument,
630 if true, set parser->omp_attrs_forbidden_p.
631 (cp_parser_omp_scan_loop_body, cp_parser_omp_sections_scope): Pass
632 false as disallow_omp_attrs to cp_parser_omp_structured_block.
633 (cp_parser_omp_parallel, cp_parser_omp_task): Set
634 parser->omp_attrs_forbidden_p.
636 2021-07-21 Thomas Schwinge <thomas@codesourcery.com>
637 Joseph Myers <joseph@codesourcery.com>
638 Cesar Philippidis <cesar@codesourcery.com>
640 * parser.c (cp_parser_omp_clause_name): Handle 'nohost'.
641 (cp_parser_oacc_all_clauses): Handle 'PRAGMA_OACC_CLAUSE_NOHOST'.
642 (OACC_ROUTINE_CLAUSE_MASK): Add 'PRAGMA_OACC_CLAUSE_NOHOST'.
643 * pt.c (tsubst_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
644 * semantics.c (finish_omp_clauses): Likewise.
646 2021-07-21 Jakub Jelinek <jakub@redhat.com>
649 * semantics.c (finish_omp_reduction_clause): Also call
650 complete_type_or_else and return true if it fails.
652 2021-07-19 Iain Sandoe <iain@sandoe.co.uk>
655 * coroutines.cc (struct coroutine_info): Add fields for
656 actor and destroy function decls.
658 (coro_get_ramp_function): New.
659 (coro_get_actor_function): New.
660 (coro_get_destroy_function): New.
661 (act_des_fn): Set up mapping between ramp, actor and
663 (morph_fn_to_coro): Adjust interface to the builder for
664 helper function decls.
665 * cp-tree.h (DECL_ACTOR_FN, DECL_DESTROY_FN, DECL_RAMP_FN,
667 * mangle.c (write_encoding): Handle coroutine helpers.
668 (write_unqualified_name): Handle lambda coroutine helpers.
670 2021-07-16 Patrick Palka <ppalka@redhat.com>
673 * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
674 substituting DECL_ARGUMENTS.
676 2021-07-16 Patrick Palka <ppalka@redhat.com>
680 * search.c (check_final_overrider): Compare TYPE_REF_IS_RVALUE
681 when the return types are references.
683 2021-07-16 Marek Polacek <polacek@redhat.com>
685 * typeck2.c (check_narrowing): Don't suppress the pedantic error
688 2021-07-15 Jakub Jelinek <jakub@redhat.com>
691 * cp-gimplify.c (cp_fold): For comparisons with NULLPTR_TYPE
692 operands, fold them right away to true or false.
694 2021-07-15 Jason Merrill <jason@redhat.com>
697 * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
698 (cp_tree_size): Remove redundant entries.
700 2021-07-14 Patrick Palka <ppalka@redhat.com>
703 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): Remove.
704 * pt.c (push_template_decl): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
706 (redeclare_class_template): Likewise.
707 (forwarding_reference_p): Define.
708 (maybe_adjust_types_for_deduction): Use it instead. Add 'tparms'
710 (unify_one_argument): Pass tparms to
711 maybe_adjust_types_for_deduction.
712 (try_one_overload): Likewise.
714 (rewrite_template_parm): Remove TEMPLATE_TYPE_PARM_FOR_CLASS
717 2021-07-14 Jason Merrill <jason@redhat.com>
719 * class.c (struct find_final_overrider_data): Use auto_vec.
720 (find_final_overrider): Remove explicit release.
721 * coroutines.cc (process_conditional): Use auto_vec.
722 * cp-gimplify.c (struct cp_genericize_data): Use auto_vec.
723 (cp_genericize_tree): Remove explicit release.
724 * parser.c (cp_parser_objc_at_property_declaration): Use
726 * semantics.c (omp_reduction_lookup): Use auto_vec.
728 2021-07-14 Marek Polacek <polacek@redhat.com>
731 * constexpr.c (cxx_eval_array_reference): Create a new .object
732 and .ctor for the non-aggregate non-scalar case too when
735 2021-07-12 Patrick Palka <ppalka@redhat.com>
739 * decl.c (grokfndecl): Don't require that deduction guides are
740 declared at namespace scope. Check that class-scope deduction
741 guides have the same access as the member class template.
742 (grokdeclarator): Pretend class-scope deduction guides are static.
743 * search.c (lookup_member): Don't use a BASELINK for (class-scope)
746 2021-07-10 Patrick Palka <ppalka@redhat.com>
749 * init.c (build_aggr_init): Return error_mark_node if
750 expand_aggr_init_1 returns false.
751 (expand_default_init): Change return type to bool. Return false
752 on error, true on success.
753 (expand_aggr_init_1): Likewise.
755 2021-07-09 Jason Merrill <jason@redhat.com>
758 * decl.c (function_requirements_equivalent_p): Only compare
759 trailing requirements on a specialization.
761 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
763 * coroutines.cc (build_actor_fn): Move common code to
765 (build_destroy_fn): Likewise.
766 (act_des_fn): Build the void return here. Ensure that the
767 source location matches the original function.
769 2021-07-09 Iain Sandoe <iain@sandoe.co.uk>
772 (coro_rewrite_function_body): Connect the replacement
773 function block to the block nest correctly.
775 2021-07-09 Patrick Palka <ppalka@redhat.com>
778 * constraint.cc (tsubst_requires_expr): Pass complain/in_decl to
780 * cp-tree.h (add_extra_args): Add complain/in_decl parameters.
781 * pt.c (build_extra_args): Make a copy of args.
782 (add_extra_args): Add complain/in_decl parameters. Enable the
783 code for handling the case where the extra arguments are
785 (tsubst_pack_expansion): Pass complain/in_decl to
787 (tsubst_template_args): Handle missing template arguments.
788 (tsubst_expr) <case IF_STMT>: Pass complain/in_decl to
791 2021-07-09 Patrick Palka <ppalka@redhat.com>
794 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Just walk the
797 2021-07-08 Martin Sebor <msebor@redhat.com>
800 * module.cc (identifier): Suppress warning.
801 (module_state::read_macro_maps): Remove warning suppression.
802 (module_state::install_macros): Ditto.
804 2021-07-08 Marek Polacek <polacek@redhat.com>
807 * cp-tree.h (unevaluated_p): New.
808 * except.c (check_noexcept_r): Use it. Don't walk into
809 unevaluated operands.
811 2021-07-08 Martin Sebor <msebor@redhat.com>
814 * module.cc (module_state::read_macro_maps): Temporarily disable
816 (module_state::install_macros): Same.
818 2021-07-06 Martin Sebor <msebor@redhat.com>
820 * error.c (cp_printer): Remove support for %G and %K.
822 2021-07-02 Jakub Jelinek <jakub@redhat.com>
824 * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member.
825 (struct cp_omp_declare_simd_data): Likewise.
826 * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER.
827 (omp_identifier): Define.
828 * parser.c (cp_parser_skip_to_pragma_eol): Handle
829 in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF.
830 (cp_parser_require_pragma_eol): Likewise.
831 (struct cp_omp_attribute_data): New type.
832 (cp_parser_handle_statement_omp_attributes): New function.
833 (cp_parser_statement): Handle OpenMP directives in statement's
834 attribute-specifier-seq.
835 (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New
837 (cp_parser_std_attribute): Handle omp::directive and omp::sequence
839 (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow
840 a comma also before the first clause.
841 (cp_parser_omp_allocate): Likewise.
842 (cp_parser_omp_atomic): Likewise.
843 (cp_parser_omp_depobj): Likewise.
844 (cp_parser_omp_flush): Likewise.
845 (cp_parser_omp_ordered): Likewise.
846 (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma
847 into struct cp_omp_declare_simd_data.
848 (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma
849 argument. If set, allow a comma also before match clause.
850 (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma,
851 allow a comma also before the first clause. Adjust
852 cp_finish_omp_declare_variant caller.
853 (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow
854 a comma also before the first clause.
855 (cp_parser_omp_declare_reduction_exprs): Likewise.
856 (cp_parser_omp_requires): Likewise.
857 * decl.c (initialize_predefined_identifiers): Initialize
859 * decl2.c (cplus_decl_attributes): Reject omp::directive and
860 omp::sequence attributes.
862 2021-07-02 Jakub Jelinek <jakub@redhat.com>
865 * parser.c (cp_parser_omp_atomic): Consume comma only if it
866 appears before a CPP_NAME.
868 2021-07-02 Patrick Palka <ppalka@redhat.com>
871 * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to
872 use common_enclosing_class and to not depend on the TREE_TYPE
873 of outer levels pointing to the corresponding primary template.
875 2021-07-01 Patrick Palka <ppalka@redhat.com>
878 * constexpr.c (cxx_eval_array_reference): When the element type
879 is an empty type and the corresponding element is omitted, just
880 return an empty CONSTRUCTOR instead of attempting value
883 2021-07-01 Patrick Palka <ppalka@redhat.com>
886 * pt.c (finish_template_variable): Pass the partially
887 instantiated template and its args to instantiate_template.
888 (instantiate_class_template_1): No need to call
889 push_nested_class and pop_nested_class around the call to
890 most_specialized_partial_spec.
891 (instantiate_template_1): Pass the partially instantiated
892 template to lookup_template_variable.
893 (most_specialized_partial_spec): Use push_access_scope_guard
894 to set the access scope appropriately. Use
895 deferring_access_check_sentinel to force access to get checked
897 (instantiate_decl): Just pass the VAR_DECL to
898 most_specialized_partial_spec.
900 2021-06-30 Patrick Palka <ppalka@redhat.com>
902 * constraint.cc (get_normalized_constraints_from_decl): Use
903 push_access_scope_guard instead of push_nested_class_guard.
904 * cp-tree.h (struct push_nested_class_guard): Replace with ...
905 (struct push_access_scope_guard): ... this.
906 * pt.c (push_access_scope): When the argument corresponds to
907 a class type, push the class instead of its context.
908 (pop_access_scope): Adjust accordingly.
910 2021-06-30 Marek Polacek <polacek@redhat.com>
914 * decl.c (create_array_type_for_decl): Allow array of auto.
916 2021-06-29 Jason Merrill <jason@redhat.com>
918 * pt.c (instantiate_decl): Only consider partial specializations of
919 actual variable templates.
921 2021-06-26 Patrick Palka <ppalka@redhat.com>
924 * pt.c (instantiate_class_template_1): Enter the scope of the
925 type when calling most_specialized_partial_spec.
927 2021-06-26 Jason Merrill <jason@redhat.com>
931 * class.c (is_empty_field): Handle null argument.
932 * constexpr.c (cxx_eval_bare_aggregate): Discard initializer
935 2021-06-26 Marek Polacek <polacek@redhat.com>
938 * parser.c (cp_parser_declarator): Pass flags down to
939 cp_parser_declarator. Also pass static_p/member_p.
941 2021-06-25 Martin Sebor <msebor@redhat.com>
943 * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING
944 with warning_suppressed_p, suppress_warning, and copy_no_warning, or
945 nothing if not necessary.
946 (set_up_extended_ref_temp): Same.
947 * class.c (layout_class_type): Same.
948 * constraint.cc (constraint_satisfaction_value): Same.
949 * coroutines.cc (finish_co_await_expr): Same.
950 (finish_co_yield_expr): Same.
951 (finish_co_return_stmt): Same.
952 (build_actor_fn): Same.
953 (coro_rewrite_function_body): Same.
954 (morph_fn_to_coro): Same.
955 * cp-gimplify.c (genericize_eh_spec_block): Same.
956 (gimplify_expr_stmt): Same.
957 (cp_genericize_r): Same.
959 * cp-ubsan.c (cp_ubsan_instrument_vptr): Same.
960 * cvt.c (cp_fold_convert): Same.
961 (convert_to_void): Same.
962 * decl.c (wrapup_namespace_globals): Same.
963 (grokdeclarator): Same.
964 (finish_function): Same.
965 (require_deduced_type): Same.
966 * decl2.c (no_linkage_error): Same.
967 (c_parse_final_cleanups): Same.
968 * except.c (expand_end_catch_block): Same.
969 * init.c (build_new_1): Same.
971 (build_vec_delete_1): Same.
972 (build_vec_init): Same.
973 (build_delete): Same.
974 * method.c (defaultable_fn_check): Same.
975 * parser.c (cp_parser_fold_expression): Same.
976 (cp_parser_primary_expression): Same.
977 * pt.c (push_tinst_level_loc): Same.
979 (tsubst_omp_udr): Same.
980 (tsubst_copy_and_build): Same.
981 * rtti.c (build_if_nonnull): Same.
982 * semantics.c (maybe_convert_cond): Same.
983 (finish_return_stmt): Same.
984 (finish_parenthesized_expr): Same.
985 (cp_check_omp_declare_reduction): Same.
986 * tree.c (build_cplus_array_type): Same.
987 * typeck.c (build_ptrmemfunc_access_expr): Same.
988 (cp_build_indirect_ref_1): Same.
989 (cp_build_function_call_vec): Same.
990 (warn_for_null_address): Same.
991 (cp_build_binary_op): Same.
992 (unary_complex_lvalue): Same.
993 (cp_build_modify_expr): Same.
994 (build_x_modify_expr): Same.
995 (convert_for_assignment): Same.
997 2021-06-24 Patrick Palka <ppalka@redhat.com>
1000 * pt.c (maybe_aggr_guide): Handle alias templates appropriately.
1002 2021-06-24 Patrick Palka <ppalka@redhat.com>
1005 * constraint.cc (evaluate_requires_expr): Adjust function comment.
1006 * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
1007 (cp_fold) <case REQUIRES_EXPR>: ... here.
1009 2021-06-24 Jakub Jelinek <jakub@redhat.com>
1011 * parser.c (cp_omp_split_clauses): Pass C_ORT_OMP_TARGET instead of
1012 C_ORT_OMP for clauses on target construct.
1013 (OMP_TARGET_CLAUSE_MASK): Add in_reduction clause.
1014 (cp_parser_omp_target): For non-combined target add
1015 map (always, tofrom:) clauses for OMP_CLAUSE_IN_REDUCTION. Pass
1016 C_ORT_OMP_TARGET to finish_omp_clauses.
1017 * semantics.c (handle_omp_array_sections_1): Adjust ort handling
1018 for addition of C_ORT_OMP_TARGET and simplify, mapping clauses are
1019 never present on C_ORT_*DECLARE_SIMD.
1020 (handle_omp_array_sections): Likewise.
1021 (finish_omp_clauses): Likewise. Handle OMP_CLAUSE_IN_REDUCTION
1022 on C_ORT_OMP_TARGET, set OMP_CLAUSE_MAP_IN_REDUCTION on
1023 corresponding map clauses.
1024 * pt.c (tsubst_expr): Pass C_ORT_OMP_TARGET instead of C_ORT_OMP for
1025 clauses on target construct.
1027 2021-06-23 Patrick Palka <ppalka@redhat.com>
1030 * pt.c (push_access_scope): For artificial deduction guides,
1031 set the access scope to that of the constructor.
1032 (pop_access_scope): Likewise.
1033 (build_deduction_guide): Don't set DECL_CONTEXT on the guide.
1035 2021-06-23 Patrick Palka <ppalka@redhat.com>
1038 * call.c (print_error_for_call_failure): Constify 'args' parameter.
1039 (perform_dguide_overload_resolution): Define.
1040 * cp-tree.h: (perform_dguide_overload_resolution): Declare.
1041 * pt.c (do_class_deduction): Use perform_dguide_overload_resolution
1042 instead of build_new_function_call. Don't use tf_decltype or
1043 set cp_unevaluated_operand. Remove unnecessary NULL_TREE tests.
1045 2021-06-21 Patrick Palka <ppalka@redhat.com>
1048 * typeck.c (check_return_expr): Call maybe_undo_parenthesized_ref
1049 sooner, before the NRVO handling.
1051 2021-06-21 Patrick Palka <ppalka@redhat.com>
1054 * tree.c (bot_replace): Use convert_to_base to build the
1055 conversion to the (morally) virtual base.
1057 2021-06-21 Jakub Jelinek <jakub@redhat.com>
1059 PR inline-asm/100785
1060 * typeck.c (cxx_mark_addressable): Diagnose trying to make
1061 bit-fields addressable.
1063 2021-06-17 Jason Merrill <jason@redhat.com>
1066 * decl.c (duplicate_decls): Make 'deleted after first declaration'
1067 pedwarn on by default.
1069 2021-06-17 Jason Merrill <jason@redhat.com>
1072 * init.c (build_vec_init): Preserve the type of base.
1074 2021-06-16 Jason Merrill <jason@redhat.com>
1078 * pt.c (tsubst_baselink): Update binfos in non-dependent case.
1080 2021-06-15 Robin Dapp <rdapp@linux.ibm.com>
1082 * decl.c (duplicate_decls): Likewise.
1084 2021-06-14 Tobias Burnus <tobias@codesourcery.com>
1087 * parser.c (cp_parser_omp_clause_affinity): No need to set iterator
1088 var in the error case.
1090 2021-06-13 Trevor Saunders <tbsaunde@tbsaunde.org>
1092 * constexpr.c (cxx_eval_call_expression): Iterate over vec<>
1093 with range based for.
1094 (cxx_eval_store_expression): Likewise.
1095 (cxx_eval_loop_expr): Likewise.
1096 * decl.c (wrapup_namespace_globals): Likewise.
1097 (cp_finish_decl): Likewise.
1098 (cxx_simulate_enum_decl): Likewise.
1099 * parser.c (cp_parser_postfix_expression): Likewise.
1101 2021-06-12 Jason Merrill <jason@redhat.com>
1104 * init.c (build_vec_init): Shortcut [0] case.
1106 2021-06-12 Jason Merrill <jason@redhat.com>
1108 * pt.c (lookup_template_class_1): Shortcut current_class_type.
1110 2021-06-11 Patrick Palka <ppalka@redhat.com>
1114 * pt.c (tsubst_arg_types): Rearrange so that we substitute into
1115 TYPE_ARG_TYPES in forward order while short circuiting
1116 appropriately. Adjust formatting.
1118 2021-06-11 Jakub Jelinek <jakub@redhat.com>
1121 * cp-tree.h (struct saved_scope): Add consteval_if_p
1122 member. Formatting fix for the discarded_stmt comment.
1123 (in_consteval_if_p, IF_STMT_CONSTEVAL_P): Define.
1124 * parser.c (cp_parser_lambda_expression): Temporarily disable
1125 in_consteval_if_p when parsing lambda body.
1126 (cp_parser_selection_statement): Parse consteval if.
1127 * decl.c (struct named_label_entry): Add in_consteval_if member.
1128 (level_for_consteval_if): New function.
1129 (poplevel_named_label_1, check_previous_goto_1, check_goto): Handle
1131 * constexpr.c (cxx_eval_builtin_function_call): Clarify in comment
1132 why CP_BUILT_IN_IS_CONSTANT_EVALUATED needs to *non_constant_p
1133 for !ctx->manifestly_const_eval.
1134 (cxx_eval_conditional_expression): For IF_STMT_CONSTEVAL_P evaluate
1135 condition as if it was __builtin_is_constant_evaluated call.
1136 (potential_constant_expression_1): For IF_STMT_CONSTEVAL_P always
1137 recurse on both branches.
1138 * cp-gimplify.c (genericize_if_stmt): Genericize IF_STMT_CONSTEVAL_P
1140 * pt.c (tsubst_expr) <case IF_STMT>: Copy IF_STMT_CONSTEVAL_P.
1141 Temporarily set in_consteval_if_p when recursing on
1142 IF_STMT_CONSTEVAL_P then branch.
1143 (tsubst_lambda_expr): Temporarily disable
1144 in_consteval_if_p when instantiating lambda body.
1145 * call.c (immediate_invocation_p): Return false when
1148 2021-06-11 Marek Polacek <polacek@redhat.com>
1151 * constexpr.c (maybe_constexpr_fn): New.
1152 * cp-tree.h (maybe_constexpr_fn): Declare.
1153 * semantics.c (find_std_constant_evaluated_r): New.
1154 (maybe_warn_for_constant_evaluated): New.
1155 (finish_if_stmt_cond): Call it.
1157 2021-06-10 Patrick Palka <ppalka@redhat.com>
1160 * pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
1161 the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
1162 a template template parameter, adjust to the
1163 TEMPLATE_TEMPLATE_PARAMETER before falling through.
1165 2021-06-10 Patrick Palka <ppalka@redhat.com>
1168 * constraint.cc (normalize_placeholder_type_constraints): When
1169 normalizing a non-templated return-type-requirement, add a dummy
1170 level to initial_parms.
1172 2021-06-08 Marek Polacek <polacek@redhat.com>
1175 * decl.c (grokdeclarator): Store a value-dependent
1176 explicit-specifier even for deduction guides.
1178 2021-06-08 Jason Merrill <jason@redhat.com>
1180 * parser.c (cp_parser_string_literal): Adjust diagnostic.
1182 2021-06-08 Jason Merrill <jason@redhat.com>
1185 * call.c (perfect_conversion_p): Check check_narrowing.
1187 2021-06-08 Jason Merrill <jason@redhat.com>
1190 * name-lookup.c (get_class_binding): Keep a BASELINK.
1191 (set_inherited_value_binding_p): Adjust.
1192 * lambda.c (is_lambda_ignored_entity): Adjust.
1193 * pt.c (lookup_template_function): Copy a BASELINK before
1196 2021-06-08 Jason Merrill <jason@redhat.com>
1199 * semantics.c (baselink_for_fns): Fix BASELINK_BINFO.
1201 2021-06-08 Jason Merrill <jason@redhat.com>
1203 * module.cc (duplicate_hash::hash): Comment out.
1204 (trees_in::tree_value): Adjust loop counter.
1206 2021-06-08 Jason Merrill <jason@redhat.com>
1209 * init.c (build_offset_ref): Return the BASELINK for a static
1212 2021-06-07 Patrick Palka <ppalka@redhat.com>
1215 * parser.c (cp_parser_lookup_name): Check access of the lookup
1216 result before we potentially adjust an injected-class-name to
1219 2021-06-06 Jakub Jelinek <jakub@redhat.com>
1222 * parser.c (cp_parser_omp_target): Call c_omp_adjust_map_clauses
1223 even when target is combined with other constructs.
1225 2021-06-04 Patrick Palka <ppalka@redhat.com>
1228 * pt.c (convert_template_argument): Strip top-level cv-quals
1229 on the substituted type of a non-type template parameter.
1231 2021-06-04 Patrick Palka <ppalka@redhat.com>
1234 * pt.c (tsubst_function_decl): Remove old code for reducing
1235 args when it has excess levels.
1237 2021-06-04 Jakub Jelinek <jakub@redhat.com>
1240 * name-lookup.c (maybe_save_operator_binding): Add op_attr after all
1241 ATTR_IS_DEPENDENT attributes in the DECL_ATTRIBUTES list rather than
1244 2021-06-03 Patrick Palka <ppalka@redhat.com>
1247 * decl.c (make_typename_type): After calling
1248 lookup_template_class, adjust the result to its TYPE_NAME and
1249 then consider the tf_keep_type_decl flag.
1251 2021-06-03 Patrick Palka <ppalka@redhat.com>
1254 * pt.c (set_current_access_from_decl): Move to ...
1255 * class.c (set_current_access_from_decl): ... here.
1256 (handle_using_decl): Use it to propagate the access of the
1257 using-enum decl to the copy of the imported enumerator.
1258 * cp-tree.h (set_current_access_from_decl): Declare.
1259 * decl.c (build_enumerator): Simplify using make_temp_override
1260 and set_current_access_from_decl.
1262 2021-06-03 Jakub Jelinek <jakub@redhat.com>
1265 * semantics.c (handle_omp_array_sections_1): For
1266 OMP_CLAUSE_{AFFINITY,DEPEND} handle FIELD_DECL base using
1267 finish_non_static_data_member and allow this as base.
1268 (finish_omp_clauses): Move OMP_CLAUSE_AFFINITY
1269 after depend only cases. Let this be diagnosed by !lvalue_p
1270 case for OMP_CLAUSE_{AFFINITY,DEPEND} and remove useless
1272 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_AFFINITY.
1274 2021-06-02 Jason Merrill <jason@redhat.com>
1277 * call.c (convert_like_internal): Clear tf_no_cleanup when
1279 (build_user_type_conversion_1): Only add ck_rvalue if
1280 LOOKUP_ONLYCONVERTING.
1282 2021-06-01 Patrick Palka <ppalka@redhat.com>
1285 * init.c (expand_aggr_init_1): Check
1286 type_has_non_user_provided_default_constructor instead of
1287 type_has_user_provided_constructor.
1289 2021-06-01 Jason Merrill <jason@redhat.com>
1292 * call.c (build_op_delete_call): Don't set CALL_FROM_NEW_OR_DELETE_P
1293 for destroying delete.
1294 * init.c (build_delete): Don't clobber before destroying delete.
1296 2021-06-01 Jason Merrill <jason@redhat.com>
1299 * decl2.c (cp_warn_deprecated_use): Check warning_enabled_at.
1301 2021-05-31 Richard Biener <rguenther@suse.de>
1304 * cp-objcp-common.c (names_builtin_p): Handle
1305 RID_BUILTIN_SHUFFLEVECTOR.
1306 * cp-tree.h (build_x_shufflevector): Declare.
1307 * parser.c (cp_parser_postfix_expression): Handle
1308 RID_BUILTIN_SHUFFLEVECTOR.
1309 * pt.c (tsubst_copy_and_build): Handle IFN_SHUFFLEVECTOR.
1310 * typeck.c (build_x_shufflevector): Build either a lowered
1311 VEC_PERM_EXPR or an unlowered shufflevector via a temporary
1312 internal function IFN_SHUFFLEVECTOR.
1314 2021-05-28 Jason Merrill <jason@redhat.com>
1316 * constexpr.c (build_data_member_initialization): Use tsi_range.
1317 (build_constexpr_constructor_member_initializers): Likewise.
1318 (constexpr_fn_retval, cxx_eval_statement_list): Likewise.
1319 (potential_constant_expression_1): Likewise.
1320 * coroutines.cc (await_statement_expander): Likewise.
1321 (await_statement_walker): Likewise.
1322 * module.cc (trees_out::core_vals): Likewise.
1323 * pt.c (tsubst_expr): Likewise.
1324 * semantics.c (set_cleanup_locs): Likewise.
1326 2021-05-28 Jason Merrill <jason@redhat.com>
1330 * call.c (build_over_call): Adjust base_binfo in
1331 resolves_to_fixed_type_p case.
1333 2021-05-28 Jakub Jelinek <jakub@redhat.com>
1336 * semantics.c (handle_omp_array_sections): Copy
1337 OMP_CLAUSE_MAP_IMPLICIT.
1338 (finish_omp_clauses): Move not just OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
1339 marked clauses last, but also OMP_CLAUSE_MAP_IMPLICIT. Add
1340 map_firstprivate_head bitmap, set it for GOMP_MAP_FIRSTPRIVATE_POINTER
1341 maps and silently remove OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT if it is
1342 present too. For OMP_CLAUSE_MAP_IMPLICIT silently remove the clause
1343 if present in map_head, map_field_head or map_firstprivate_head
1346 2021-05-28 Tobias Burnus <tobias@codesourcery.com>
1348 * parser.c (cp_parser_omp_clause_affinity): New.
1349 (cp_parser_omp_clause_name, cp_parser_omp_var_list_no_open,
1350 cp_parser_omp_all_clauses, OMP_TASK_CLAUSE_MASK): Handle affinity
1352 * semantics.c (handle_omp_array_sections_1, handle_omp_array_sections,
1353 finish_omp_clauses): Likewise.
1355 2021-05-27 Matthias Kretz <kretz@kde.org>
1358 * error.c (dump_template_bindings): Include code to print
1359 "[with" and ']', conditional on whether anything is printed at
1360 all. This is tied to whether a semicolon is needed to separate
1361 multiple template parameters. If the template argument repeats
1362 the template parameter (T = T), then skip the parameter.
1363 (dump_substitution): Moved code to print "[with" and ']' to
1364 dump_template_bindings.
1365 (dump_function_decl): Partial revert of PR50828, which masked
1366 TFF_TEMPLATE_NAME for all of dump_function_decl. Now
1367 TFF_TEMPLATE_NAME is masked for the scope of the function and
1368 only carries through to dump_function_name.
1369 (dump_function_name): Avoid calling dump_template_parms if
1370 TFF_TEMPLATE_NAME is set.
1372 2021-05-27 Matthias Kretz <kretz@kde.org>
1375 * error.c: Call dump_scope when printing a typedef.
1377 2021-05-27 Patrick Palka <ppalka@redhat.com>
1380 * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case.
1382 2021-05-27 Jason Merrill <jason@redhat.com>
1385 * pt.c (use_pack_expansion_extra_args_p): Don't compare
1386 args from the same argument pack.
1388 2021-05-27 Patrick Palka <ppalka@redhat.com>
1393 * pt.c (process_partial_specialization): Don't error on a
1394 non-simple non-type template argument that involves template
1396 (for_each_template_parm_r): Don't walk TRAIT_EXPR, PLUS_EXPR,
1397 MULT_EXPR, or SCOPE_REF when include_nondeduced_p is false.
1399 2021-05-26 Patrick Palka <ppalka@redhat.com>
1402 * typeck.c (finish_class_member_access_expr): Disable ahead
1403 of time access checking during the member lookup.
1405 2021-05-26 Patrick Palka <ppalka@redhat.com>
1408 * tree.c (build_target_expr_with_type): Don't call force_rvalue
1409 on CALL_EXPR initializer. Simplify now that bot_manip is no
1411 (bot_manip): Use force_target_expr instead of
1412 build_target_expr_with_type.
1414 2021-05-26 Patrick Palka <ppalka@redhat.com>
1417 * cvt.c (noexcept_conv_p): Remove redundant checks and simplify.
1418 (fnptr_conv_p): Don't call non_reference. Use INDIRECT_TYPE_P
1419 instead of TYPE_PTR_P.
1420 * pt.c (convert_nontype_argument_function): Look through
1421 implicit INDIRECT_REFs before calling strip_fnptr_conv.
1423 2021-05-25 Jakub Jelinek <jakub@redhat.com>
1426 * call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
1427 and side-effects, temporarily disable -Wunused-result warning when
1428 building COMPOUND_EXPR.
1430 2021-05-21 Jakub Jelinek <jakub@redhat.com>
1433 * semantics.c (finish_omp_clauses): Move firstprivate clauses with
1434 OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
1435 if a decl is mentioned both in map clause and in such firstprivate
1436 clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
1438 2021-05-20 Jason Merrill <jason@redhat.com>
1440 * call.c (reference_binding): Check for designator.
1441 (implicit_conversion_1, build_special_member_call): Likewise.
1442 * decl.c (reshape_init_r): Likewise.
1443 * pt.c (do_class_deduction): Likewise.
1444 * typeck2.c (digest_init_r): Likewise.
1446 2021-05-20 Jason Merrill <jason@redhat.com>
1449 * decl.c (reshape_init_class): Handle designator for
1450 member of anonymous aggregate here.
1451 * typeck2.c (process_init_constructor_record): Not here.
1453 2021-05-20 Jonathan Wakely <jwakely@redhat.com>
1455 * call.c (maybe_warn_array_conv): Use new warning option.
1456 * decl.c (mark_inline_variable, grokdeclarator): Likewise.
1457 * error.c (maybe_warn_cpp0x): Likewise.
1458 * parser.c (cp_parser_primary_expression)
1459 (cp_parser_unqualified_id)
1460 (cp_parser_pseudo_destructor_name)
1461 (cp_parser_lambda_introducer)
1462 (cp_parser_lambda_declarator_opt)
1463 (cp_parser_selection_statement)
1464 (cp_parser_init_statement)
1465 (cp_parser_decomposition_declaration)
1466 (cp_parser_function_specifier_opt)
1467 (cp_parser_static_assert)
1468 (cp_parser_namespace_definition)
1469 (cp_parser_using_declaration)
1470 (cp_parser_asm_definition)
1471 (cp_parser_ctor_initializer_opt_and_function_body)
1472 (cp_parser_initializer_list)
1473 (cp_parser_type_parameter_key)
1474 (cp_parser_member_declaration)
1475 (cp_parser_try_block)
1476 (cp_parser_std_attribute_spec): Likewise.
1477 * pt.c (check_template_variable): Likewise.
1479 2021-05-20 Jason Merrill <jason@redhat.com>
1482 * pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
1484 2021-05-20 Jason Merrill <jason@redhat.com>
1487 * cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
1489 2021-05-19 Jason Merrill <jason@redhat.com>
1493 * method.c (genericize_spaceship): Use fold_build2 for scalar
1496 2021-05-19 Jason Merrill <jason@redhat.com>
1498 * pt.c (build_deduction_guide): Treat the implicit deduction guide
1499 as a member of the class.
1501 2021-05-19 Marek Polacek <polacek@redhat.com>
1504 * cp-tree.h (any_non_type_attribute_p): Remove.
1505 * decl.c (grokdeclarator): Turn an error into a warning and only
1506 warn for standard attributes.
1507 * decl2.c (any_non_type_attribute_p): Remove.
1508 * parser.c (cp_parser_elaborated_type_specifier): Turn an error
1509 into a warning and only warn for standard attributes.
1510 (cp_parser_member_declaration): Likewise.
1512 2021-05-19 Martin Liska <mliska@suse.cz>
1515 * mangle.c (write_encoding): Fix typos.
1517 2021-05-19 Jakub Jelinek <jakub@redhat.com>
1520 * parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
1521 master when combined with taskloop.
1522 (cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
1523 parallel master when not combined with taskloop.
1525 2021-05-19 Jason Merrill <jason@redhat.com>
1528 * rtti.c (get_tinfo_decl_direct): Check TYPE_TRANSPARENT_AGGR.
1530 2021-05-19 Jason Merrill <jason@redhat.com>
1533 * tree.c (strip_typedefs): Only look at the pattern of a
1534 TYPE_PACK_EXPANSION if it's a type.
1536 2021-05-18 Marek Polacek <polacek@redhat.com>
1538 * class.c (classtype_has_non_deleted_copy_ctor): Remove.
1539 * constraint.cc (contains_wildcard_p): Likewise.
1540 (get_template_head_requirements): Likewise.
1541 (check_constrained_friend): Likewise.
1542 (subsumes_constraints): Likewise.
1543 * cp-tree.h (classtype_has_non_deleted_copy_ctor): Likewise.
1544 (push_void_library_fn): Likewise.
1545 (get_pattern_parm): Likewise.
1546 (get_template_parms_at_level): Likewise.
1547 (lambda_return_type): Likewise.
1548 (get_template_head_requirements): Likewise.
1549 (check_constrained_friend): Likewise.
1550 (subsumes_constraints): Likewise.
1551 * decl.c (push_void_library_fn): Likewise.
1552 * lambda.c (lambda_return_type): Likewise.
1553 * pt.c (get_template_parms_at_level): Likewise.
1554 (get_pattern_parm): Likewise.
1556 2021-05-18 Jason Merrill <jason@redhat.com>
1559 * call.c (perfect_candidate_p): An implicitly deleted move
1562 2021-05-18 Andreas Krebbel <krebbel@linux.ibm.com>
1565 * cvt.c (cp_convert_to_pointer): Use the size of the target
1567 * tree.c (cp_build_reference_type): Call
1568 cp_build_reference_type_for_mode with VOIDmode.
1569 (cp_build_reference_type_for_mode): Rename from
1570 cp_build_reference_type. Add MODE argument and invoke
1571 build_reference_type_for_mode.
1572 (strip_typedefs): Use build_pointer_type_for_mode and
1573 cp_build_reference_type_for_mode for pointers and references.
1575 2021-05-17 Jonathan Wakely <jwakely@redhat.com>
1578 * call.c (convert_like_internal): Print different diagnostic if
1579 the lvalue reference is const.
1581 2021-05-14 Jason Merrill <jason@redhat.com>
1584 * pt.c (enclosing_instantiation_of): Just compare
1585 DECL_SOURCE_LOCATION.
1586 (regenerate_decl_from_template): Copy DECL_SOURCE_LOCATION.
1588 2021-05-14 Marek Polacek <polacek@redhat.com>
1589 Jason Merrill <jason@redhat.com>
1592 * cp-tree.h (any_non_type_attribute_p): Declare.
1593 * decl.c (grokdeclarator): Diagnose when an attribute appertains to
1594 a friend declaration that is not a definition.
1595 * decl2.c (any_non_type_attribute_p): New.
1596 * parser.c (cp_parser_decl_specifier_seq): Diagnose standard attributes
1597 in the middle of decl-specifiers.
1598 (cp_parser_elaborated_type_specifier): Diagnose when an attribute
1599 appertains to a friend declaration that is not a definition.
1600 (cp_parser_member_declaration): Likewise.
1602 2021-05-12 Marek Polacek <polacek@redhat.com>
1604 * pt.c (tsubst_copy_and_build): Add warn_int_in_bool_context
1607 2021-05-12 Marcel Vollweiler <marcel@codesourcery.com>
1609 * parser.c (cp_parser_omp_clause_map): Support map-type-modifier
1612 2021-05-11 Jason Merrill <jason@redhat.com>
1615 * typeck.c (build_reinterpret_cast_1): Check intype on
1618 2021-05-11 Patrick Palka <ppalka@redhat.com>
1621 * name-lookup.c (maybe_save_operator_binding): Unconditionally
1622 enable for all function templates, not just generic lambdas.
1623 Handle compound-assignment operator expressions.
1624 * typeck.c (build_x_compound_expr): Call maybe_save_operator_binding
1625 in the type-dependent case.
1626 (build_x_modify_expr): Likewise. Move declaration of 'op' closer
1629 2021-05-11 Patrick Palka <ppalka@redhat.com>
1632 * constraint.cc (tsubst_constraint): Set up cp_unevaluated.
1633 (satisfy_atom): Set up iloc_sentinel before calling
1635 * pt.c (tsubst_pack_expansion): When returning a rebuilt pack
1636 expansion, carry over PACK_EXPANSION_LOCAL_P and
1637 PACK_EXPANSION_SIZEOF_P from the original pack expansion.
1639 2021-05-10 Richard Biener <rguenther@suse.de>
1641 PR middle-end/100464
1643 * call.c (set_up_extended_ref_temp): Mark the temporary
1644 addressable if the TARGET_EXPR was.
1646 2021-05-10 Martin Liska <mliska@suse.cz>
1648 * decl.c (duplicate_decls): Use startswith
1649 function instead of strncmp.
1650 (cxx_builtin_function): Likewise.
1651 (omp_declare_variant_finalize_one): Likewise.
1652 (grokfndecl): Likewise.
1653 * error.c (dump_decl_name): Likewise.
1654 * mangle.c (find_decomp_unqualified_name): Likewise.
1655 (write_guarded_var_name): Likewise.
1656 (decl_tls_wrapper_p): Likewise.
1657 * parser.c (cp_parser_simple_type_specifier): Likewise.
1658 (cp_parser_tx_qualifier_opt): Likewise.
1659 * pt.c (template_parm_object_p): Likewise.
1660 (dguide_name_p): Likewise.
1662 2021-05-10 Martin Liska <mliska@suse.cz>
1665 * decl.c (grokdeclarator): Remove redundant NULL check.
1667 2021-05-07 Jason Merrill <jason@redhat.com>
1669 * tree.c (rvalue): Assert expr is not a class lvalue.
1671 2021-05-07 Jason Merrill <jason@redhat.com>
1673 * cp-tree.h (build_stub_object): Declare.
1674 * method.c (build_stub_object): No longer static.
1675 * call.c (can_convert): Use it.
1676 * tree.c (build_dummy_object): Adjust comment.
1677 * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
1680 2021-05-07 Jason Merrill <jason@redhat.com>
1682 * coroutines.cc (build_co_await): Don't call 'rvalue'.
1683 (flatten_await_stmt): Simplify initialization.
1684 (morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
1686 2021-05-04 Tobias Burnus <tobias@codesourcery.com>
1688 * semantics.c (finish_omp_reduction_clause): Accept float + complex
1689 for || and && reductions.
1691 2021-05-03 Patrick Palka <ppalka@redhat.com>
1694 * parser.c (cp_parser_class_head): Reinstate calls to pushclass
1695 and popclass when parsing the base-clause that were removed in
1698 2021-05-03 Patrick Palka <ppalka@redhat.com>
1702 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
1703 only when the callee is a FUNCTION_DECL.
1705 2021-05-03 Marek Polacek <polacek@redhat.com>
1708 * decl.c (grokfndecl): Check current_template_parms.
1710 2021-05-03 Marek Polacek <polacek@redhat.com>
1713 * constexpr.c (cxx_eval_constant_expression): Don't check
1716 2021-05-01 Jason Merrill <jason@redhat.com>
1718 * cp-tree.h (class ovl_iterator): Allow copying. Add op==.
1719 (class ovl_range, class lkp_range): New.
1720 * call.c (build_op_call_1, add_candidates): Use them.
1721 (build_op_delete_call, has_trivial_copy_assign_p): Likewise.
1722 (has_trivial_copy_p): Likewise.
1723 * class.c (handle_using_decl, get_basefndecls): Likewise.
1724 (maybe_warn_about_overly_private_class): Likewise.
1725 (warn_hidden, add_implicitly_declared_members): Likewise.
1726 (check_methods, clone_constructors_and_destructors): Likewise.
1727 (type_has_user_nondefault_constructor): Likewise.
1729 2021-04-29 Jason Merrill <jason@redhat.com>
1731 * constexpr.c (cxx_fold_indirect_ref_1): Only set *empty_base if we
1734 2021-04-29 Jason Merrill <jason@redhat.com>
1737 * decl2.c (grokfield): Call cplus_decl_attributes for friend.
1738 (save_template_attributes): Use chainon.
1739 * friend.c (do_friend): Remove attrlist parm.
1740 * cp-tree.h (do_friend): Adjust.
1741 * class.c (add_implicitly_declared_members): Adjust.
1742 * decl.c (grokdeclarator): Adjust.
1743 * pt.c (apply_late_template_attributes): Optimize.
1745 2021-04-29 Jason Merrill <jason@redhat.com>
1748 * class.c (finish_struct_anon_r): Drop complain parm.
1749 Remove non-field diagnostic.
1750 (finish_struct_anon): Adjust.
1751 * decl.c (fixup_anonymous_aggr): Move non-field diagnostic here.
1753 2021-04-29 Jason Merrill <jason@redhat.com>
1755 * cp-tree.h (cp_evaluated): Add reset parm to constructor.
1756 * parser.c (cp_parser_constant_expression): Change
1757 allow_non_constant_p to int. Use cp_evaluated.
1758 (cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
1759 * semantics.c (finish_id_expression_1): Don't mess with
1760 cp_unevaluated_operand here.
1762 2021-04-29 Jason Merrill <jason@redhat.com>
1764 * cp-tree.h: Clarify comments.
1765 * pt.c (get_template_parm_object): Add assert.
1766 * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR.
1767 * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR.
1768 * typeck2.c (store_init_value): Likewise.
1770 2021-04-29 Patrick Palka <ppalka@redhat.com>
1773 * pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
1774 set tf_conv during the initial substitution into the function.
1776 2021-04-29 Jakub Jelinek <jakub@redhat.com>
1779 * semantics.c (finish_omp_clauses): Fix up check that variable
1780 mentioned in detach clause doesn't appear in data-sharing clauses.
1782 2021-04-28 Jakub Jelinek <jakub@redhat.com>
1784 * module.cc: Remove #error that triggers if DEV-PHASE is empty.
1786 2021-04-27 Jason Merrill <jason@redhat.com>
1789 * class.c (classtype_has_depr_implicit_copy): Check DECL_CONTEXT
1792 2021-04-27 Patrick Palka <ppalka@redhat.com>
1795 * pt.c (tsubst_initializer_list): Correctly handle the case
1796 where an argument inside a base initializer pack expansion is
1797 itself a pack expansion.
1799 2021-04-26 Patrick Palka <ppalka@redhat.com>
1802 * constexpr.c (cxx_fold_indirect_ref): Try to canonicalize the
1803 object/offset pair for a POINTER_PLUS_EXPR of a COMPONENT_REF
1804 with a negative offset into one whose offset is nonnegative
1805 before calling cxx_fold_indirect_ref_1.
1807 2021-04-24 Patrick Palka <ppalka@redhat.com>
1814 * pt.c (do_class_deduction): Punt if the initializer is
1817 2021-04-24 Patrick Palka <ppalka@redhat.com>
1820 * parser.c (cp_parser_type_id_1): If we see a template
1821 placeholder, first try simulating an error before issuing
1824 2021-04-23 Patrick Palka <ppalka@redhat.com>
1827 * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause):
1828 Adjust parameter list loop to iterate over 'types' instead of
1829 'args'. Output the trailing '...' for a variadic function.
1830 Remove PARM_DECL support.
1831 (pp_cxx_requires_expr): Pretty print the parameter list directly
1832 instead of going through pp_cxx_parameter_declaration_clause.
1834 2021-04-23 Patrick Palka <ppalka@redhat.com>
1837 * decl.c (is_direct_enum_init): Check the implicit
1838 convertibility requirement added by CWG 2374.
1840 2021-04-23 Martin Liska <mliska@suse.cz>
1842 * cp-tree.h (STATIC_ASSERT): Prefer static assert.
1843 * lex.c (init_operators): Remove run-time check.
1845 2021-04-22 Marek Polacek <polacek@redhat.com>
1848 * pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
1849 op1 separately for value- or type-dependence.
1851 2021-04-21 Marek Polacek <polacek@redhat.com>
1854 * parser.c (cp_parser_enum_specifier): Don't allow defining
1857 2021-04-21 Martin Liska <mliska@suse.cz>
1860 2021-04-21 Martin Liska <mliska@suse.cz>
1862 * error.c (dump_decl): Use flags in dump_generic_node call.
1864 2021-04-21 Martin Liska <mliska@suse.cz>
1866 * error.c (dump_decl): Use flags in dump_generic_node call.
1868 2021-04-21 Martin Liska <mliska@suse.cz>
1870 * error.c (dump_decl): Support anonymous labels.
1872 2021-04-20 Jason Merrill <jason@redhat.com>
1875 * pt.c (find_parameter_packs_r): Look into enum initializers.
1877 2021-04-19 Marek Polacek <polacek@redhat.com>
1880 * decl.c (grokvardecl): Given an error when a concept is not defined
1883 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1886 * constexpr.c (cxx_eval_store_expression): Don't add CONSTRUCTORs
1887 for empty classes into *valp when types don't match even when *valp
1890 2021-04-16 Marek Polacek <polacek@redhat.com>
1893 * decl.c (make_typename_type): Give an error and return when
1894 name is is_overloaded_fn.
1895 * parser.c (cp_parser_class_name): Don't check is_overloaded_fn
1896 before calling make_typename_type.
1898 2021-04-16 Patrick Palka <ppalka@redhat.com>
1901 * constexpr.c (reduced_constant_expression_p): For array
1902 CONSTRUCTORs, use a dedicated loop that additionally verifies
1903 the CONSTRUCTOR spans the entire array.
1905 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1908 * parser.c (cp_parser_constraint_requires_parens) <case CPP_DEREF>:
1909 If lambda_p, return pce_ok instead of pce_maybe_postfix.
1911 2021-04-16 Jakub Jelinek <jakub@redhat.com>
1914 * pt.c (extract_locals_r): When handling DECL_EXPR of a structured
1915 binding, add to data.internal also all corresponding structured
1918 2021-04-16 Jason Merrill <jason@redhat.com>
1921 * cp-tree.h (first_field): Declare.
1922 * mangle.c (range_expr_nelts): New.
1923 (write_expression): Improve class NTTP mangling.
1924 * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
1925 * tree.c (zero_init_expr_p): Improve class NTTP handling.
1926 * decl.c: Adjust comment.
1928 2021-04-15 Jason Merrill <jason@redhat.com>
1931 * call.c (build_new_method_call_1): Check again for side-effects
1932 with a volatile object.
1934 2021-04-15 Jason Merrill <jason@redhat.com>
1938 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into
1939 TYPE_RAISES_EXCEPTIONS here.
1940 * tree.c (cp_walk_subtrees): Not here.
1942 2021-04-15 Jason Merrill <jason@redhat.com>
1946 * parser.c (cp_parser_default_type_template_argument): Set
1947 parser->local_variables_forbidden_p.
1949 2021-04-15 Richard Sandiford <richard.sandiford@arm.com>
1952 * typeck.c (merge_type_attributes_from): New function.
1953 (cp_common_type): Use it for vector types.
1955 2021-04-14 Jason Merrill <jason@redhat.com>
1959 * pt.c (uses_outer_template_parms): Also look at default
1962 2021-04-14 Jason Merrill <jason@redhat.com>
1965 * semantics.c (finish_id_expression_1): Clear cp_unevaluated_operand
1966 for a non-static data member in a constant-expression.
1968 2021-04-14 Patrick Palka <ppalka@redhat.com>
1972 * pt.c (deducible_expression): Look through implicit
1973 INDIRECT_REFs as well.
1975 2021-04-14 Jason Merrill <jason@redhat.com>
1978 * parser.c (cp_parser_lambda_expression): Reject lambda
1979 in template parameter type.
1981 2021-04-14 Jason Merrill <jason@redhat.com>
1984 * decl.c (duplicate_decls): Don't propagate
1985 DECL_INITIALIZED_IN_CLASS_P to a specialization.
1987 2021-04-14 Jason Merrill <jason@redhat.com>
1992 * semantics.c (set_cleanup_locs): New.
1993 (do_poplevel): Call it.
1994 * parser.c (cp_parser_compound_statement): Consume the }
1995 before finish_compound_stmt.
1997 2021-04-13 Jason Merrill <jason@redhat.com>
2000 * pt.c (get_underlying_template): Compare TYPE_QUALS.
2002 2021-04-13 Jason Merrill <jason@redhat.com>
2006 * init.c (get_nsdmi): Do more context adjustment for local classes.
2008 2021-04-13 Patrick Palka <ppalka@redhat.com>
2011 * pt.c (do_class_deduction): Reject alias CTAD in C++17 mode
2012 rather than issuing a pedwarn.
2013 * typeck2.c (build_functional_cast_1): Handle CTAD uniformly
2014 for consistent diagnostics.
2016 2021-04-13 Jason Merrill <jason@redhat.com>
2019 * class.c (build_base_path): Shortcut simple non-pointer case.
2021 2021-04-13 Eric Botcazou <ebotcazou@adacore.com>
2023 * module.cc (ordinary_loc_of): Test LINEMAPS_MACRO_LOWEST_LOCATION
2025 (module_state::write_location): Likewise.
2027 2021-04-13 Patrick Palka <ppalka@redhat.com>
2030 * pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
2031 when checking if the initializer is an equivalent class
2032 placeholder template parameter.
2034 2021-04-13 Patrick Palka <ppalka@redhat.com>
2038 * constraint.cc (satisfy_normalized_constraints): Set
2040 * parser.c (cp_parser_concept_definition): Likewise.
2041 (cp_parser_requires_clause_opt): Likewise.
2043 2021-04-12 Jason Merrill <jason@redhat.com>
2046 * pt.c (uses_outer_template_parms): Handle non-type and template
2047 template parameters specifically.
2049 2021-04-11 Jason Merrill <jason@redhat.com>
2052 * decl.c (fixup_anonymous_aggr): Prune all functions from
2053 CLASSTYPE_MEMBER_VEC.
2055 2021-04-10 Jason Merrill <jason@redhat.com>
2059 * parser.c (cp_parser_direct_declarator): Don't
2060 inject_this_parameter if static_p.
2061 (cp_parser_omp_var_list_no_open): Parse 'this' even if
2062 current_class_ptr isn't set for a better diagnostic.
2064 2021-04-10 Jason Merrill <jason@redhat.com>
2071 * pt.c (alias_ctad_tweaks): Handle failure better.
2073 2021-04-10 Jason Merrill <jason@redhat.com>
2076 * pt.c (find_parameter_packs_r) [TAG_DEFN]: Look into bases.
2078 2021-04-09 Patrick Palka <ppalka@redhat.com>
2080 * cp-tree.h (LAMBDA_EXPR_REGENERATED_FROM)
2081 (LAMBDA_EXPR_REGENERATING_TARGS): Replace these with ...
2082 (LAMBDA_EXPR_REGEN_INFO): ... this.
2083 (tree_lambda_expr::regenerated_from)
2084 (tree_lambda_expr::regenerating_targs): Replace these with ...
2085 (tree_lambda_expr::regen_info): ... this.
2086 * constraint.cc (satisfy_declaration_constraints): Adjust
2088 * lambda.c (build_lambda_expr): Likewise.
2089 * pt.c (regenerated_lambda_fn_p): Likewise.
2090 (most_general_lambda): Likewise.
2091 (tsubst_lambda_expr): Likewise.
2093 2021-04-09 Marek Polacek <polacek@redhat.com>
2096 * parser.c (cp_parser_member_declaration): Call
2097 cp_parser_save_default_args even for function templates. Use
2098 STRIP_TEMPLATE on the declaration we're passing.
2100 2021-04-08 Patrick Palka <ppalka@redhat.com>
2103 * constraint.cc (get_normalized_constraints_from_decl): Handle
2104 regenerated lambdas.
2105 (satisfy_declaration_constraints): Likewise. Check for
2106 dependent args later.
2107 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): Replace with ...
2108 (LAMBDA_EXPR_REGENERATED_FROM): ... this.
2109 (LAMBDA_EXPR_REGENERATING_TARGS): New.
2110 (tree_lambda_expr::regenerated_from): New data member.
2111 (tree_lambda_expr::regenerating_targs): New data member.
2112 (add_to_template_args): Declare.
2113 (regenerated_lambda_fn_p): Likewise.
2114 (most_general_lambda): Likewise.
2115 * lambda.c (build_lambda_expr): Set LAMBDA_EXPR_REGENERATED_FROM
2116 and LAMBDA_EXPR_REGENERATING_TARGS.
2117 * pt.c (add_to_template_args): No longer static.
2118 (tsubst_function_decl): Unconditionally propagate constraints on
2119 the substituted function decl.
2120 (instantiated_lambda_fn_p): Rename to ...
2121 (regenerated_lambda_fn_p): ... this. Check
2122 LAMBDA_EXPR_REGENERATED_FROM instead of
2123 LAMBDA_EXPR_INSTANTIATED.
2124 (most_general_lambda): Define.
2125 (enclosing_instantiation_of): Adjust after renaming
2126 instantiated_lambda_fn_p.
2127 (tsubst_lambda_expr): Don't set LAMBDA_EXPR_INSTANTIATED. Set
2128 LAMBDA_EXPR_REGENERATED_FROM and LAMBDA_EXPR_REGENERATING_TARGS.
2129 Don't substitute or set constraints on the regenerated lambda.
2131 2021-04-08 Patrick Palka <ppalka@redhat.com>
2134 * pt.c (build_deduction_guide): Document OUTER_ARGS. Substitute
2135 them into the propagated constraints.
2137 2021-04-08 Jason Merrill <jason@redhat.com>
2140 * call.c (convert_like_internal): Improve reference diagnostic.
2142 2021-04-08 Jakub Jelinek <jakub@redhat.com>
2145 * constexpr.c (addr_of_non_const_var): New function.
2146 (cxx_bind_parameters_in_call): Set *non_constant_args to true
2147 even if cp_walk_tree on arg with addr_of_non_const_var callback
2150 2021-04-08 Jason Merrill <jason@redhat.com>
2153 * pt.c (determine_specialization): Improve diagnostic.
2155 2021-04-08 Marek Polacek <polacek@redhat.com>
2158 * decl.c (build_explicit_specifier): Call
2159 check_for_bare_parameter_packs.
2160 * except.c (build_noexcept_spec): Likewise.
2162 2021-04-07 Jason Merrill <jason@redhat.com>
2165 * parser.c (cp_parser_class_name): Check dependent_scope_p.
2167 2021-04-07 Jason Merrill <jason@redhat.com>
2170 * pt.c (maybe_process_partial_specialization): Check
2171 DECL_SELF_REFERENCE_P.
2173 2021-04-07 Jason Merrill <jason@redhat.com>
2176 * name-lookup.c (push_class_level_binding_1): Do overload a new
2177 function with a previous using-declaration.
2179 2021-04-06 Jason Merrill <jason@redhat.com>
2182 * init.c (get_nsdmi): Don't defer access checking.
2184 2021-04-06 Jason Merrill <jason@redhat.com>
2187 * decl.c (cp_finish_decl): mark_needed an implicitly inline
2188 static data member with an out-of-class redeclaration.
2190 2021-04-06 Jason Merrill <jason@redhat.com>
2193 * mangle.c (write_compact_number): Add sanity check.
2194 (write_local_name): Use list_length for parm number.
2196 2021-04-06 Patrick Palka <ppalka@redhat.com>
2199 * pt.c (do_auto_deduction): Don't exit early when deducing the
2200 array type of a structured binding. Also handle adc_decomp_type
2201 during constraint checking.
2203 2021-04-05 Jason Merrill <jason@redhat.com>
2206 * typeck.c (check_return_expr): Call mark_exp_read in dependent
2209 2021-04-05 Jason Merrill <jason@redhat.com>
2212 * typeck.c (build_reinterpret_cast_1): Don't perform
2213 temporary materialization.
2215 2021-04-05 Jason Merrill <jason@redhat.com>
2218 * pt.c (lookup_template_class_1): Do tsubst_enum when
2219 tsubsting a generic lambda.
2221 2021-04-05 Jason Merrill <jason@redhat.com>
2224 * pt.c (enclosing_instantiation_of): Compare DECL_SOURCE_LOCATION if
2225 there is no enclosing non-lambda function.
2227 2021-04-05 Nathan Sidwell <nathan@acm.org>
2230 * module.cc (name_pending_imports): Drop 'atend' parm. Don't
2231 query export when not needed.
2232 (preprocess_module, preprocessed_module): Adjust.
2234 2021-04-05 Jason Merrill <jason@redhat.com>
2237 * pt.c (mark_decl_instantiated): Set DECL_EXTERNAL.
2239 2021-04-05 Jason Merrill <jason@redhat.com>
2242 * pt.c (class el_data): Add visited field.
2243 (extract_local_specs): Pass it to cp_walk_tree.
2244 (extract_locals_r): Walk into the body of a lambda.
2246 2021-04-05 Jason Merrill <jason@redhat.com>
2248 * ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
2251 2021-04-04 Jason Merrill <jason@redhat.com>
2254 * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.
2256 2021-04-03 Marek Polacek <polacek@redhat.com>
2259 * parser.c: Create a GC root for attributes in a decl specifier.
2260 (cp_parser_type_specifier): Push/pop ->attributes onto/from it.
2262 2021-04-03 Jason Merrill <jason@redhat.com>
2265 * pt.c (tsubst_lambda_expr): Skip the body block from
2268 2021-04-03 Jason Merrill <jason@redhat.com>
2271 * cvt.c (can_convert_qual): Check fnptr_conv_p.
2273 2021-04-03 Jason Merrill <jason@redhat.com>
2276 * pt.c (regenerate_decl_from_template): tsubst_decl
2279 2021-04-02 Patrick Palka <ppalka@redhat.com>
2282 * parser.c (do_range_for_auto_deduction): Pass adc_variable_type
2283 to do_auto_deduction.
2285 2021-04-02 Patrick Palka <ppalka@redhat.com>
2288 * semantics.c (finish_compound_literal): Check
2289 template_placeholder_p instead of type_uses_auto.
2291 2021-04-02 Jason Merrill <jason@redhat.com>
2294 * cp-tree.h (PACK_EXPANSION_AUTO_P): New.
2295 * lambda.c (add_capture): Set it.
2296 * pt.c (tsubst_pack_expansion): Handle it.
2298 2021-04-02 Nathan Sidwell <nathan@acm.org>
2300 * cp-tree.h (lang_decl_base): Correct module flag comment.
2301 * module.cc (trees_in::assert_definition): Break out
2303 (trees_out::lang_decl_bools): Do not write purview for header units.
2305 2021-04-01 Marek Polacek <polacek@redhat.com>
2308 * method.c (defaulted_late_check): ++ and -- function_depth around
2309 the call to synthesize_method.
2310 * pt.c: Remove the saved_trees global.
2312 2021-04-01 Jason Merrill <jason@redhat.com>
2316 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into
2317 TYPE_RAISES_EXCEPTIONS.
2319 2021-04-01 Iain Sandoe <iain@sandoe.co.uk>
2321 * mapper-client.cc (INCLUDE_MAP): New; require map to be
2322 included from system.h.
2323 * mapper-resolver.cc (INCLUDE_MAP): Likewise.
2325 2021-04-01 Jason Merrill <jason@redhat.com>
2328 * mangle.c (write_expression): Adjust.
2329 * class.c (find_abi_tags_r): Disable PR98481 fix for ABI v14.
2330 (mark_abi_tags_r): Likewise.
2332 2021-04-01 Nathan Sidwell <nathan@acm.org>
2335 * module.cc (trees_out::decl_node): Adjust importedness reference
2337 (module_state::intercluster_seed): New. Seed both imports and
2338 inter-cluster references. Broken out of ...
2339 (module_state::write_cluster): ... here. Call it.
2341 2021-03-31 Jason Merrill <jason@redhat.com>
2344 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION.
2346 2021-03-31 Patrick Palka <ppalka@redhat.com>
2349 * mangle.c (write_expression): Adjust the mangling of
2352 2021-03-31 Patrick Palka <ppalka@redhat.com>
2355 * pt.c (placeholder_type_constraint_dependent_p): Expand
2356 argument packs to separate the first non-pack argument
2359 2021-03-30 Nathan Sidwell <nathan@acm.org>
2362 * module.cc (dumper::operator): Make less brittle.
2363 (trees_out::core_bools): VAR_DECLs always have a context.
2364 (trees_out::key_mergeable): Use same_type_p for asserting.
2365 (trees_in::read_var_def): Propagate
2366 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2368 2021-03-30 Jakub Jelinek <jakub@redhat.com>
2371 * cp-gimplify.c (cp_gimplify_expr): Handle PTRMEM_CST.
2373 2021-03-26 Marek Polacek <polacek@redhat.com>
2376 * method.c (implicitly_declare_fn): Pass &raises to
2377 synthesized_method_walk.
2379 2021-03-26 Nathan Sidwell <nathan@acm.org>
2382 * cp-tree.h (DECL_MODULE_CHECK): Ban TEMPLATE_DECL.
2383 (SET_TYPE_TEMPLATE_INFO): Restore Alias template setting.
2384 * decl.c (duplicate_decls): Remove template_decl module flag
2386 * module.cc (merge_kind_name): Add alias tmpl spec as a thing.
2387 (dumper::impl::nested_name): Adjust for template-decl module flag
2389 (trees_in::assert_definition): Likewise.
2390 (trees_in::install_entity): Likewise.
2391 (trees_out::decl_value): Likewise. Remove alias template
2392 separation of template and type_decl.
2393 (trees_in::decl_value): Likewise.
2394 (trees_out::key_mergeable): Likewise,
2395 (trees_in::key_mergeable): Likewise.
2396 (trees_out::decl_node): Adjust for template-decl module flag
2398 (depset::hash::make_dependency): Likewise.
2399 (get_originating_module, module_may_redeclare): Likewise.
2400 (set_instantiating_module, set_defining_module): Likewise.
2401 * name-lookup.c (name_lookup::search_adl): Likewise.
2402 (do_pushdecl): Likewise.
2403 * pt.c (build_template_decl): Likewise.
2404 (lookup_template_class_1): Remove special alias_template handling
2405 of DECL_TI_TEMPLATE.
2406 (tsubst_template_decl): Likewise.
2408 2021-03-26 Jakub Jelinek <jakub@redhat.com>
2411 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned
2412 in DECL_EXPR or in BIND_EXPR_VARS.
2414 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2417 * parser.c (cp_parser_postfix_expression): For calls, create
2418 combined_loc and temporarily set input_location to it before
2419 calling finish_call_expr.
2421 2021-03-25 Marek Polacek <polacek@redhat.com>
2424 * call.c (build_over_call): Maybe call mark_used in case
2425 deduce_inheriting_ctor fails and return error_mark_node.
2426 * cp-tree.h (deduce_inheriting_ctor): Adjust declaration.
2427 * method.c (deduce_inheriting_ctor): Return bool if the deduction
2429 (implicitly_declare_fn): If raises is error_mark_node, call
2430 synthesized_method_walk with diag being true.
2432 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2435 * decl2.c (grokbitfield): Diagnose bitfields containing bare parameter
2436 packs and don't set DECL_BIT_FIELD_REPRESENTATIVE in that case.
2438 2021-03-25 Marek Polacek <polacek@redhat.com>
2441 * call.c (build_converted_constant_expr_internal): Don't emit
2442 -Wconversion warnings.
2444 2021-03-25 Jakub Jelinek <jakub@redhat.com>
2447 * call.c (build_conditional_expr_1): Pass OEP_ADDRESS_OF_SAME_FIELD
2449 * cvt.c (convert_to_void): Preserve location_t on COND_EXPR or
2452 2021-03-23 Nathan Sidwell <nathan@acm.org>
2455 * name-lookup.c (check_module_override): Set global or partition
2456 DUP on the binding vector.
2458 2021-03-23 Marek Polacek <polacek@redhat.com>
2461 * decl2.c (cp_warn_deprecated_use_scopes): Only call
2462 cp_warn_deprecated_use when decl is a namespace, class, or enum.
2464 2021-03-23 Nathan Sidwell <nathan@acm.org>
2467 * decl.c (duplicate_decls): Remove assert about maybe-imported
2470 2021-03-23 Jakub Jelinek <jakub@redhat.com>
2473 * decl.c (cp_finish_decomp): Diagnose void initializers when
2474 using tuple_element and get.
2476 2021-03-22 Nathan Sidwell <nathan@acm.org>
2479 * module.cc (depset::hash::make_dependency): Propagate flags for
2480 partial specialization.
2481 (module_may_redeclare): Handle partial specialization.
2483 2021-03-22 Nathan Sidwell <nathan@acm.org>
2486 * cp-tree.h (map_context_from, map_context_to): Delete.
2487 (add_mergeable_specialization): Add is_alias parm.
2488 * pt.c (add_mergeable_specialization): Add is_alias parm, add them.
2489 * module.cc (map_context_from, map_context_to): Delete.
2490 (trees_in::decl_value): Add specializations later, adjust call.
2491 Drop useless alias lookup. Set duplicate fn parm context.
2492 (check_mergeable_decl): Drop context mapping.
2493 (trees_in::is_matching_decl): Likewise.
2494 (trees_in::read_function_def): Drop parameter context adjustment
2497 2021-03-22 Martin Liska <mliska@suse.cz>
2500 * module.cc (fini_modules): Call vec_free instead of delete.
2502 2021-03-20 Jakub Jelinek <jakub@redhat.com>
2505 * cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
2506 special code, instead call c_genericize_control_stmt.
2508 2021-03-19 Jakub Jelinek <jakub@redhat.com>
2511 * constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
2512 INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
2513 don't diagnose it, set *non_constant_p nor return t.
2515 2021-03-19 Marek Polacek <polacek@redhat.com>
2518 * parser.c (cp_parser_requirement_parameter_list): Handle
2521 2021-03-18 Marek Polacek <polacek@redhat.com>
2523 * pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2525 2021-03-18 Marek Polacek <polacek@redhat.com>
2527 * pt.c (tsubst_copy_and_build): Add assert.
2529 2021-03-18 Iain Sandoe <iain@sandoe.co.uk>
2532 * parser.c (cp_debug_parser): Add Objective-C++ message
2534 (cp_parser_nested_name_specifier_opt): Allow colon to
2535 terminate an assignment-expression when parsing Objective-
2537 (cp_parser_objc_message_expression): Set and clear message
2538 parsing state on entry and exit.
2539 * parser.h (struct cp_parser): Add a context flag for
2540 Objective-C++ message state.
2542 2021-03-18 Martin Liska <mliska@suse.cz>
2545 * coroutines.cc (struct var_nest_node): Init then_cl and else_cl
2548 2021-03-17 Marek Polacek <polacek@redhat.com>
2551 * call.c (conv_unsafe_in_template_p): New.
2552 (convert_like): Use it.
2554 2021-03-17 Anthony Sharp <anthonysharp15@gmail.com>
2555 Jason Merrill <jason@redhat.com>
2557 * semantics.c (get_class_access_diagnostic_decl): New
2558 function that examines special cases when a parent
2559 class causes a private access failure.
2560 (enforce_access): Slightly modified to call function
2563 2021-03-16 Jason Merrill <jason@redhat.com>
2565 * tree.c (cp_tree_equal): Use real_identical.
2567 2021-03-16 Jakub Jelinek <jakub@redhat.com>
2570 * decl.c (expand_static_init): For thread guards, call __cxa_atexit
2571 before calling __cxa_guard_release rather than after it. Formatting
2574 2021-03-16 Martin Liska <mliska@suse.cz>
2575 Jason Merrill <jason@redhat.com>
2578 * call.c (get_function_version_dispatcher): Handle
2580 * decl.c (maybe_version_functions): Likewise.
2581 (maybe_mark_function_versioned): New.
2582 * name-lookup.c (push_local_extern_decl_alias): No longer static.
2583 * name-lookup.h (push_local_extern_decl_alias): Adjust.
2585 2021-03-16 Nathan Sidwell <nathan@acm.org>
2588 * module.cc (trees_out::decl_value): Adjust typedef streaming,
2589 indicate whether it is a dependent alias.
2590 (trees_in::decl_value): Likewise. Set as dependent alias, if it
2593 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2596 * coroutines.cc (expand_one_await_expression): If the
2597 await_ready() expression is not a boolean then convert it
2600 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2603 * coroutines.cc (build_actor_fn): Make destroy index 1
2604 correspond to the abnormal unhandled_exception() exit.
2605 Substitute the proxy for the resume index.
2606 (coro_rewrite_function_body): Arrange to reset the resume
2607 index and make done = true for a rethrown exception from
2608 unhandled_exception ().
2609 (morph_fn_to_coro): Adjust calls to build_actor_fn and
2610 coro_rewrite_function_body.
2612 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2615 * coroutines.cc (replace_continue): Rewrite continue into
2617 (await_statement_walker): Handle await expressions in the
2618 initializer, condition and iteration expressions of for
2621 2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
2624 * coroutines.cc (flatten_await_stmt): Allow for the case
2625 where a target expression variable only has uses in the
2626 second part of a compound expression.
2627 (maybe_promote_temps): Avoid emiting empty statements.
2629 2021-03-15 Tobias Burnus <tobias@codesourcery.com>
2632 * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
2633 ensure that the varpool node is marked as offloadable.
2635 2021-03-12 Nathan Sidwell <nathan@acm.org>
2638 * module.cc (depset::hash::add_binding_entity): Assert not
2640 (depset::add::add_specializations): Likewise.
2641 * name-lookup.c (name_lookup::dedup): New.
2642 (name_lookup::~name_lookup): Assert not deduping.
2643 (name_lookup::restore_state): Likewise.
2644 (name_lookup::add_overload): Replace outlined code with dedup
2646 (name_lookup::add_value): Likewise.
2647 (name_lookup::search_namespace_only): Likewise.
2648 (name_lookup::adl_namespace_fns): Likewise.
2649 (name_lookup::adl_class_fns): Likewise.
2650 (name_lookup::search_adl): Likewise. Add clearing dedup call.
2651 (name_lookup::search_qualified): Likewise.
2652 (name_lookup::search_unqualified): Likewise.
2654 2021-03-12 Jakub Jelinek <jakub@redhat.com>
2657 * call.c (build_over_call): For immediate evaluation of functions
2658 that return references, undo convert_from_reference effects before
2659 calling cxx_constant_value and call convert_from_reference
2662 2021-03-11 Nathan Sidwell <nathan@acm.org>
2665 * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
2666 when there's a binding vector.
2667 * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
2669 2021-03-11 Nathan Sidwell <nathan@acm.org>
2672 * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
2674 (trees_in::decl_value): Adjust add_mergeable_specialization call.
2675 (trees_out::get_merge_kind): Adjust detecting a partial template
2677 (trees_out::key_mergeable): Adjust handling same.
2678 (trees_in::key_mergeabvle): Likewise.
2680 2021-03-10 Nathan Sidwell <nathan@acm.org>
2683 * module.cc (post_load_processing): Assert not gcable.
2684 (laxy_load_pendings): Extend no-gc region around
2685 post_load_processing.
2687 2021-03-10 Nathan Sidwell <nathan@acm.org>
2690 * decl.c (make_rtl_for_nonlocal_decl): Propagate local-extern's
2691 assembler name to the ns alias.
2693 2021-03-09 Jakub Jelinek <jakub@redhat.com>
2696 * coroutines.cc (build_co_await): Look through NOP_EXPRs in
2697 build_special_member_call return value to find the CALL_EXPR.
2700 2021-03-09 Nathan Sidwell <nathan@acm.org>
2703 * parser.c (cp_parser_diagnose_invalid_type_name): Clarify
2704 that C++20 does not yet imply modules.
2706 2021-03-08 Nathan Sidwell <nathan@acm.org>
2709 * name-lookup.c (get_cxx_dialect_name): Add cxx23.
2711 2021-03-08 Nathan Sidwell <nathan@acm.org>
2713 * lex.c (module_token_filter::resume): Ignore module-decls inside
2715 * parser.c (cp_parser_module_declaration): Reject in header-unit.
2717 2021-03-08 Nathan Sidwell <nathan@acm.org>
2720 * cp-tree.h (match_mergeable_specialization)
2721 (add_mergeable_specialization): Adjust parms.
2722 * module.cc (trees_in::decl_value): Adjust
2723 add_mergeable_specialization calls.
2724 (trees_out::key_mergeable): Adjust match_mergeable_specialization
2726 (specialization_add): Likewise.
2727 * pt.c (match_mergeable_specialization): Do not insert.
2728 (add_mergeable_specialization): Add to hash table here.
2730 2021-03-06 Patrick Palka <ppalka@redhat.com>
2731 Jakub Jelinek <jakub@redhat.com>
2734 * constexpr.c (cxx_eval_increment_expression): Pass lval when
2735 evaluating the MODIFY_EXPR, and update 'mod' with the result of
2736 this evaluation. Check *non_constant_p afterwards. For prefix
2737 ops, just return 'mod'.
2739 2021-03-06 Patrick Palka <ppalka@redhat.com>
2740 Jakub Jelinek <jakub@redhat.com>
2743 * pt.c (tsubst_copy) <case TEMPLATE_ID_EXPR>: Rename local
2744 variable 'fn' to 'tmpl'. Handle a variable template-id by
2745 calling lookup_template_variable.
2747 2021-03-06 Patrick Palka <ppalka@redhat.com>
2750 * pt.c (unify) <case TEMPLATE_TYPE_PARM>: Pass targs as
2751 outer_targs to do_auto_deduction.
2752 (placeholder_type_constraint_dependent_p): Define.
2753 (do_auto_deduction): When processing_template_decl != 0
2754 and context is adc_unify and we have constraints, pretend the
2755 constraints are satisfied instead of punting. Otherwise don't
2756 punt unless placeholder_type_constraint_dependent_p holds.
2757 Add some clarifying sanity checks. Add a hack to add missing
2758 outermost template levels to outer_args before checking
2759 satisfaction. Don't substitute outer_targs into type if it's
2762 2021-03-05 Marek Polacek <polacek@redhat.com>
2765 * call.c (standard_conversion): When converting pointers to
2766 member, don't return NULL when the bases are equivalent but
2769 2021-03-05 Marek Polacek <polacek@redhat.com>
2772 * name-lookup.c (check_local_shadow): Check if the type of decl
2773 is non-null before checking TYPE_PTR*.
2775 2021-03-05 Nathan Sidwell <nathan@acm.org>
2778 * module.cc (module_state::write_cluster): Relax binding assert.
2780 2021-03-05 Nathan Sidwell <nathan@acm.org>
2783 * pt.c (instantiate_decl): Call set_instantiating_module.
2785 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2788 * coroutines.cc (build_co_await): Use type_build_ctor_call()
2789 to determine cases when a CTOR needs to be built.
2790 (flatten_await_stmt): Likewise.
2791 (morph_fn_to_coro): Likewise.
2793 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2796 * coroutines.cc (coro_diagnose_throwing_fn): New helper.
2797 (coro_diagnose_throwing_final_aw_expr): New helper.
2798 (build_co_await): Diagnose throwing final await expression
2800 (build_init_or_final_await): Diagnose a throwing promise
2801 final_suspend() call.
2803 2021-03-05 Iain Sandoe <iain@sandoe.co.uk>
2806 * coroutines.cc (struct param_info): Track parameter copies that need
2808 (coro_get_frame_dtor): New helper function factored from build_actor().
2809 (build_actor_fn): Use coro_get_frame_dtor().
2810 (morph_fn_to_coro): Track parameters that need DTORs on exception,
2811 likewise the frame promise and the return object. On exception, run the
2812 DTORs for these, destroy the frame and then rethrow the exception.
2814 2021-03-05 Nathan Sidwell <nathan@acm.org>
2817 * pt.c (instantiate_class_template_1): Set instantiating module
2820 2021-03-05 Tobias Burnus <tobias@codesourcery.com>
2823 * parser.c (cp_parser_oacc_clause_async): Reject comma expressions.
2825 2021-03-04 Jakub Jelinek <jakub@redhat.com>
2829 * cvt.c (convert_to_void): Revert 2019-10-17 changes. Clarify
2832 2021-03-04 Nathan Sidwell <nathan@acm.org>
2835 * module.cc (class uintset): Delete.
2836 (typedef attached_map_t): A hash map.
2837 (attached_table): Use attached_map_t. Adjust uses ...
2838 (trees_out::decl_value, trees_in::decl_value): ... here ...
2839 (trees_out::key_mergeable): ... here ...
2840 (trees_in::key_mergeable): ... here ...
2841 (maybe_attach_decl): ... here ...
2842 (direct_import): ... and here.
2844 2021-03-04 Nathan Sidwell <nathan@acm.org>
2848 * lex.c (cxx_dup_lang_specific_decl): Adjust for module_attached_p
2850 * module.cc (class pending_key): New.
2851 (default_hash_traits<pending_key>): New specialization.
2852 (pending_map_t): New typedef.
2853 (pending_table): Replace old table.
2854 (trees_out::lang_decl_bools): Adjust.
2855 (trees_in::lang_decl_bools): Adjust.
2856 (trees_in::install_entity): Drop pending member and specialization
2858 (find_pending_key): New.
2859 (depset::hash::fiund_dependencies): Use it.
2860 (pendset_lazy_load): Delete.
2861 (module_state::write_cluster): Don't count pendings here. Bye
2862 Duff's device-like thing.
2863 (module_state::write_pendings): Reimplement.
2864 (module_state::read_pendings): Reimplement.
2865 (lazy_specializations_p): Delete.
2866 (module_state::write): Adjust write_pendings call.
2867 (lazy_load_pendings): New.
2868 (lazy_load_specializations): Delete.
2869 (lazy_load_members): Delete.
2870 (init_modules): Adjust.
2871 * name-lookup.c (maybe_lazily_declare): Call lazy_load_pendings
2872 not lazy_load_members.
2873 (note_pending_specializations): Delete.
2874 (load_pending_specializations): Delete.
2875 * name-lookup.h (BINDING_VECTR_PENDING_SPECIALIZATIONS_P): Delete.
2876 (BINDING_VECTOR_PENDING_MEMBERS_P): Delete.
2877 (BINDING_VECTR_PENDING_MEMBERS_P): Delete.
2878 (note_pending_specializations): Delete.
2879 (load_pending_specializations): Delete.
2880 * pt.c (lookup_template_class_1): Call lazy_load_pendings not
2881 lazy_load_specializations.
2882 (instantiate_template_class_1): Likewise.
2883 (instantiate_decl): Call lazy_load_pendings.
2884 * typeck.c (complete_type): Likewise.
2886 2021-03-03 Nathan Sidwell <nathan@acm.org>
2889 * module.cc (post_load_decls): New.
2890 (lazy_snum, recursive_lazy): Move earlier.
2891 (module_state::read_cluster): Push cloning onto post_load_decls.
2892 (post_load_processing): New. Do the cloning here.
2893 (module_state::read_inits): Call post_load_processing.
2894 (module_state::read_language): Likewise.
2895 (lazy_load_binding, lazy_load_specializations): Likewise
2896 (lazy_load_members): Likewise
2898 2021-03-03 Nathan Sidwell <nathan@acm.org>
2901 * module.cc (trees_out::decl_value): Stream specialization keys
2903 (trees_in::decl_value): Stream them back and insert after
2904 completing the decl.
2905 (trees_out::key_mergeable): Drop some streaming here ...
2906 (trees_in::key_mergeable): ... and here. Don't insert into
2907 specialization tables.
2909 2021-03-03 Patrick Palka <ppalka@redhat.com>
2911 * constraint.cc (struct sat_info): Document the different
2912 meanings of noisy() and diagnose_unsatisfaction_p() during
2913 satisfaction and requires-expression evaluation.
2914 (tsubst_valid_expression_requirement): Take a sat_info instead
2915 of a subst_info. Perform the substitution quietly first. Fold
2916 in error-replaying code from diagnose_valid_expression.
2917 (tsubst_simple_requirement): Take a sat_info instead of a
2919 (tsubst_type_requirement_1): New. Fold in error-replaying code
2920 from diagnose_valid_type.
2921 (tsubst_type_requirement): Use the above. Take a sat_info
2922 instead of a subst_info.
2923 (tsubst_compound_requirement): Likewise. Fold in
2924 error-replaying code from diagnose_compound_requirement.
2925 (tsubst_nested_requirement): Take a sat_info instead of a
2926 subst_info. Fold in error-replaying code from
2927 diagnose_nested_requirement.
2928 (tsubst_requirement): Take a sat_info instead of a subst_info.
2929 (tsubst_requires_expr): Split into two versions, one that takes
2930 a sat_info argument and another that takes a complain and
2931 in_decl argument. Remove outdated documentation. Document the
2932 effects of the sat_info argument. Don't short-circuit
2933 processing of requirements when diagnosing unsatisfaction,
2934 mirroring diagnose_requires_expr.
2935 (satisfy_nondeclaration_constraint) <case REQUIRES_EXPR>: Remove
2936 assert, and se the three-parameter version of tsubst_requires_expr.
2937 (diagnose_trait_expr): Make static. Take a template argument
2938 vector instead of a parameter mapping.
2939 (diagnose_valid_expression): Remove.
2940 (diagnose_valid_type): Remove.
2941 (diagnose_simple_requirement): Remove.
2942 (diagnose_compound_requirement): Remove.
2943 (diagnose_type_requirement): Remove.
2944 (diagnose_nested_requirement): Remove.
2945 (diagnose_requirement): Remove.
2946 (diagnose_requires_expr): Remove.
2947 (diagnose_atomic_constraint): Take a sat_info instead of a
2948 subst_info. Adjust call to diagnose_trait_expr. Call
2949 tsubst_requires_expr instead of diagnose_requires_expr.
2950 (diagnose_constraints): Remove special casing of REQUIRES_EXPR
2951 and just always call constraint_satisfaction_value.
2953 2021-03-03 Patrick Palka <ppalka@redhat.com>
2955 * constexpr.c (cxx_eval_call_expression): Adjust call to
2956 evaluate_concept_check.
2957 (cxx_eval_constant_expression) <case REQUIRES_EXPR>: Use
2958 evaluate_requires_expression instead of
2959 satisfy_constraint_expression.
2960 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
2961 * constraint.cc (struct sat_info): Adjust comment about which
2962 satisfaction entrypoints use noisy-unsat.
2963 (normalize_template_requirements): Remove (and adjust callers
2965 (normalize_nontemplate_requirements): Likewise.
2966 (tsubst_nested_requirement): Use constraint_satisfaction_value
2967 instead of satisfy_constraint_expression, which'll do the
2968 noisy replaying of ill-formed quiet satisfaction for us.
2969 (decl_satisfied_cache): Adjust comment.
2970 (satisfy_constraint): Rename to ...
2971 (satisfy_normalized_constraints): ... this.
2972 (satisfy_associated_constraints): Remove (and make its
2973 callers check for dependent arguments).
2974 (satisfy_constraint_expression): Rename to ...
2975 (satisfy_nondeclaration_constraints): ... this. Assert that
2976 'args' is empty when 't' is a concept-id. Removing handling
2977 bare constraint-expressions, and handle REQUIRES_EXPRs
2978 specially. Adjust comment accordingly.
2979 (satisfy_declaration_constraints): Assert in the two-parameter
2980 version that 't' is not a TEMPLATE_DECL. Adjust following
2981 removal of normalize_(non)?template_requirements and
2982 satisfy_asociated_constraints.
2983 (constraint_satisfaction_value): Combine the two- and
2984 three-parameter versions in the natural way.
2985 (constraints_satisfied_p): Combine the one- and two-parameter
2986 versions in the natural way. Improve documentation.
2987 (evaluate_requires_expr): Define.
2988 (evaluate_concept_check): Remove 'complain' parameter. Use
2989 constraint_satisfaction_value instead of
2990 satisfy_constraint_expression.
2991 (diagnose_nested_requirement): Adjust following renaming of
2992 satisfy_constraint_expression.
2993 (diagnose_constraints): Handle REQUIRES_EXPR by going through
2994 diagnose_requires_expr directly instead of treating it as a
2995 constraint-expression. Improve documentation.
2996 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Adjust call
2997 to evaluate_concept_check.
2998 <case REQUIRES_EXPR>: Use evaluate_requires_expr instead of
2999 constraints_satisfied_p.
3000 <case TEMPLATE_ID_EXPR>: Adjust call to evaluate_concept_check.
3001 * cp-tree.h (evaluate_requires_expr): Declare.
3002 (evaluate_concept_check): Remove tsubst_flag_t parameter.
3003 (satisfy_constraint_expression): Remove declaration.
3004 (constraints_satisfied_p): Remove one-parameter declaration.
3005 Add a default argument to the two-parameter declaration.
3006 * cvt.c (convert_to_void): Adjust call to
3007 evaluate_concept_check.
3009 2021-03-03 Jakub Jelinek <jakub@redhat.com>
3012 * call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
3015 2021-03-03 Marek Polacek <polacek@redhat.com>
3019 * pt.c (build_deduction_guide): Use INNERMOST_TEMPLATE_ARGS.
3020 (maybe_aggr_guide): Use the original template type where needed. In
3021 a class member template, partially instantiate the result of
3022 collect_ctor_idx_types.
3023 (do_class_deduction): Defer the deduction until the enclosing
3024 scope is non-dependent.
3026 2021-03-03 Jason Merrill <jason@redhat.com>
3029 * call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
3030 if it didn't get one before.
3032 2021-03-03 Nathan Sidwell <nathan@acm.org>
3035 * module.cc (trees_out::decl_node): Small refactor.
3036 (depset::hash::add_binding_entity): Return true on meeting an
3037 import. Set namespace's import here.
3038 (module_state:write_namespaces): Inform of purview too.
3039 (module_state:read_namespaces): Adjust.
3040 * name-lookup.c (implicitly_export_namespace): Delete.
3041 (do_pushdecl): Don't call it.
3042 (push_namespace): Likewise, set purview.
3043 (add_imported_namespace): Reorder parms.
3044 * name-lookup.h (add_imported_namespace): Alter param ordering.
3046 2021-03-02 Martin Sebor <msebor@redhat.com>
3049 * class.c (build_base_path): Call build_if_nonnull.
3050 * cp-tree.h (build_if_nonnull): Declare.
3051 * rtti.c (ifnonnull): Rename...
3052 (build_if_nonnull): ...to this. Set no-warning bit on COND_EXPR.
3053 (build_dynamic_cast_1): Adjust to name change.
3055 2021-03-02 Patrick Palka <ppalka@redhat.com>
3059 * constraint.cc (type_deducible_p): Don't substitute into the
3060 constraints, and instead just pass 'args' to do_auto_deduction
3061 as the outer template arguments.
3062 (tsubst_parameter_mapping): Remove confused code for handling
3063 placeholder type arguments.
3064 (normalize_placeholder_type_constraint): Define.
3065 (satisfy_constraint_expression): Use it to handle placeholder
3067 * cp-tree.h (PLACEHOLDER_TYPE_CONSTRAINTS_INFO): Define.
3068 (PLACEHOLDER_TYPE_CONSTRAINTS): Redefine in terms of the above.
3069 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: Use
3070 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3071 (make_constrained_placeholder_type): Set
3072 PLACEHOLDER_TYPE_CONSTRAINTS_INFO instead.
3073 (do_auto_deduction): Clarify comments about the outer_targs
3074 parameter. Rework satisfaction of a placeholder type constraint
3075 to pass in the complete set of template arguments directly to
3076 constraints_satisfied_p.
3077 (splice_late_return_type): Use PLACEHOLDER_TYPE_CONSTRAINTS_INFO
3078 instead. Also rebuild the the constraint info on the new auto.
3080 2021-03-02 Patrick Palka <ppalka@redhat.com>
3082 * constraint.cc (build_parameter_mapping): Rely on the caller to
3083 determine the in-scope template parameters.
3084 (norm_info::norm_info): Delegate the tsubst_flags_t constructor
3085 to the two-parameter constructor. In the two-parameter
3086 constructor, fold in the definition of make_context, set
3087 initial_parms appropriately, and don't set the now-removed
3089 (norm_info::make_context): Remove, now that its only use is
3090 inlined into the caller.
3091 (norm_info::update_context): Adjust call to
3092 build_parameter_mapping to pass in the relevant set of in-scope
3093 template parameters.
3094 (norm_info::ctx_parms): Define this member function.
3095 (norm_info::context): Initialize to NULL_TREE.
3096 (norm_info::orig_decl): Remove this data member.
3097 (norm_info::initial_parms): Define this data member.
3098 (normalize_atom): Adjust call to build_parameter_mapping to pass
3099 in the relevant set of in-scope template parameters. Use
3100 info.initial_parms instead of info.orig_decl.
3101 (normalize_constraint_expression): Take a norm_info object
3102 instead of a bool. Cache the result of normalization.
3103 (tsubst_nested_requirement): Call satisfy_constraint_expression
3104 instead of satisfy_constraint, so that we normalize on demand.
3105 (satisfy_constraint_expression): Handle a NESTED_REQ argument.
3106 Adjust call to normalize_constraint_expression.
3107 (finish_nested_requirement): Set the TREE_TYPE of the NESTED_REQ
3108 to current_template_parms.
3109 (diagnose_nested_requirements): Go through
3110 satisfy_constraint_expression, as with tsubst_nested_requirement.
3112 2021-03-02 Patrick Palka <ppalka@redhat.com>
3114 * constraint.cc (tsubst_parameter_mapping): Canonicalize the
3115 arguments of a substituted TYPE_ARGUMENT_PACK even if we've
3116 started with a TYPE_ARGUMENT_PACK.
3117 (finish_requires_expr): Don't set DECL_CONTEXT and
3118 CONSTRAINT_VAR_P on each of the introduced parameters here.
3119 * parser.c (cp_parser_requirement_parameter_list): Instead set
3120 these fields earlier, here.
3121 * pt.c (do_auto_deduction): Canonicalize the result of
3122 do_auto_deduction. Pass 'complain' to finish_decltype_type.
3124 2021-03-02 Patrick Palka <ppalka@redhat.com>
3126 * constraint.cc (tsubst_simple_requirement): Just return
3127 boolean_true_node on success.
3128 (tsubst_type_requirement): Likewise.
3129 (tsubst_compound_requirement): Likewise.
3130 (tsubst_nested_requirement): Likewise.
3131 (tsubst_requirement_body): Remove.
3132 (check_constaint_variables): Rename to ...
3133 (check_constraint_variables): ... this.
3134 (tsubst_constraint_variables): Adjust.
3135 (tsubst_requires_expr): Fold tsubst_requirement_body into here.
3137 2021-03-01 Nathan Sidwell <nathan@acm.org>
3140 * class.c (fixup_type_variants): Propagate mode, precision,
3141 alignment & emptiness.
3142 * module.cc (trees_out::type_node): Use TYPE_ALIGN_RAW.
3143 (trees_in::tree_node): Rematerialize alignment here.
3145 2021-02-27 Jason Merrill <jason@redhat.com>
3148 * parser.c (cp_parser_lambda_declarator_opt): Accept GNU attributes
3151 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3153 * parser.c (cp_parser_lambda_declarator_opt): Implement
3154 P1102R2 - Down with ()! Make ()s optional before lambda specifiers
3155 for -std={c,gnu}++2b or with pedwarn in earlier versions.
3157 2021-02-26 Jakub Jelinek <jakub@redhat.com>
3160 * lambda.c (is_lambda_ignored_entity): Before checking for
3161 LAMBDA_FUNCTION_P, use OVL_FIRST. Drop FUNCTION_DECL check.
3163 2021-02-26 Jason Merrill <jason@redhat.com>
3166 * pt.c (tsubst_copy) [VIEW_CONVERT_EXPR]: Add const
3167 to a class non-type template argument that needs it.
3169 2021-02-26 Patrick Palka <ppalka@redhat.com>
3172 * pt.c (splice_late_return_type): Rebuild the entire return type
3173 if we have to adjust the level of an auto within.
3174 (type_uses_auto): Adjust call to find_type_usage.
3175 * type-utils.h (find_type_usage): Revert r10-6571 change that
3176 made this function return a pointer to the auto node.
3178 2021-02-25 Patrick Palka <ppalka@redhat.com>
3182 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of
3183 TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope.
3185 2021-02-25 Patrick Palka <ppalka@redhat.com>
3188 * pt.c (is_spec_or_derived): Drop cv-qualifiers from 'etype'.
3189 (maybe_aggr_guide): Fix order of arguments to is_spec_or_derived.
3191 2021-02-25 Marek Polacek <polacek@redhat.com>
3195 * constexpr.c (is_std_construct_at): New overload.
3196 (is_std_allocator_allocate): New overload.
3197 (cxx_eval_call_expression): Use the new overloads.
3198 (cxx_eval_constant_expression): Reject casting
3199 from void * as per DR 1312. Don't check can_convert.
3201 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3204 * coroutines.cc (struct param_info): Track rvalue refs.
3205 (morph_fn_to_coro): Track rvalue refs, and call the promise
3206 CTOR with the frame copy of passed parms.
3208 2021-02-25 Iain Sandoe <iain@sandoe.co.uk>
3211 * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
3212 set throwing_cleanup marker.
3214 2021-02-25 Nathan Sidwell <nathan@acm.org>
3217 * module.cc (module_state::inform_cmi_p): Renamed field.
3218 (module_state::do_import): Adjust.
3219 (init_modules, finish_module_processing): Likewise.
3220 (handle_module_option): Likewise.
3222 2021-02-25 Nathan Sidwell <nathan@acm.org>
3225 * mapper-client.cc (module_client::open_module_client): Fix typo
3228 2021-02-24 Nathan Sidwell <nathan@acm.org>
3231 * module.cc (ool): New indirection vector.
3232 (loc_spans::maybe_propagate): Location is not optional.
3233 (loc_spans::open): Likewise. Assert monotonically advancing.
3234 (module_for_ordinary_loc): Use ool indirection vector.
3235 (module_state::write_prepare_maps): Do not count empty macro
3236 expansions. Elide empty spans.
3237 (module_state::write_macro_maps): Skip empty expansions.
3238 (ool_cmp): New qsort comparator.
3239 (module_state::write): Create and destroy ool vector.
3240 (name_pending_imports): Fix dump push/pop.
3241 (preprocess_module): Likewise. Add more dumping.
3242 (preprocessed_module): Likewise.
3244 2021-02-24 Iain Sandoe <iain@sandoe.co.uk>
3247 * coroutines.cc (coro_common_keyword_context_valid_p): Suppress
3248 error reporting when instantiating for a constexpr.
3250 2021-02-23 Nathan Sidwell <nathan@acm.org>
3253 * decl.c (name_unnamed_type): Check DECL identity, not IDENTIFIER
3256 2021-02-23 Patrick Palka <ppalka@redhat.com>
3259 * pt.c (tsubst_copy_and_build) <case BASELINK>: New case, copied
3260 over from tsubst_copy.
3262 2021-02-23 Patrick Palka <ppalka@redhat.com>
3264 * pt.c (instantiation_dependent_expression_p): Check
3265 processing_template_decl before calling
3266 potential_constant_expression.
3268 2021-02-22 Nathan Sidwell <nathan@acm.org>
3271 * module.cc (struct module_state): Add visited_p flag.
3272 (name_pending_imports): Use it to avoid duplicate requests.
3273 (preprocess_module): Don't read preprocessor state if we failed to
3274 load a module's config.
3276 2021-02-22 Nathan Sidwell <nathan@acm.org>
3279 * decl.c (duplicate_decls): Move DECL_MODULE_IMPORT_P propagation
3281 * module.cc (set_defining_module): Add assert.
3283 2021-02-19 Nathan Sidwell <nathan@acm.org>
3286 * module.cc (pending_imports): New.
3287 (declare_module): Adjust test condition.
3288 (name_pending_imports): New.
3289 (preprocess_module): Reimplement using pending_imports.
3290 (preprocessed_module): Move name-getting to name_pending_imports.
3291 * name-lookup.c (append_imported_binding_slot): Assert module
3292 ordering is increasing.
3294 2021-02-19 Nathan Sidwell <nathan@acm.org>
3296 * module.cc (note_cmis): New.
3297 (struct module_state): Add inform_read_p bit.
3298 (module_state::do_import): Inform of CMI location, if enabled.
3299 (init_modules): Canonicalize note_cmis entries.
3300 (handle_module_option): Handle -flang-info-module-read=FOO.
3302 2021-02-19 Jason Merrill <jason@redhat.com>
3305 * call.c (perfect_conversion_p): Limit rvalueness
3306 test to reference bindings.
3308 2021-02-19 Jason Merrill <jason@redhat.com>
3311 * call.c (perfect_conversion_p): New.
3312 (perfect_candidate_p): New.
3313 (add_candidates): Ignore templates after a perfect non-template.
3315 2021-02-18 Nathan Sidwell <nathan@acm.org>
3318 * module.cc (canonicalize_header_name): Use
3319 cpp_probe_header_unit.
3320 (maybe_translate_include): Fix note_includes comparison.
3321 (init_modules): Fix note_includes string termination.
3323 2021-02-18 Jakub Jelinek <jakub@redhat.com>
3326 * cp-gimplify.c (cp_genericize_r) <case CALL_EXPR>: Use
3327 cp_get_callee_fndecl_nofold instead of cp_get_callee_fndecl to check
3328 for immediate function calls.
3330 2021-02-17 Nathan Sidwell <nathan@acm.org>
3333 * module.cc (struct macro_export): Add GTY markers.
3334 (macro_exports): Likewise, us a va_gc Vector.
3336 2021-02-17 Jakub Jelinek <jakub@redhat.com>
3339 * init.c (build_zero_init_1): For flexible array members just return
3340 NULL_TREE instead of returning empty CONSTRUCTOR with non-complete
3343 2021-02-17 Nathan Sidwell <nathan@acm.org>
3346 * name-lookup.c (do_pushdecl): Don't peek under template_parm
3348 (set_identifier_type_value_with_scope): ... or here.
3349 (do_pushtag): Only set_identifier_type_value_with_scope at
3350 non-class template parm scope, and use parent scope.
3352 2021-02-17 Nathan Sidwell <nathan@acm.org>
3355 * name-lookup.c (maybe_record_mergeable_decl): Deref the correct
3358 2021-02-17 Patrick Palka <ppalka@redhat.com>
3362 * tree.c (build_aggr_init_expr): Revert r10-7718 change.
3364 2021-02-12 Nathan Sidwell <nathan@acm.org>
3366 * module.cc (module_state::write_cluster): Check bindings for
3367 imported using-decls.
3369 2021-02-12 Nathan Sidwell <nathan@acm.org>
3372 * module.cc (trees_in::decl_value): Call add_module_namespace_decl
3373 for new namespace-scope entities.
3374 (module_state::read_cluster): Don't call add_module_decl here.
3375 * name-lookup.h (add_module_decl): Rename to ...
3376 (add_module_namespace_decl): ... this.
3377 * name-lookup.c (newbinding_bookkeeping): Move into ...
3378 (do_pushdecl): ... here. Its only remaining caller.
3379 (add_module_decl): Rename to ...
3380 (add_module_namespace_decl): ... here. Add checking-assert for
3381 circularity. Don't call newbinding_bookkeeping, just extern_c
3382 checking and incomplete var checking.
3384 2021-02-12 Nathan Sidwell <nathan@acm.org>
3388 * cp-tree.h (CPTI_GLOBAL_TYPE): Delete.
3389 (global_type_node): Delete.
3390 (IDENTIFIER_TYPE_VALUE): Delete.
3391 (IDENTIFIER_HAS_TYPE_VALUE): Delete.
3392 (get_type_value): Delete.
3393 * name-lookup.h (identifier_type_value): Delete.
3394 * name-lookup.c (check_module_override): Don't
3395 SET_IDENTIFIER_TYPE_VALUE here.
3396 (do_pushdecl): Nor here.
3397 (identifier_type_value_1, identifier_type_value): Delete.
3398 (set_identifier_type_value_with_scope): Only
3399 SET_IDENTIFIER_TYPE_VALUE for local and class scopes.
3400 (pushdecl_nanmespace_level): Remove shadow stack nadgering.
3401 (do_pushtag): Use REAL_IDENTIFIER_TYPE_VALUE.
3402 * call.c (check_dtor_name): Use lookup_name.
3403 * decl.c (cxx_init_decl_processing): Drop global_type_node.
3404 * decl2.c (cplus_decl_attributes): Don't SET_IDENTIFIER_TYPE_VALUE
3406 * init.c (get_type_value): Delete.
3407 * pt.c (instantiate_class_template_1): Don't call pushtag or
3408 SET_IDENTIFIER_TYPE_VALUE here.
3409 (tsubst): Assert never an identifier.
3410 (dependent_type_p): Drop global_type_node assert.
3411 * typeck.c (error_args_num): Don't use IDENTIFIER_HAS_TYPE_VALUE
3412 to determine ctorness.
3414 2021-02-12 Jakub Jelinek <jakub@redhat.com>
3417 * parser.c (cp_parser_requirement_seq): Stop iterating after reaching
3420 2021-02-12 Jason Merrill <jason@redhat.com>
3424 * pt.c (extract_fnparm_pack): Check DECL_PACK_P here.
3425 (register_parameter_specializations): Not here.
3427 2021-02-11 Marek Polacek <polacek@redhat.com>
3430 * pt.c (lookup_template_class_1): Pass tf_none to tsubst when looking
3431 for the partial instantiation.
3433 2021-02-11 Jakub Jelinek <jakub@redhat.com>
3436 * init.c (build_zero_init_1): Handle zero initialiation of
3437 flexible array members like initialization of [0] arrays.
3438 Use integer_minus_onep instead of comparison to integer_minus_one_node
3439 and integer_zerop instead of comparison against size_zero_node.
3442 2021-02-11 Marek Polacek <polacek@redhat.com>
3445 * semantics.c (finish_do_stmt): Check for unexpanded parameter packs.
3447 2021-02-11 Patrick Palka <ppalka@redhat.com>
3450 * name-lookup.c (op_unqualified_lookup): Handle an ambiguous
3451 lookup result by discarding it if the first element is a
3452 class-scope declaration, otherwise return it.
3453 (push_operator_bindings): Handle an ambiguous lookup result by
3454 doing push_local_binding on each element in the list.
3456 2021-02-11 Marek Polacek <polacek@redhat.com>
3458 * parser.c (cp_parser_selection_statement): Use vec_free.
3460 2021-02-10 Jakub Jelinek <jakub@redhat.com>
3464 * constexpr.c: Include cgraph.h.
3465 (cxx_eval_call_expression): Call varpool_node::finalize_decl on
3466 heap artificial vars.
3467 (cxx_eval_outermost_constant_expr): Remove varpool nodes for
3468 heap artificial vars.
3470 2021-02-10 Nathan Sidwell <nathan@acm.org>
3473 * pt.c (tsubst_copy) [VAR_DECL]: For a DECL_LOCAL_DECL_P T is the
3474 answer if there's no local specialization.
3476 2021-02-09 Nathan Sidwell <nathan@acm.org>
3479 * module.cc (module_state::is_rooted): Rename to ...
3480 (module_state::has_location): ... here. Adjust callers.
3481 (module_state::read_partitions): Adjust validity check.
3482 Don't overwrite a known location.
3484 2021-02-09 Jason Merrill <jason@redhat.com>
3487 * pt.c (mark_decl_instantiated): Exit early if consteval.
3489 2021-02-09 Jason Merrill <jason@redhat.com>
3493 * cp-gimplify.c (simple_empty_class_p): Don't touch an invisiref
3496 2021-02-09 Jason Merrill <jason@redhat.com>
3500 * constexpr.c (cxx_eval_store_expression): Only skip empty fields in
3503 2021-02-08 Nathan Sidwell <nathan@acm.org>
3505 * decl.c (start_cleanup_fn): Push function into
3508 2021-02-08 Nathan Sidwell <nathan@acm.org>
3511 * cp-tree.h (push_abi_namespace, pop_abi_namespace): Declare.
3512 * decl.c (push_abi_namespace, pop_abi_namespace): Moved
3513 from rtti.c, add default namespace arg.
3514 (check_redeclaration_exception_specification): Allow a lazy
3515 builtin's eh spec to differ from an lready-declared user
3517 (declare_global_var): Use push/pop_abi_namespace.
3518 (get_atexit_node): Push the fndecl into a namespace.
3519 * rtti.c (push_abi_namespace, pop_abi_namespace): Moved to
3522 2021-02-08 Marek Polacek <polacek@redhat.com>
3524 * cp-tree.h (CLASSTYPE_TI_TEMPLATE): Fix typo.
3526 2021-02-05 Marek Polacek <polacek@redhat.com>
3529 * call.c (build_conditional_expr_1): Don't call mark_lvalue_use
3531 * expr.c (mark_use) <case MODIFY_EXPR>: Don't check read_p when
3532 issuing the -Wvolatile warning. Only set TREE_THIS_VOLATILE if
3533 a warning was emitted.
3535 2021-02-05 Marek Polacek <polacek@redhat.com>
3538 * name-lookup.c (lookup_using_decl): Hoist the destructor check.
3540 2021-02-05 Jakub Jelinek <jakub@redhat.com>
3543 * decl.c (check_array_initializer): For structured bindings, require
3544 the array type to be complete.
3546 2021-02-04 Jason Merrill <jason@redhat.com>
3549 * constraint.cc (build_concept_check_arguments): Remove assert.
3550 (build_concept_check): Allow empty args.
3552 2021-02-04 Tom Greenslade (thomgree) <thomgree@cisco.com>
3555 * call.c (can_convert_array): Extend to handle all valid aggregate
3556 initializers of an array; including by string literals, not just by
3558 (build_aggr_conv): Call can_convert_array more often, not just in
3559 brace-init-list case.
3560 * typeck2.c (array_string_literal_compatible_p): New function.
3561 (digest_init_r): call array_string_literal_compatible_p
3562 * cp-tree.h: (array_string_literal_compatible_p): Declare.
3564 2021-02-04 Jason Merrill <jason@redhat.com>
3567 * pt.c (do_class_deduction): No aggregate guide if any_dguides_p.
3569 2021-02-04 Jason Merrill <jason@redhat.com>
3572 * pt.c (tsubst_attribute): Handle error.
3573 (apply_late_template_attributes): Return false on error.
3574 (tsubst_function_decl): Check its return value.
3575 (tsubst_decl): Likewise.
3576 (push_template_decl): Assert current_template_parms.
3577 (tsubst_template_decl): Set current_template_parms.
3579 2021-02-03 Marek Polacek <polacek@redhat.com>
3582 * call.c (struct z_candidate): Mark rewritten and reversed as const.
3583 (struct NonPublicField): Mark operator() as const.
3584 (struct NonTrivialField): Likewise.
3586 2021-02-03 Jason Merrill <jason@redhat.com>
3590 * pt.c (spec_hasher::equal): Set processing_template_decl.
3591 * Make-lang.in (check-g++-strict-gc): Add --param
3592 hash-table-verification-limit=10000.
3594 2021-02-03 Marek Polacek <polacek@redhat.com>
3597 * parser.c (cp_parser_class_specifier_1): Use any possible
3598 DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
3599 (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
3600 * pt.c (tsubst_exception_specification): Stash new_specs into
3601 DEFPARSE_INSTANTIATIONS.
3602 * tree.c (fixup_deferred_exception_variants): Use
3603 UNPARSED_NOEXCEPT_SPEC_P.
3605 2021-02-02 Jason Merrill <jason@redhat.com>
3609 * error.c (dump_expr): Ignore dummy object.
3610 * pt.c (tsubst_baselink): Handle dependent scope.
3612 2021-02-01 Patrick Palka <ppalka@redhat.com>
3615 * constexpr.c (cxx_eval_array_reference): Also set
3616 new_ctx.object when setting new_ctx.ctor.
3618 2021-02-01 Marek Polacek <polacek@redhat.com>
3621 * parser.c (cp_parser_has_attribute_expression): Use
3622 uses_template_parms instead of type_dependent_expression_p.
3624 2021-02-01 Jason Merrill <jason@redhat.com>
3627 * cp-tree.h: Declare it.
3628 * pt.c (comparing_dependent_aliases): New flag.
3629 (template_args_equal, spec_hasher::equal): Set it.
3630 (dependent_alias_template_spec_p): Assert that we don't
3631 get non-types other than error_mark_node.
3632 (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY
3633 on complex alias specializations. Set TYPE_DEPENDENT_P here.
3634 (tsubst_decl): Not here.
3635 * module.cc (module_state::read_cluster): Set
3636 comparing_dependent_aliases instead of
3637 comparing_specializations.
3638 * tree.c (cp_tree_equal): Remove comparing_specializations
3640 * typeck.c (structural_comptypes): Adjust.
3641 (comptypes): Remove comparing_specializations handling.
3643 2021-01-29 Nathan Sidwell <nathan@acm.org>
3646 * module.cc (module_state_config): Add num_entities field.
3647 (module_state::read_entities): The entity_ary span is
3649 (module_state::write_config): Write num_entities.
3650 (module_state::read_config): Read num_entities.
3651 (module_state::write): Set config's num_entities.
3652 (module_state::read_initial): Allocate the entity ary
3654 (module_state::read_language): Do not set entity_lwm
3657 2021-01-29 Marek Polacek <polacek@redhat.com>
3660 * parser.c (cp_parser_class_name): If parser->scope is
3661 error_mark_node, return it, otherwise continue.
3663 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3666 * typeck.c (build_x_indirect_ref): For *this, return current_class_ref.
3668 2021-01-28 Jakub Jelinek <jakub@redhat.com>
3672 * decl.c (cp_finish_decl): For register vars with asmspec in templates
3673 call set_user_assembler_name and set DECL_HARD_REGISTER.
3674 * pt.c (tsubst_expr): When instantiating DECL_HARD_REGISTER vars,
3675 pass asmspec_tree to cp_finish_decl.
3677 2021-01-28 Nathan Sidwell <nathan@acm.org>
3680 * module.cc (trees_out::decl_value): Swap is_typedef & TYPE_NAME
3682 (trees_in::decl_value): Do typedef frobbing only when installing
3683 a new typedef, adjust is_matching_decl call. Swap is_typedef
3685 (trees_in::is_matching_decl): Add is_typedef parm. Adjust variable
3686 names and deal with typedef checking.
3688 2021-01-27 Jason Merrill <jason@redhat.com>
3691 * name-lookup.c (lookup_using_decl): Clean up handling
3692 of dependency and inherited constructors.
3693 (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
3694 * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.
3696 2021-01-26 Jason Merrill <jason@redhat.com>
3699 * call.c (type_passed_as): Don't mark invisiref restrict.
3701 2021-01-26 Jason Merrill <jason@redhat.com>
3705 * class.c (layout_class_type): An empty field gets size 0.
3706 (is_empty_field): New.
3707 (check_bases): Check it.
3708 * cp-tree.h (is_empty_field): Declare it.
3709 * constexpr.c (cxx_eval_store_expression): Check it.
3710 (cx_check_missing_mem_inits): Likewise.
3711 * init.c (perform_member_init): Likewise.
3712 * typeck2.c (process_init_constructor_record): Likewise.
3714 2021-01-25 Martin Sebor <msebor@redhat.com>
3717 * cvt.c (cp_fold_convert): Propagate TREE_NO_WARNING.
3719 2021-01-25 Jason Merrill <jason@redhat.com>
3722 * constexpr.c (get_or_insert_ctor_field): Add check.
3723 (cxx_eval_store_expression): Handle discontinuity of refs.
3725 2021-01-23 Anthony Sharp <anthonysharp15@gmail.com>
3727 * call.c (complain_about_access): Altered function.
3728 * cp-tree.h (complain_about_access): Changed parameters of function.
3729 (get_parent_with_private_access): Declared new function.
3730 * search.c (get_parent_with_private_access): Defined new function.
3731 * semantics.c (enforce_access): Modified function.
3732 * typeck.c (complain_about_unrecognized_member): Updated function
3733 arguments in complain_about_access.
3735 2021-01-23 Patrick Palka <ppalka@redhat.com>
3738 * cp-tree.h (shared_member_p): Adjust declaration.
3739 * parser.c (cp_parser_init_declarator): If the storage class
3740 specifier is sc_static, pass true for static_p to
3741 cp_parser_declarator.
3742 (cp_parser_direct_declarator): Don't do inject_this_parm when
3743 the declarator is a friend.
3744 * search.c (shared_member_p): Change return type to bool and
3745 adjust function body accordingly. Return false for a dependent
3746 USING_DECL instead of aborting.
3747 * semantics.c (finish_qualified_id_expr): Rely on shared_member_p
3748 even when type-dependent.
3750 2021-01-22 Marek Polacek <polacek@redhat.com>
3753 * parser.c (inject_parm_decls): Remove a redundant assignment.
3754 (cp_parser_class_specifier_1): Clear current_class_{ptr,ref}
3755 before calling inject_parm_decls.
3757 2021-01-22 Jason Merrill <jason@redhat.com>
3760 * call.c (make_base_init_ok): Use DECL_HAS_VTT_PARM_P.
3762 2021-01-22 Jakub Jelinek <jakub@redhat.com>
3765 * init.c (build_zero_init_1): Revert the 2018-03-06 change to
3766 return build_zero_cst for reference types.
3767 * typeck2.c (process_init_constructor_record): Instead call
3768 build_zero_cst here during error recovery instead of build_zero_init.
3770 2021-01-22 Marek Polacek <polacek@redhat.com>
3773 * mangle.c (write_member_name): Emit abi_warn_or_compat_version_crosses
3774 warnings regardless of abi_version_at_least.
3775 (write_expression): When the expression is a dependent name
3776 and an operator name, write "on" before writing its name.
3778 2021-01-22 Marek Polacek <polacek@redhat.com>
3781 * pt.c (instantiate_class_template_1): Instantiate members
3782 marked with attribute used only after we're done instantiating
3785 2021-01-21 Patrick Palka <ppalka@redhat.com>
3788 * semantics.c (finish_decltype_type): Set up a cp_unevaluated
3789 sentinel at the start of the function. Remove a now-redundant
3790 manual adjustment of cp_unevaluated_operand.
3792 2021-01-21 Nathan Sidwell <nathan@acm.org>
3795 * module.cc (depset::hash::find_dependencies): Add
3797 (trees_out::core_vals): Check state before calling
3799 (sort_cluster, module_state::write): Adjust
3800 find_dependencies call.
3802 2021-01-21 Jakub Jelinek <jakub@redhat.com>
3805 * constexpr.c (check_for_return_continue_data): Add break_stmt member.
3806 (check_for_return_continue): Also look for BREAK_STMT. Handle
3807 SWITCH_STMT by ignoring break_stmt from its body.
3808 (potential_constant_expression_1) <case FOR_STMT>,
3809 <case WHILE_STMT>: If the condition isn't constant true, check if
3810 the loop body can contain a return stmt.
3811 <case SWITCH_STMT>: Adjust check_for_return_continue_data initializer.
3812 <case IF_STMT>: If recursion with tf_none is successful,
3813 merge *jump_target from the branches - returns with highest priority,
3814 breaks or continues lower. If then branch is potentially constant and
3815 doesn't return, check the else branch if it could return, break or
3818 2021-01-21 Nathan Sidwell <nathan@acm.org>
3821 * name-lookup.c (lookup_class_binding): Rearrange a stat-hack.
3823 2021-01-20 Nathan Sidwell <nathan@acm.org>
3825 * module.cc (bytes_in::i, bytes_in::wi): Avoid left shift of
3828 2021-01-20 Patrick Palka <ppalka@redhat.com>
3831 * pt.c (tsubst) <case TEMPLATE_TYPE_PARM>: If tsubsting
3832 CLASS_PLACEHOLDER_TEMPLATE yields a TEMPLATE_TEMPLATE_PARM,
3833 adjust to its TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
3835 2021-01-20 Patrick Palka <ppalka@redhat.com>
3838 * parser.c (cp_parser_class_head): Defer access checking when
3839 parsing the base-clause until all bases are seen and attached
3841 * pt.c (instantiate_class_template): Likewise when substituting
3842 into dependent bases.
3844 2021-01-20 Jakub Jelinek <jakub@redhat.com>
3847 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_DETACH>: If
3848 error_operand_p, remove clause without further checking. Check
3849 for non-NULL TYPE_NAME.
3851 2021-01-19 Marek Polacek <polacek@redhat.com>
3854 * pt.c (maybe_instantiate_noexcept): Return false if FN is
3857 2021-01-19 Marek Polacek <polacek@redhat.com>
3860 * name-lookup.c (push_using_decl_bindings): New, broken out of...
3861 (finish_nonmember_using_decl): ...here.
3862 * name-lookup.h (push_using_decl_bindings): Update declaration.
3863 * pt.c (tsubst_expr): Update the call to push_using_decl_bindings.
3865 2021-01-19 Patrick Palka <ppalka@redhat.com>
3869 * search.c (friend_accessible_p): If scope is a hidden friend
3870 defined inside a dependent class, consider access from the
3872 * parser.c (cp_parser_late_parsing_for_member): Don't push a
3873 dk_no_check access state.
3875 2021-01-19 Marek Polacek <polacek@redhat.com>
3878 * parser.c (cp_parser_class_specifier_1): Perform late-parsing
3879 of NSDMIs before late-parsing of noexcept-specifiers.
3881 2021-01-19 Nathan Sidwell <nathan@acm.org>
3883 * module.cc (identifier): Merge overloads.
3885 2021-01-19 Nathan Sidwell <nathan@acm.org>
3888 * module.cc (trees_out::write_location): Make static.
3890 2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com>
3892 * parser.c (cp_parser_omp_clause_detach): New.
3893 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH.
3894 (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH.
3895 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3896 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause.
3897 Prevent use of detach with mergeable and overriding the data sharing
3898 mode of the event handle.
3900 2021-01-15 Nathan Sidwell <nathan@acm.org>
3903 * tree.c (cp_build_qualified_type_real): Propagate an array's
3904 dependentness to the copy, if known.
3906 2021-01-15 Jason Merrill <jason@redhat.com>
3909 * call.c (unsafe_return_slot_p): Return int.
3910 (init_by_return_slot_p): Split out from...
3911 (unsafe_copy_elision_p): ...here.
3912 (unsafe_copy_elision_p_opt): New name for old meaning.
3913 (build_over_call): Adjust.
3914 (make_safe_copy_elision): New.
3915 * typeck2.c (split_nonconstant_init_1): Elide copy from safe
3916 list-initialization.
3917 * cp-tree.h: Adjust.
3919 2021-01-15 Jason Merrill <jason@redhat.com>
3921 * call.c (base_ctor_for, make_base_init_ok): New.
3922 (build_over_call): Use make_base_init_ok.
3924 2021-01-15 Jason Merrill <jason@redhat.com>
3927 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt
3928 if we got a CONSTRUCTOR.
3930 2021-01-15 Nathan Sidwell <nathan@acm.org>
3933 * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
3935 2021-01-14 Jason Merrill <jason@redhat.com>
3937 * typeck2.c (process_init_constructor_record): Use fldtype
3938 variable consistently.
3940 2021-01-14 Nathan Sidwell <nathan@acm.org>
3943 * tree.c (cp_tree_equal): Correct map_context logic.
3945 2021-01-13 Marek Polacek <polacek@redhat.com>
3948 * name-lookup.c (push_using_decl_bindings): New.
3949 * name-lookup.h (push_using_decl_bindings): Declare.
3950 * pt.c (tsubst_expr): Call push_using_decl_bindings.
3952 2021-01-13 Nathan Sidwell <nathan@acm.org>
3955 * module.cc (module_add_import_initializers): Pass a
3956 zero-element argument vector.
3958 2021-01-12 Patrick Palka <ppalka@redhat.com>
3961 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit
3962 the template of a CTAD placeholder.
3964 2021-01-12 Marek Polacek <polacek@redhat.com>
3967 * typeck2.c (process_init_constructor_record): Don't emit
3968 -Wmissing-field-initializers warnings in unevaluated contexts.
3970 2021-01-11 Jakub Jelinek <jakub@redhat.com>
3973 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
3975 (mark_abi_tags_r): Likewise.
3976 * decl2.c (min_vis_r): Likewise.
3977 * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
3980 2021-01-08 Patrick Palka <ppalka@redhat.com>
3983 * constexpr.c (cxx_eval_call_expression): Check CLASS_TYPE_P
3984 instead of AGGREGATE_TYPE_P before calling replace_result_decl.
3986 2021-01-08 Patrick Palka <ppalka@redhat.com>
3989 * semantics.c (check_accessibility_of_qualified_id): Punt if
3990 we're checking access of a scoped non-static member inside a
3993 2021-01-07 Jakub Jelinek <jakub@redhat.com>
3996 * pt.c (tsubst_copy) <case BIT_CAST_EXPR>: Don't call
3997 cp_build_bit_cast here, instead just build_min a BIT_CAST_EXPR and set
3999 (tsubst_copy_and_build): Handle BIT_CAST_EXPR.
4001 2021-01-07 Marek Polacek <polacek@redhat.com>
4004 * decl.c (grokdeclarator): Move the !funcdecl_p check inside the
4005 !late_return_type block.
4007 2021-01-07 Jason Merrill <jason@redhat.com>
4009 * constexpr.c (cxx_bind_parameters_in_call): Add comment.
4010 (cxx_eval_store_expression): Add comment.
4012 2021-01-07 Jason Merrill <jason@redhat.com>
4014 * call.c (has_next): Factor out from...
4015 (next_conversion): ...here.
4016 (strip_standard_conversion): And here.
4017 (is_subseq): And here.
4018 (build_conv): Check it.
4019 (standard_conversion): Don't call build_conv
4022 2021-01-06 Martin Sebor <msebor@redhat.com>
4025 * error.c (dump_expr): Call c_pretty_printer::unary_expression.
4027 2021-01-05 Patrick Palka <ppalka@redhat.com>
4029 * pt.c (unify) <case TEMPLATE_PARM_INDEX>: After walking into
4030 the type of the NTTP, substitute into the type again. If the
4031 type is still dependent, don't unify the NTTP.
4033 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4035 * Make-lang.in (cc1plus-checksum, cc1plus$(exeext): Add
4036 $(CODYLIB) after $(BACKEND).
4038 2021-01-05 Jakub Jelinek <jakub@redhat.com>
4041 * constexpr.c (cxx_eval_constant_expression) <case BIT_CAST_EXPR>:
4042 Punt if lval is true.
4043 * semantics.c (cp_build_bit_cast): Call get_target_expr_sfinae on
4044 the result if it has a class type.
4046 2021-01-05 Marek Polacek <polacek@redhat.com>
4049 * pt.c (resolve_overloaded_unification): Call
4050 maybe_instantiate_noexcept after instantiating the function
4053 2021-01-05 Nathan Sidwell <nathan@acm.org>
4055 * parser.c (cp_parser_module_declaration): Alter diagnostic
4056 text to say where is permissable.
4058 2021-01-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4061 * Make-lang.in (cc1plus$(exeext)): Add $(CODYLIB), $(NETLIBS).
4063 2021-01-02 Jan Hubicka <jh@suse.cz>
4065 * cp-tree.h (cp_tree_c_finish_parsing): Declare.
4066 * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing.
4067 * tree.c (cp_tree_c_finish_parsing): New function.
4069 2021-01-01 Jakub Jelinek <jakub@redhat.com>
4071 * ChangeLog-2020: Rotate ChangeLog. New file.
4074 Copyright (C) 2021 Free Software Foundation, Inc.
4076 Copying and distribution of this file, with or without modification,
4077 are permitted in any medium without royalty provided the copyright
4078 notice and this notice are preserved.