c++: Replace "C++2a" with "C++20".

C++20 isn't final quite yet, but all that remains is formalities, so let's
go ahead and change all the references.

I think for the next C++ standard we can just call it C++23 rather than
C++2b, since the committee has been consistent about time-based releases
rather than feature-based.

gcc/c-family/ChangeLog
2020-05-13  Jason Merrill  <jason@redhat.com>

	* c.opt (std=c++20): Make c++2a the alias.
	(std=gnu++20): Likewise.
	* c-common.h (cxx_dialect): Change cxx2a to cxx20.
	* c-opts.c: Adjust.
	* c-cppbuiltin.c: Adjust.
	* c-ubsan.c: Adjust.
	* c-warn.c: Adjust.

gcc/cp/ChangeLog
2020-05-13  Jason Merrill  <jason@redhat.com>

	* call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
	lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
	typeck2.c: Change cxx2a to cxx20.

libcpp/ChangeLog
2020-05-13  Jason Merrill  <jason@redhat.com>

	* include/cpplib.h (enum c_lang): Change CXX2A to CXX20.
	* init.c, lex.c: Adjust.
This commit is contained in:
Jason Merrill 2020-05-13 15:15:13 -04:00
parent c3cb34c632
commit b04445d4a8
467 changed files with 703 additions and 682 deletions

View File

@ -1,3 +1,13 @@
2020-05-13 Jason Merrill <jason@redhat.com>
* c.opt (std=c++20): Make c++2a the alias.
(std=gnu++20): Likewise.
* c-common.h (cxx_dialect): Change cxx2a to cxx20.
* c-opts.c: Adjust.
* c-cppbuiltin.c: Adjust.
* c-ubsan.c: Adjust.
* c-warn.c: Adjust.
2020-05-12 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (dump_ads): Output pragma Warnings ("U"); on entry.

View File

@ -324,7 +324,7 @@ static bool nonnull_check_p (tree, unsigned HOST_WIDE_INT);
ObjC is like C except that D_OBJC and D_CXX_OBJC are not set
C++ --std=c++98: D_CONLY | D_CXX11 | D_CXX20 | D_OBJC
C++ --std=c++11: D_CONLY | D_CXX20 | D_OBJC
C++ --std=c++2a: D_CONLY | D_OBJC
C++ --std=c++20: D_CONLY | D_OBJC
ObjC++ is like C++ except that D_OBJC is not set
If -fno-asm is used, D_ASM is added to the mask. If

View File

@ -720,8 +720,8 @@ enum cxx_dialect {
cxx14,
/* C++17 */
cxx17,
/* C++2a (C++20?) */
cxx2a
/* C++20 */
cxx20
};
/* The C++ dialect being used. C++98 is the default. */

View File

@ -988,7 +988,7 @@ c_cpp_builtins (cpp_reader *pfile)
}
if (cxx_dialect > cxx17)
{
/* Set feature test macros for C++2a. */
/* Set feature test macros for C++20. */
cpp_define (pfile, "__cpp_init_captures=201803L");
cpp_define (pfile, "__cpp_generic_lambdas=201707L");
cpp_define (pfile, "__cpp_designated_initializers=201707L");
@ -1006,7 +1006,7 @@ c_cpp_builtins (cpp_reader *pfile)
}
if (flag_concepts)
{
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
cpp_define (pfile, "__cpp_concepts=201907L");
else
cpp_define (pfile, "__cpp_concepts=201507L");

View File

@ -112,7 +112,7 @@ static void set_std_cxx98 (int);
static void set_std_cxx11 (int);
static void set_std_cxx14 (int);
static void set_std_cxx17 (int);
static void set_std_cxx2a (int);
static void set_std_cxx20 (int);
static void set_std_c89 (int, int);
static void set_std_c99 (int);
static void set_std_c11 (int);
@ -636,10 +636,10 @@ c_common_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
set_std_cxx17 (code == OPT_std_c__17 /* ISO */);
break;
case OPT_std_c__2a:
case OPT_std_gnu__2a:
case OPT_std_c__20:
case OPT_std_gnu__20:
if (!preprocessing_asm_p)
set_std_cxx2a (code == OPT_std_c__2a /* ISO */);
set_std_cxx20 (code == OPT_std_c__20 /* ISO */);
break;
case OPT_std_c90:
@ -925,11 +925,11 @@ c_common_post_options (const char **pfilename)
/* -Wcomma-subscript is enabled by default in C++20. */
SET_OPTION_IF_UNSET (&global_options, &global_options_set,
warn_comma_subscript,
cxx_dialect >= cxx2a && warn_deprecated);
cxx_dialect >= cxx20 && warn_deprecated);
/* -Wvolatile is enabled by default in C++20. */
SET_OPTION_IF_UNSET (&global_options, &global_options_set, warn_volatile,
cxx_dialect >= cxx2a && warn_deprecated);
cxx_dialect >= cxx20 && warn_deprecated);
/* Declone C++ 'structors if -Os. */
if (flag_declone_ctor_dtor == -1)
@ -1021,9 +1021,9 @@ c_common_post_options (const char **pfilename)
if (flag_sized_deallocation == -1)
flag_sized_deallocation = (cxx_dialect >= cxx14);
/* char8_t support is new in C++2A. */
/* char8_t support is new in C++20. */
if (flag_char8_t == -1)
flag_char8_t = (cxx_dialect >= cxx2a);
flag_char8_t = (cxx_dialect >= cxx20);
if (flag_extern_tls_init)
{
@ -1045,11 +1045,11 @@ c_common_post_options (const char **pfilename)
if (warn_return_type == -1 && c_dialect_cxx ())
warn_return_type = 1;
/* C++2a is the final version of concepts. We still use -fconcepts
/* C++20 is the final version of concepts. We still use -fconcepts
to know when concepts are enabled. Note that -fconcepts-ts can
be used to include additional features, although modified to
work with the standard. */
if (cxx_dialect >= cxx2a || flag_concepts_ts)
if (cxx_dialect >= cxx20 || flag_concepts_ts)
flag_concepts = 1;
else if (flag_concepts)
/* For -std=c++17 -fconcepts, imply -fconcepts-ts. */
@ -1724,9 +1724,9 @@ set_std_cxx17 (int iso)
/* Set the C++ 202a draft standard (without GNU extensions if ISO). */
static void
set_std_cxx2a (int iso)
set_std_cxx20 (int iso)
{
cpp_set_lang (parse_in, iso ? CLK_CXX2A: CLK_GNUCXX2A);
cpp_set_lang (parse_in, iso ? CLK_CXX20: CLK_GNUCXX20);
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
flag_iso = iso;
@ -1734,8 +1734,8 @@ set_std_cxx2a (int iso)
flag_isoc94 = 1;
flag_isoc99 = 1;
flag_isoc11 = 1;
/* C++2a includes concepts. */
cxx_dialect = cxx2a;
/* C++20 includes concepts. */
cxx_dialect = cxx20;
lang_hooks.name = "GNU C++17"; /* Pretend C++17 until standardization. */
}

View File

@ -137,9 +137,9 @@ ubsan_instrument_shift (location_t loc, enum tree_code code,
|| maybe_ne (GET_MODE_BITSIZE (TYPE_MODE (type0)),
TYPE_PRECISION (type0))
|| !sanitize_flags_p (SANITIZE_SHIFT_BASE)
/* In C++2a and later, shifts are well defined except when
/* In C++20 and later, shifts are well defined except when
the second operand is not within bounds. */
|| cxx_dialect >= cxx2a)
|| cxx_dialect >= cxx20)
;
/* For signed x << y, in C99/C11, the following:

View File

@ -2562,7 +2562,7 @@ diagnose_mismatched_attributes (tree olddecl, tree newdecl)
/* Warn if signed left shift overflows. We don't warn
about left-shifting 1 into the sign bit in C++14; cf.
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3367.html#1457>
and don't warn for C++2a at all, as signed left shifts never
and don't warn for C++20 at all, as signed left shifts never
overflow.
LOC is a location of the shift; OP0 and OP1 are the operands.
Return true if an overflow is detected, false otherwise. */
@ -2578,7 +2578,7 @@ maybe_warn_shift_overflow (location_t loc, tree op0, tree op1)
unsigned int prec0 = TYPE_PRECISION (type0);
/* Left-hand operand must be signed. */
if (TYPE_UNSIGNED (type0) || cxx_dialect >= cxx2a)
if (TYPE_UNSIGNED (type0) || cxx_dialect >= cxx20)
return false;
unsigned int min_prec = (wi::min_precision (wi::to_wide (op0), SIGNED)

View File

@ -2074,11 +2074,11 @@ C++ ObjC++
Conform to the ISO 2017 C++ standard.
std=c++2a
C++ ObjC++
C++ ObjC++ Alias(std=c++20) Undocumented
Conform to the ISO 2020 C++ draft standard (experimental and incomplete support).
std=c++20
C++ ObjC++ Alias(std=c++2a)
C++ ObjC++
Conform to the ISO 2020 C++ draft standard (experimental and incomplete support).
std=c11
@ -2152,11 +2152,11 @@ C++ ObjC++
Conform to the ISO 2017 C++ standard with GNU extensions.
std=gnu++2a
C++ ObjC++
C++ ObjC++ Alias(std=gnu++20)
Conform to the ISO 2020 C++ draft standard with GNU extensions (experimental and incomplete support).
std=gnu++20
C++ ObjC++ Alias(std=gnu++2a)
C++ ObjC++
Conform to the ISO 2020 C++ draft standard with GNU extensions (experimental and incomplete support).
std=gnu11

View File

@ -1,3 +1,9 @@
2020-05-13 Jason Merrill <jason@redhat.com>
* call.c, class.c, constexpr.c, constraint.cc, decl.c, init.c,
lambda.c, lex.c, method.c, name-lookup.c, parser.c, pt.c, tree.c,
typeck2.c: Change cxx2a to cxx20.
2020-05-12 Marek Polacek <polacek@redhat.com>
PR c++/95074

View File

@ -6041,7 +6041,7 @@ add_operator_candidates (z_candidate **candidates,
/* Maybe add C++20 rewritten comparison candidates. */
tree_code rewrite_code = ERROR_MARK;
if (cxx_dialect >= cxx2a
if (cxx_dialect >= cxx20
&& nargs == 2
&& (OVERLOAD_TYPE_P (arg1_type) || OVERLOAD_TYPE_P (arg2_type)))
switch (code)
@ -6599,7 +6599,7 @@ extract_call_expr (tree call)
call = TREE_OPERAND (call, 0);
if (TREE_CODE (call) == TARGET_EXPR)
call = TARGET_EXPR_INITIAL (call);
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
switch (TREE_CODE (call))
{
/* C++20 rewritten comparison operators. */
@ -7280,7 +7280,7 @@ maybe_inform_about_fndecl_for_bogus_argument_init (tree fn, int argnum)
static void
maybe_warn_array_conv (location_t loc, conversion *c, tree expr)
{
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
return;
tree type = TREE_TYPE (expr);
@ -7292,7 +7292,7 @@ maybe_warn_array_conv (location_t loc, conversion *c, tree expr)
if (conv_binds_to_array_of_unknown_bound (c))
pedwarn (loc, OPT_Wpedantic, "conversions to arrays of unknown bound "
"are only available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"are only available with %<-std=c++20%> or %<-std=gnu++20%>");
}
/* Perform the conversions in CONVS on the expression EXPR. FN and
@ -10251,7 +10251,7 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
the two. */
if (DECL_CONSTRUCTOR_P (fn)
&& !(flags & LOOKUP_ONLYCONVERTING)
&& cxx_dialect >= cxx2a
&& cxx_dialect >= cxx20
&& CP_AGGREGATE_TYPE_P (basetype)
&& !user_args->is_empty ())
{

View File

@ -5314,7 +5314,7 @@ trivial_default_constructor_is_constexpr (tree t)
struct S { int i; constexpr S() = default; };
should work. */
return (cxx_dialect >= cxx2a
return (cxx_dialect >= cxx20
|| is_really_empty_class (t, /*ignore_vptr*/true));
}
@ -5691,7 +5691,7 @@ finalize_literal_type_property (tree t)
CLASSTYPE_LITERAL_P (t) = false;
else if (CLASSTYPE_LITERAL_P (t)
&& TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
&& (cxx_dialect < cxx2a || !type_maybe_constexpr_destructor (t)))
&& (cxx_dialect < cxx20 || !type_maybe_constexpr_destructor (t)))
CLASSTYPE_LITERAL_P (t) = false;
else if (CLASSTYPE_LITERAL_P (t) && LAMBDA_TYPE_P (t))
CLASSTYPE_LITERAL_P (t) = (cxx_dialect >= cxx17);
@ -5745,7 +5745,7 @@ explain_non_literal_class (tree t)
inform (UNKNOWN_LOCATION,
" %qT is a closure type, which is only literal in "
"C++17 and later", t);
else if (cxx_dialect < cxx2a && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t))
else if (cxx_dialect < cxx20 && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t))
inform (UNKNOWN_LOCATION, " %q+T has a non-trivial destructor", t);
else if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
&& !type_maybe_constexpr_destructor (t))
@ -5893,7 +5893,7 @@ check_bases_and_members (tree t)
Again, other conditions for being an aggregate are checked
elsewhere. */
CLASSTYPE_NON_AGGREGATE (t)
|= ((cxx_dialect < cxx2a
|= ((cxx_dialect < cxx20
? type_has_user_provided_or_explicit_constructor (t)
: TYPE_HAS_USER_CONSTRUCTOR (t))
|| TYPE_POLYMORPHIC_P (t));
@ -7499,7 +7499,7 @@ finish_struct (tree t, tree attributes)
/* Remember current #pragma pack value. */
TYPE_PRECISION (t) = maximum_field_alignment;
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
{
if (!CLASSTYPE_NON_AGGREGATE (t)
&& type_has_user_provided_or_explicit_constructor (t))

View File

@ -768,7 +768,7 @@ static bool
cx_check_missing_mem_inits (tree ctype, tree body, bool complain)
{
/* We allow uninitialized bases/fields in C++20. */
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
return false;
unsigned nelts = 0;
@ -1723,7 +1723,7 @@ modifying_const_object_error (tree expr, tree obj)
static inline bool
cxx_replaceable_global_alloc_fn (tree fndecl)
{
return (cxx_dialect >= cxx2a
return (cxx_dialect >= cxx20
&& IDENTIFIER_NEWDEL_OP_P (DECL_NAME (fndecl))
&& CP_DECL_CONTEXT (fndecl) == global_namespace
&& (DECL_IS_REPLACEABLE_OPERATOR_NEW_P (fndecl)
@ -1736,7 +1736,7 @@ cxx_replaceable_global_alloc_fn (tree fndecl)
static inline bool
cxx_placement_new_fn (tree fndecl)
{
if (cxx_dialect >= cxx2a
if (cxx_dialect >= cxx20
&& IDENTIFIER_NEW_OP_P (DECL_NAME (fndecl))
&& CP_DECL_CONTEXT (fndecl) == global_namespace
&& !DECL_IS_REPLACEABLE_OPERATOR_NEW_P (fndecl)
@ -1789,7 +1789,7 @@ is_std_allocator_allocate (tree fndecl)
static inline bool
cxx_dynamic_cast_fn_p (tree fndecl)
{
return (cxx_dialect >= cxx2a
return (cxx_dialect >= cxx20
&& id_equal (DECL_NAME (fndecl), "__dynamic_cast")
&& CP_DECL_CONTEXT (fndecl) == global_namespace);
}
@ -2628,7 +2628,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
of value-initializing it. (reduced_constant_expression_p is expected to
take care of clearing the flag.) */
if (TREE_CODE (result) == CONSTRUCTOR
&& (cxx_dialect < cxx2a
&& (cxx_dialect < cxx20
|| !DECL_CONSTRUCTOR_P (fun)))
clear_no_implicit_zero (result);
@ -2661,11 +2661,11 @@ reduced_constant_expression_p (tree t)
if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
/* An initialized vector would have a VECTOR_CST. */
return false;
else if (cxx_dialect >= cxx2a
else if (cxx_dialect >= cxx20
/* An ARRAY_TYPE doesn't have any TYPE_FIELDS. */
&& TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
field = NULL_TREE;
else if (cxx_dialect >= cxx2a
else if (cxx_dialect >= cxx20
&& TREE_CODE (TREE_TYPE (t)) == UNION_TYPE)
{
if (CONSTRUCTOR_NELTS (t) == 0)
@ -2784,13 +2784,13 @@ cxx_eval_check_shift_p (location_t loc, const constexpr_ctx *ctx,
representable in the corresponding unsigned type of the result type,
then that value, converted to the result type, is the resulting value;
otherwise, the behavior is undefined.
For C++2a:
For C++20:
The value of E1 << E2 is the unique value congruent to E1 x 2^E2 modulo
2^N, where N is the range exponent of the type of the result. */
if (code == LSHIFT_EXPR
&& !TYPE_UNSIGNED (lhstype)
&& cxx_dialect >= cxx11
&& cxx_dialect < cxx2a)
&& cxx_dialect < cxx20)
{
if (tree_int_cst_sgn (lhs) == -1)
{
@ -4803,7 +4803,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
if (code == UNION_TYPE && CONSTRUCTOR_NELTS (*valp)
&& CONSTRUCTOR_ELT (*valp, 0)->index != index)
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
{
if (!ctx->quiet)
error_at (cp_expr_loc_or_input_loc (t),
@ -5422,7 +5422,7 @@ inline_asm_in_constexpr_error (location_t loc)
auto_diagnostic_group d;
error_at (loc, "inline assembly is not a constant expression");
inform (loc, "only unevaluated inline assembly is allowed in a "
"%<constexpr%> function in C++2a");
"%<constexpr%> function in C++20");
}
/* Attempt to reduce the expression T to a constant value.
@ -6582,7 +6582,7 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
type = TREE_TYPE (object);
else
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
return t;
if (TREE_CODE (t) != CALL_EXPR && TREE_CODE (t) != AGGR_INIT_EXPR)
return t;
@ -6595,7 +6595,7 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
is_consteval = true;
}
}
else if (cxx_dialect >= cxx2a
else if (cxx_dialect >= cxx20
&& (TREE_CODE (t) == CALL_EXPR
|| TREE_CODE (t) == AGGR_INIT_EXPR
|| TREE_CODE (t) == TARGET_EXPR))
@ -7422,7 +7422,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
/* Allow any built-in function; if the expansion
isn't constant, we'll deal with that then. */
&& !fndecl_built_in_p (fun)
/* In C++2a, replaceable global allocation functions
/* In C++20, replaceable global allocation functions
are constant expressions. */
&& (!cxx_replaceable_global_alloc_fn (fun)
|| TREE_CODE (t) != CALL_EXPR
@ -7844,12 +7844,12 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
return false;
case OBJ_TYPE_REF:
if (cxx_dialect >= cxx2a)
/* In C++2a virtual calls can be constexpr, don't give up yet. */
if (cxx_dialect >= cxx20)
/* In C++20 virtual calls can be constexpr, don't give up yet. */
return true;
else if (flags & tf_error)
error_at (loc,
"virtual functions cannot be %<constexpr%> before C++2a");
"virtual functions cannot be %<constexpr%> before C++20");
return false;
case TYPEID_EXPR:
@ -7857,7 +7857,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
class type can be constexpr. */
{
tree e = TREE_OPERAND (t, 0);
if (cxx_dialect < cxx2a
if (cxx_dialect < cxx20
&& strict
&& !TYPE_P (e)
&& !type_dependent_expression_p (e)
@ -8153,7 +8153,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
return true;
case COND_EXPR:
if (COND_EXPR_IS_VEC_DELETE (t) && cxx_dialect < cxx2a)
if (COND_EXPR_IS_VEC_DELETE (t) && cxx_dialect < cxx20)
{
if (flags & tf_error)
error_at (loc, "%<delete[]%> is not a constant expression");

View File

@ -1473,7 +1473,7 @@ finish_shorthand_constraint (tree decl, tree constr)
The standard behavior cannot be overridden by -fconcepts-ts. */
bool variadic_concept_p = template_parameter_pack_p (proto);
bool declared_pack_p = template_parameter_pack_p (decl);
bool apply_to_each_p = (cxx_dialect >= cxx2a) ? true : !variadic_concept_p;
bool apply_to_each_p = (cxx_dialect >= cxx20) ? true : !variadic_concept_p;
/* Get the argument and overload used for the requirement
and adjust it if we're going to expand later. */

View File

@ -928,7 +928,7 @@ static bool
function_requirements_equivalent_p (tree newfn, tree oldfn)
{
/* In the concepts TS, the combined constraints are compared. */
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
{
tree ci1 = get_constraints (oldfn);
tree ci2 = get_constraints (newfn);
@ -5570,7 +5570,7 @@ grok_reference_init (tree decl, tree type, tree init, int flags)
if (TREE_TYPE (init) == NULL_TREE
&& CP_AGGREGATE_TYPE_P (ttype)
&& !DECL_DECOMPOSITION_P (decl)
&& (cxx_dialect >= cxx2a))
&& (cxx_dialect >= cxx20))
{
/* We don't know yet if we should treat const A& r(1) as
const A& r{1}. */
@ -5896,7 +5896,7 @@ check_for_uninitialized_const_var (tree decl, bool constexpr_context_p,
&& (CP_TYPE_CONST_P (type)
/* C++20 permits trivial default initialization in constexpr
context (P1331R2). */
|| (cxx_dialect < cxx2a
|| (cxx_dialect < cxx20
&& (constexpr_context_p
|| var_in_constexpr_fn (decl))))
&& !DECL_NONTRIVIALLY_INITIALIZED_P (decl))
@ -5907,7 +5907,7 @@ check_for_uninitialized_const_var (tree decl, bool constexpr_context_p,
bool show_notes = true;
if (!constexpr_context_p || cxx_dialect >= cxx2a)
if (!constexpr_context_p || cxx_dialect >= cxx20)
{
if (CP_TYPE_CONST_P (type))
{
@ -6721,7 +6721,7 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
&& TREE_TYPE (init) == NULL_TREE
&& TREE_CODE (type) == ARRAY_TYPE
&& !DECL_DECOMPOSITION_P (decl)
&& (cxx_dialect >= cxx2a))
&& (cxx_dialect >= cxx20))
{
/* [dcl.init.string] "An array of ordinary character type [...]
can be initialized by an ordinary string literal [...] by an
@ -7186,14 +7186,14 @@ notice_forced_label_r (tree *tp, int *walk_subtrees, void *)
return NULL_TREE;
}
/* Return true if DECL has either a trivial destructor, or for C++2A
/* Return true if DECL has either a trivial destructor, or for C++20
is constexpr and has a constexpr destructor. */
static bool
decl_maybe_constant_destruction (tree decl, tree type)
{
return (TYPE_HAS_TRIVIAL_DESTRUCTOR (type)
|| (cxx_dialect >= cxx2a
|| (cxx_dialect >= cxx20
&& VAR_P (decl)
&& DECL_DECLARED_CONSTEXPR_P (decl)
&& type_has_constexpr_destructor (strip_array_types (type))));
@ -7253,7 +7253,7 @@ omp_declare_variant_finalize_one (tree decl, tree attr)
if (idk == CP_ID_KIND_UNQUALIFIED || idk == CP_ID_KIND_TEMPLATE_ID)
{
if (identifier_p (variant)
/* In C++2A, we may need to perform ADL for a template
/* In C++20, we may need to perform ADL for a template
name. */
|| (TREE_CODE (variant) == TEMPLATE_ID_EXPR
&& identifier_p (TREE_OPERAND (variant, 0))))
@ -11648,13 +11648,13 @@ grokdeclarator (const cp_declarator *declarator,
storage_class = sc_none;
staticp = 0;
}
if (constexpr_p && cxx_dialect < cxx2a)
if (constexpr_p && cxx_dialect < cxx20)
{
gcc_rich_location richloc (declspecs->locations[ds_virtual]);
richloc.add_range (declspecs->locations[ds_constexpr]);
pedwarn (&richloc, OPT_Wpedantic, "member %qD can be declared both "
"%<virtual%> and %<constexpr%> only in %<-std=c++2a%> or "
"%<-std=gnu++2a%>", dname);
"%<virtual%> and %<constexpr%> only in %<-std=c++20%> or "
"%<-std=gnu++20%>", dname);
}
}
friendp = decl_spec_seq_has_spec_p (declspecs, ds_friend);
@ -11741,10 +11741,10 @@ grokdeclarator (const cp_declarator *declarator,
if (consteval_p)
error_at (declspecs->locations[ds_consteval], "structured "
"binding declaration cannot be %qs", "consteval");
if (thread_p && cxx_dialect < cxx2a)
if (thread_p && cxx_dialect < cxx20)
pedwarn (declspecs->locations[ds_thread], 0,
"structured binding declaration can be %qs only in "
"%<-std=c++2a%> or %<-std=gnu++2a%>",
"%<-std=c++20%> or %<-std=gnu++20%>",
declspecs->gnu_thread_keyword_p
? "__thread" : "thread_local");
if (concept_p)
@ -11763,10 +11763,10 @@ grokdeclarator (const cp_declarator *declarator,
"register");
break;
case sc_static:
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
pedwarn (loc, 0,
"structured binding declaration can be %qs only in "
"%<-std=c++2a%> or %<-std=gnu++2a%>", "static");
"%<-std=c++20%> or %<-std=gnu++20%>", "static");
break;
case sc_extern:
error_at (loc, "structured binding declaration cannot be %qs",
@ -13206,11 +13206,11 @@ grokdeclarator (const cp_declarator *declarator,
"a destructor cannot be %qs", "concept");
return error_mark_node;
}
if (constexpr_p && cxx_dialect < cxx2a)
if (constexpr_p && cxx_dialect < cxx20)
{
error_at (declspecs->locations[ds_constexpr],
"%<constexpr%> destructors only available"
" with %<-std=c++2a%> or %<-std=gnu++2a%>");
" with %<-std=c++20%> or %<-std=gnu++20%>");
return error_mark_node;
}
if (consteval_p)

View File

@ -812,7 +812,7 @@ perform_member_init (tree member, tree init)
if (init && TREE_CODE (init) == TREE_LIST
&& (DIRECT_LIST_INIT_P (TREE_VALUE (init))
/* FIXME C++20 parenthesized aggregate init (PR 92812). */
|| !(/* cxx_dialect >= cxx2a ? CP_AGGREGATE_TYPE_P (type) */
|| !(/* cxx_dialect >= cxx20 ? CP_AGGREGATE_TYPE_P (type) */
/* : */CLASS_TYPE_P (type))))
init = build_x_compound_expr_from_list (init, ELK_MEM_INIT,
tf_warning_or_error);
@ -2909,7 +2909,7 @@ build_new_constexpr_heap_type (tree elt_type, tree cookie_size, tree full_size)
static tree
maybe_wrap_new_for_constexpr (tree alloc_call, tree elt_type, tree cookie_size)
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
return alloc_call;
if (current_function_decl != NULL_TREE
@ -3611,7 +3611,7 @@ build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts,
means allocate an int, and initialize it with 10.
In C++20, also handle `new A(1, 2)'. */
if (cxx_dialect >= cxx2a
if (cxx_dialect >= cxx20
&& AGGREGATE_TYPE_P (type)
&& (*init)->length () > 1)
{

View File

@ -702,7 +702,7 @@ add_default_capture (tree lambda_stack, tree id, tree initializer)
initializer = convert_from_reference (var);
/* Warn about deprecated implicit capture of this via [=]. */
if (cxx_dialect >= cxx2a
if (cxx_dialect >= cxx20
&& this_capture_p
&& LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda) == CPLD_COPY)
{

View File

@ -229,7 +229,7 @@ init_reswords (void)
if (cxx_dialect < cxx11)
mask |= D_CXX11;
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
mask |= D_CXX20;
if (!flag_concepts)
mask |= D_CXX_CONCEPTS;

View File

@ -1095,10 +1095,10 @@ early_check_defaulted_comparison (tree fn)
ctx = DECL_FRIEND_CONTEXT (fn);
bool ok = true;
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
{
error_at (loc, "defaulted %qD only available with %<-std=c++2a%> or "
"%<-std=gnu++2a%>", fn);
error_at (loc, "defaulted %qD only available with %<-std=c++20%> or "
"%<-std=gnu++20%>", fn);
return false;
}
@ -1802,7 +1802,7 @@ constructible_expr (tree to, tree from)
const int len = list_length (from);
if (len > 1)
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
/* Too many initializers. */
return error_mark_node;
@ -1831,7 +1831,7 @@ constructible_expr (tree to, tree from)
/* If t(e) didn't work, maybe t{e} will. */
if (expr == NULL_TREE
&& len == 1
&& cxx_dialect >= cxx2a)
&& cxx_dialect >= cxx20)
{
from = build_constructor_single (init_list_type_node, NULL_TREE,
from);
@ -2074,7 +2074,7 @@ walk_field_subobs (tree fields, special_function_kind sfk, tree fnname,
be constexpr, every member must have a user-provided default
constructor or an explicit initializer. */
if (constexpr_p
&& cxx_dialect < cxx2a
&& cxx_dialect < cxx20
&& !CLASS_TYPE_P (mem_type)
&& TREE_CODE (DECL_CONTEXT (field)) != UNION_TYPE)
{
@ -2226,11 +2226,11 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
/* "The closure type associated with a lambda-expression has a deleted
default constructor and a deleted copy assignment operator."
This is diagnosed in maybe_explain_implicit_delete.
In C++2a, only lambda-expressions with lambda-captures have those
In C++20, only lambda-expressions with lambda-captures have those
deleted. */
if (LAMBDA_TYPE_P (ctype)
&& (sfk == sfk_constructor || sfk == sfk_copy_assignment)
&& (cxx_dialect < cxx2a
&& (cxx_dialect < cxx20
|| LAMBDA_EXPR_CAPTURE_LIST (CLASSTYPE_LAMBDA_EXPR (ctype))
|| LAMBDA_EXPR_DEFAULT_CAPTURE_MODE
(CLASSTYPE_LAMBDA_EXPR (ctype)) != CPLD_NONE))
@ -2274,7 +2274,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (constexpr_p)
*constexpr_p = (SFK_CTOR_P (sfk)
|| (SFK_ASSIGN_P (sfk) && cxx_dialect >= cxx14)
|| (SFK_DTOR_P (sfk) && cxx_dialect >= cxx2a));
|| (SFK_DTOR_P (sfk) && cxx_dialect >= cxx20));
bool expected_trivial = type_has_trivial_fn (ctype, sfk);
if (trivial_p)

View File

@ -5635,19 +5635,19 @@ get_std_name_hint (const char *name)
{"make_any", "<any>", cxx17},
/* <array>. */
{"array", "<array>", cxx11},
{"to_array", "<array>", cxx2a},
{"to_array", "<array>", cxx20},
/* <atomic>. */
{"atomic", "<atomic>", cxx11},
{"atomic_flag", "<atomic>", cxx11},
{"atomic_ref", "<atomic>", cxx2a},
{"atomic_ref", "<atomic>", cxx20},
/* <bitset>. */
{"bitset", "<bitset>", cxx11},
/* <compare> */
{"weak_equality", "<compare>", cxx2a},
{"strong_equality", "<compare>", cxx2a},
{"partial_ordering", "<compare>", cxx2a},
{"weak_ordering", "<compare>", cxx2a},
{"strong_ordering", "<compare>", cxx2a},
{"weak_equality", "<compare>", cxx20},
{"strong_equality", "<compare>", cxx20},
{"partial_ordering", "<compare>", cxx20},
{"weak_ordering", "<compare>", cxx20},
{"strong_ordering", "<compare>", cxx20},
/* <complex>. */
{"complex", "<complex>", cxx98},
{"complex_literals", "<complex>", cxx14},
@ -5670,17 +5670,17 @@ get_std_name_hint (const char *name)
{"ofstream", "<fstream>", cxx98},
/* <functional>. */
{"bind", "<functional>", cxx11},
{"bind_front", "<functional>", cxx2a},
{"bind_front", "<functional>", cxx20},
{"function", "<functional>", cxx11},
{"hash", "<functional>", cxx11},
{"invoke", "<functional>", cxx17},
{"mem_fn", "<functional>", cxx11},
{"not_fn", "<functional>", cxx17},
{"reference_wrapper", "<functional>", cxx11},
{"unwrap_reference", "<functional>", cxx2a},
{"unwrap_reference_t", "<functional>", cxx2a},
{"unwrap_ref_decay", "<functional>", cxx2a},
{"unwrap_ref_decay_t", "<functional>", cxx2a},
{"unwrap_reference", "<functional>", cxx20},
{"unwrap_reference_t", "<functional>", cxx20},
{"unwrap_ref_decay", "<functional>", cxx20},
{"unwrap_ref_decay_t", "<functional>", cxx20},
/* <future>. */
{"async", "<future>", cxx11},
{"future", "<future>", cxx11},
@ -5763,7 +5763,7 @@ get_std_name_hint (const char *name)
{"shared_mutex", "<shared_mutex>", cxx17},
{"shared_timed_mutex", "<shared_mutex>", cxx14},
/* <source_location>. */
{"source_location", "<source_location>", cxx2a},
{"source_location", "<source_location>", cxx20},
/* <sstream>. */
{"basic_stringbuf", "<sstream>", cxx98},
{"basic_istringstream", "<sstream>", cxx98},
@ -5778,7 +5778,7 @@ get_std_name_hint (const char *name)
{"basic_string", "<string>", cxx98},
{"string", "<string>", cxx98},
{"wstring", "<string>", cxx98},
{"u8string", "<string>", cxx2a},
{"u8string", "<string>", cxx20},
{"u16string", "<string>", cxx11},
{"u32string", "<string>", cxx11},
/* <string_view>. */
@ -5804,10 +5804,10 @@ get_std_name_hint (const char *name)
{"enable_if_t", "<type_traits>", cxx14},
{"invoke_result", "<type_traits>", cxx17},
{"invoke_result_t", "<type_traits>", cxx17},
{"remove_cvref", "<type_traits>", cxx2a},
{"remove_cvref_t", "<type_traits>", cxx2a},
{"type_identity", "<type_traits>", cxx2a},
{"type_identity_t", "<type_traits>", cxx2a},
{"remove_cvref", "<type_traits>", cxx20},
{"remove_cvref_t", "<type_traits>", cxx20},
{"type_identity", "<type_traits>", cxx20},
{"type_identity_t", "<type_traits>", cxx20},
{"void_t", "<type_traits>", cxx17},
{"conjunction", "<type_traits>", cxx17},
{"conjunction_v", "<type_traits>", cxx17},
@ -5859,8 +5859,8 @@ get_cxx_dialect_name (enum cxx_dialect dialect)
return "C++14";
case cxx17:
return "C++17";
case cxx2a:
return "C++2a";
case cxx20:
return "C++20";
}
}

View File

@ -1809,7 +1809,7 @@ enum
constexpr. */
CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR = 0x8,
/* When parsing a decl-specifier-seq, only allow mutable, constexpr or
for C++2A consteval. */
for C++20 consteval. */
CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR = 0x10,
/* When parsing a decl-specifier-seq, allow missing typename. */
CP_PARSER_FLAGS_TYPENAME_OPTIONAL = 0x20,
@ -3369,11 +3369,11 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id,
&& id_equal (id, "thread_local"))
inform (location, "C++11 %<thread_local%> only available with "
"%<-std=c++11%> or %<-std=gnu++11%>");
else if (cxx_dialect < cxx2a && id == ridpointers[(int)RID_CONSTINIT])
else if (cxx_dialect < cxx20 && id == ridpointers[(int)RID_CONSTINIT])
inform (location, "C++20 %<constinit%> only available with "
"%<-std=c++2a%> or %<-std=gnu++2a%>");
"%<-std=c++20%> or %<-std=gnu++20%>");
else if (!flag_concepts && id == ridpointers[(int)RID_CONCEPT])
inform (location, "%<concept%> only available with %<-std=c++2a%> or "
inform (location, "%<concept%> only available with %<-std=c++20%> or "
"%<-fconcepts%>");
else if (!flag_concepts && id == ridpointers[(int)RID_REQUIRES])
inform (location, "%<requires%> only available with %<-std=c++2a%> or "
@ -7362,7 +7362,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
|| idk == CP_ID_KIND_TEMPLATE_ID)
{
if (identifier_p (postfix_expression)
/* In C++2A, we may need to perform ADL for a template
/* In C++20, we may need to perform ADL for a template
name. */
|| (TREE_CODE (postfix_expression) == TEMPLATE_ID_EXPR
&& identifier_p (TREE_OPERAND (postfix_expression, 0))))
@ -10510,7 +10510,7 @@ cp_parser_lambda_expression (cp_parser* parser)
LAMBDA_EXPR_LOCATION (lambda_expr) = token->location;
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
/* C++20 allows lambdas in unevaluated context. */;
else if (cp_unevaluated_operand)
{
@ -10518,7 +10518,7 @@ cp_parser_lambda_expression (cp_parser* parser)
{
error_at (LAMBDA_EXPR_LOCATION (lambda_expr),
"lambda-expression in unevaluated context"
" only available with %<-std=c++2a%> or %<-std=gnu++2a%>");
" only available with %<-std=c++20%> or %<-std=gnu++20%>");
token->error_reported = true;
}
ok = false;
@ -10528,7 +10528,7 @@ cp_parser_lambda_expression (cp_parser* parser)
if (!token->error_reported)
{
error_at (token->location, "lambda-expression in template-argument"
" only available with %<-std=c++2a%> or %<-std=gnu++2a%>");
" only available with %<-std=c++20%> or %<-std=gnu++20%>");
token->error_reported = true;
}
ok = false;
@ -10714,7 +10714,7 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_THIS))
{
location_t loc = cp_lexer_peek_token (parser->lexer)->location;
if (cxx_dialect < cxx2a
if (cxx_dialect < cxx20
&& LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda_expr) == CPLD_COPY)
pedwarn (loc, 0, "explicit by-copy capture of %<this%> redundant "
"with by-copy capture default");
@ -10774,9 +10774,9 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
if (cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
{
ellipsis_loc = cp_lexer_peek_token (parser->lexer)->location;
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
pedwarn (ellipsis_loc, 0, "pack init-capture only available with "
"%<-std=c++2a%> or %<-std=gnu++2a%>");
"%<-std=c++20%> or %<-std=gnu++20%>");
cp_lexer_consume_token (parser->lexer);
init_pack_expansion = true;
}
@ -10993,10 +10993,10 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
pedwarn (parser->lexer->next_token->location, 0,
"lambda templates are only available with "
"%<-std=c++14%> or %<-std=gnu++14%>");
else if (cxx_dialect < cxx2a)
else if (cxx_dialect < cxx20)
pedwarn (parser->lexer->next_token->location, OPT_Wpedantic,
"lambda templates are only available with "
"%<-std=c++2a%> or %<-std=gnu++2a%>");
"%<-std=c++20%> or %<-std=gnu++20%>");
cp_lexer_consume_token (parser->lexer);
@ -11030,7 +11030,7 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
bool is_consteval = false;
/* For C++20, before parsing the parameter list check if there is
a consteval specifier in the corresponding decl-specifier-seq. */
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
{
for (size_t n = cp_parser_skip_balanced_tokens (parser, 1);
cp_lexer_nth_token_is (parser->lexer, n, CPP_KEYWORD); n++)
@ -12970,11 +12970,11 @@ cp_parser_init_statement (cp_parser *parser, tree *decl)
/* That didn't work, try to parse it as an expression-statement. */
cp_parser_expression_statement (parser, NULL_TREE);
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
{
pedwarn (cp_lexer_peek_token (parser->lexer)->location, 0,
"range-based %<for%> loops with initializer only "
"available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"available with %<-std=c++20%> or %<-std=gnu++20%>");
*decl = error_mark_node;
}
}
@ -14486,7 +14486,7 @@ cp_parser_storage_class_specifier_opt (cp_parser* parser)
virtual
explicit
C++2A Extension:
C++20 Extension:
explicit(constant-expression)
Returns an IDENTIFIER_NODE corresponding to the keyword used.
@ -14530,10 +14530,10 @@ cp_parser_function_specifier_opt (cp_parser* parser,
parser->type_definition_forbidden_message
= G_("types may not be defined in explicit-specifier");
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
pedwarn (token->location, 0,
"%<explicit(bool)%> only available with %<-std=c++2a%> "
"or %<-std=gnu++2a%>");
"%<explicit(bool)%> only available with %<-std=c++20%> "
"or %<-std=gnu++20%>");
/* Parse the constant-expression. */
expr = cp_parser_constant_expression (parser);
@ -16682,12 +16682,12 @@ cp_parser_template_id (cp_parser *parser,
/* This didn't go well. */
if (TREE_CODE (templ) == FUNCTION_DECL)
{
/* C++2A says that "function-name < a;" is now ill-formed. */
/* C++20 says that "function-name < a;" is now ill-formed. */
if (cp_parser_error_occurred (parser))
{
error_at (token->location, "invalid template-argument-list");
inform (token->location, "function name as the left hand "
"operand of %<<%> is ill-formed in C++2a; wrap the "
"operand of %<<%> is ill-formed in C++20; wrap the "
"function name in %<()%>");
}
else
@ -17391,7 +17391,7 @@ cp_parser_template_argument (cp_parser* parser)
else
{
/* In C++20, we can encounter a braced-init-list. */
if (cxx_dialect >= cxx2a
if (cxx_dialect >= cxx20
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
bool expr_non_constant_p;
@ -18112,7 +18112,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
{
bool qualified_p;
bool global_p;
const bool typename_p = (cxx_dialect >= cxx2a
const bool typename_p = (cxx_dialect >= cxx20
&& (flags & CP_PARSER_FLAGS_TYPENAME_OPTIONAL));
/* Don't gobble tokens or issue error messages if this is an
@ -18378,7 +18378,7 @@ cp_parser_placeholder_type_specifier (cp_parser *parser, location_t loc,
/* As per the standard, require auto or decltype(auto), except in some
cases (template parameter lists, -fconcepts-ts enabled). */
cp_token *placeholder = NULL, *close_paren = NULL;
if (cxx_dialect >= cxx2a)
if (cxx_dialect >= cxx20)
{
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_AUTO))
placeholder = cp_lexer_consume_token (parser->lexer);
@ -19631,10 +19631,10 @@ cp_parser_namespace_definition (cp_parser* parser)
RID_INLINE);
if (nested_inline_p && nested_definition_count != 0)
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
pedwarn (cp_lexer_peek_token (parser->lexer)->location,
OPT_Wpedantic, "nested inline namespace definitions only "
"available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"available with %<-std=c++20%> or %<-std=gnu++20%>");
cp_lexer_consume_token (parser->lexer);
}
@ -20187,13 +20187,13 @@ cp_parser_asm_definition (cp_parser* parser)
/* Look for the `asm' keyword. */
cp_parser_require_keyword (parser, RID_ASM, RT_ASM);
/* In C++2a, unevaluated inline assembly is permitted in constexpr
/* In C++20, unevaluated inline assembly is permitted in constexpr
functions. */
if (parser->in_function_body
&& DECL_DECLARED_CONSTEXPR_P (current_function_decl)
&& (cxx_dialect < cxx2a))
&& (cxx_dialect < cxx20))
pedwarn (asm_loc, 0, "%<asm%> in %<constexpr%> function only available "
"with %<-std=c++2a%> or %<-std=gnu++2a%>");
"with %<-std=c++20%> or %<-std=gnu++20%>");
/* Handle the asm-qualifier-list. */
location_t volatile_loc = UNKNOWN_LOCATION;
@ -21600,7 +21600,7 @@ cp_parser_direct_declarator (cp_parser* parser,
- it is a decl-specifier of the decl-specifier-seq of a
parameter-declaration in a declarator of a function or
function template declaration, ... */
if (cxx_dialect >= cxx2a
if (cxx_dialect >= cxx20
&& (flags & CP_PARSER_FLAGS_TYPENAME_OPTIONAL)
&& declarator->kind == cdk_id
&& !at_class_scope_p ()
@ -23082,16 +23082,16 @@ cp_parser_ctor_initializer_opt_and_function_body (cp_parser *parser,
if (in_function_try_block
&& DECL_DECLARED_CONSTEXPR_P (current_function_decl)
&& cxx_dialect < cxx2a)
&& cxx_dialect < cxx20)
{
if (DECL_CONSTRUCTOR_P (current_function_decl))
pedwarn (input_location, 0,
"function-try-block body of %<constexpr%> constructor only "
"available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"available with %<-std=c++20%> or %<-std=gnu++20%>");
else
pedwarn (input_location, 0,
"function-try-block body of %<constexpr%> function only "
"available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"available with %<-std=c++20%> or %<-std=gnu++20%>");
}
/* Begin the function body. */
@ -23351,7 +23351,7 @@ cp_parser_array_designator_p (cp_parser *parser)
initializer-clause ... [opt]
initializer-list , initializer-clause ... [opt]
C++2A Extension:
C++20 Extension:
designated-initializer-list:
designated-initializer-clause
@ -23403,8 +23403,8 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p,
bool clause_non_constant_p;
location_t loc = cp_lexer_peek_token (parser->lexer)->location;
/* Handle the C++2A syntax, '. id ='. */
if ((cxx_dialect >= cxx2a
/* Handle the C++20 syntax, '. id ='. */
if ((cxx_dialect >= cxx20
|| cp_parser_allow_gnu_extensions_p (parser))
&& cp_lexer_next_token_is (parser->lexer, CPP_DOT)
&& cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_NAME
@ -23412,10 +23412,10 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p,
|| (cp_lexer_peek_nth_token (parser->lexer, 3)->type
== CPP_OPEN_BRACE)))
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
pedwarn (loc, OPT_Wpedantic,
"C++ designated initializers only available with "
"%<-std=c++2a%> or %<-std=gnu++2a%>");
"%<-std=c++20%> or %<-std=gnu++20%>");
/* Consume the `.'. */
cp_lexer_consume_token (parser->lexer);
/* Consume the identifier. */
@ -23482,7 +23482,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p,
first_designator = designator;
first_p = false;
}
else if (cxx_dialect >= cxx2a
else if (cxx_dialect >= cxx20
&& first_designator != error_mark_node
&& (!first_designator != !designator))
{
@ -23490,7 +23490,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p,
"or none of them should be");
first_designator = error_mark_node;
}
else if (cxx_dialect < cxx2a && !first_designator)
else if (cxx_dialect < cxx20 && !first_designator)
first_designator = designator;
/* Parse the initializer. */
@ -23509,7 +23509,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p,
/* Consume the `...'. */
cp_lexer_consume_token (parser->lexer);
if (designator && cxx_dialect >= cxx2a)
if (designator && cxx_dialect >= cxx20)
error_at (loc,
"%<...%> not allowed in designated initializer list");
@ -25111,7 +25111,7 @@ cp_parser_member_declaration (cp_parser* parser)
width = cp_parser_constant_expression (parser, false, NULL,
cxx_dialect >= cxx11);
/* In C++2A and as extension for C++11 and above we allow
/* In C++20 and as extension for C++11 and above we allow
default member initializers for bit-fields. */
initializer = NULL_TREE;
if (cxx_dialect >= cxx11
@ -25121,12 +25121,12 @@ cp_parser_member_declaration (cp_parser* parser)
{
location_t loc
= cp_lexer_peek_token (parser->lexer)->location;
if (cxx_dialect < cxx2a
if (cxx_dialect < cxx20
&& identifier != NULL_TREE)
pedwarn (loc, 0,
"default member initializers for bit-fields "
"only available with %<-std=c++2a%> or "
"%<-std=gnu++2a%>");
"only available with %<-std=c++20%> or "
"%<-std=gnu++20%>");
initializer = cp_parser_save_nsdmi (parser);
if (identifier == NULL_TREE)
@ -26084,10 +26084,10 @@ cp_parser_try_block (cp_parser* parser)
cp_parser_require_keyword (parser, RID_TRY, RT_TRY);
if (parser->in_function_body
&& DECL_DECLARED_CONSTEXPR_P (current_function_decl)
&& cxx_dialect < cxx2a)
&& cxx_dialect < cxx20)
pedwarn (input_location, 0,
"%<try%> in %<constexpr%> function only "
"available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"available with %<-std=c++20%> or %<-std=gnu++20%>");
try_block = begin_try_block ();
cp_parser_compound_statement (parser, NULL, BCS_TRY_BLOCK, false);
@ -27705,7 +27705,7 @@ cp_parser_requires_clause_opt (cp_parser *parser, bool lambda_p)
{
error_at (cp_lexer_peek_token (parser->lexer)->location,
"%<requires%> only available with "
"%<-std=c++2a%> or %<-fconcepts%>");
"%<-std=c++20%> or %<-fconcepts%>");
/* Parse and discard the requires-clause. */
cp_lexer_consume_token (parser->lexer);
cp_parser_constraint_expression (parser);
@ -28035,7 +28035,7 @@ cp_parser_compound_requirement (cp_parser *parser)
bool saved_result_type_constraint_p = parser->in_result_type_constraint_p;
parser->in_result_type_constraint_p = true;
/* C++2a allows either a type-id or a type-constraint. Parsing
/* C++20 allows either a type-id or a type-constraint. Parsing
a type-id will subsume the parsing for a type-constraint but
allow for more syntactic forms (e.g., const C<T>*). */
type = cp_parser_trailing_type_id (parser);
@ -29049,7 +29049,7 @@ cp_parser_template_declaration_after_parameters (cp_parser* parser,
else if (cxx_dialect >= cxx11
&& cp_lexer_next_token_is_keyword (parser->lexer, RID_USING))
decl = cp_parser_alias_declaration (parser);
else if (cxx_dialect >= cxx2a /* Implies flag_concept. */
else if (cxx_dialect >= cxx20 /* Implies flag_concept. */
&& cp_lexer_next_token_is_keyword (parser->lexer, RID_CONCEPT)
&& !cp_lexer_nth_token_is_keyword (parser->lexer, 2, RID_BOOL))
/* Allow 'concept bool' to be handled as per the TS. */

View File

@ -3490,7 +3490,7 @@ template_heads_equivalent_p (const_tree tmpl1, const_tree tmpl2)
tree parms2 = DECL_TEMPLATE_PARMS (tmpl2);
/* Don't change the matching rules for pre-C++20. */
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
return comp_template_parms (parms1, parms2);
/* ... have the same number of template parameters, and their
@ -5776,7 +5776,7 @@ push_template_decl_real (tree decl, bool is_friend)
else if (VAR_P (decl))
/* C++14 variable template. */;
else if (TREE_CODE (decl) == CONCEPT_DECL)
/* C++2a concept definitions. */;
/* C++20 concept definitions. */;
else
{
error ("template declaration of %q#D", decl);
@ -9070,7 +9070,7 @@ coerce_innermost_template_parms (tree parms,
static bool
class_nttp_const_wrapper_p (tree t)
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
return false;
return (TREE_CODE (t) == VIEW_CONVERT_EXPR
&& CP_TYPE_CONST_P (TREE_TYPE (t))
@ -26137,11 +26137,11 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return false;
else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
{
if (CLASS_PLACEHOLDER_TEMPLATE (type) && cxx_dialect < cxx2a)
if (CLASS_PLACEHOLDER_TEMPLATE (type) && cxx_dialect < cxx20)
{
if (complain & tf_error)
error ("non-type template parameters of deduced class type only "
"available with %<-std=c++2a%> or %<-std=gnu++2a%>");
"available with %<-std=c++20%> or %<-std=gnu++20%>");
return true;
}
return false;
@ -26159,11 +26159,11 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return false;
else if (CLASS_TYPE_P (type))
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
{
if (complain & tf_error)
error ("non-type template parameters of class type only available "
"with %<-std=c++2a%> or %<-std=gnu++2a%>");
"with %<-std=c++20%> or %<-std=gnu++20%>");
return true;
}
if (dependent_type_p (type))
@ -28383,7 +28383,7 @@ is_spec_or_derived (tree etype, tree tmpl)
static tree
maybe_aggr_guide (tree tmpl, tree init, vec<tree,va_gc> *args)
{
if (cxx_dialect < cxx2a)
if (cxx_dialect < cxx20)
return NULL_TREE;
if (init == NULL_TREE)
@ -28750,12 +28750,12 @@ do_class_deduction (tree ptype, tree tmpl, tree init,
error ("non-deducible template %qT used without template arguments", tmpl);
return error_mark_node;
}
else if (cxx_dialect < cxx2a && DECL_ALIAS_TEMPLATE_P (tmpl))
else if (cxx_dialect < cxx20 && DECL_ALIAS_TEMPLATE_P (tmpl))
{
/* This doesn't affect conforming C++17 code, so just pedwarn. */
if (complain & tf_warning_or_error)
pedwarn (input_location, 0, "alias template deduction only available "
"with %<-std=c++2a%> or %<-std=gnu++2a%>");
"with %<-std=c++20%> or %<-std=gnu++20%>");
}
if (init && TREE_TYPE (init) == ptype)

View File

@ -691,7 +691,7 @@ build_cplus_new (tree type, tree init, tsubst_flags_t complain)
it can produce a { }. */
if (BRACE_ENCLOSED_INITIALIZER_P (init))
{
gcc_assert (cxx_dialect >= cxx2a);
gcc_assert (cxx_dialect >= cxx20);
return finish_compound_literal (type, init, complain);
}
@ -4599,7 +4599,7 @@ handle_nodiscard_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
/* Handle a C++2a "no_unique_address" attribute; arguments as in
/* Handle a C++20 "no_unique_address" attribute; arguments as in
struct attribute_spec.handler. */
static tree
handle_no_unique_addr_attribute (tree* node,

View File

@ -1102,7 +1102,7 @@ check_narrowing (tree type, tree init, tsubst_flags_t complain,
return ok;
}
/* True iff TYPE is a C++2a "ordinary" character type. */
/* True iff TYPE is a C++20 "ordinary" character type. */
bool
ordinary_char_type_p (tree type)
@ -2236,7 +2236,7 @@ build_m_component_ref (tree datum, tree component, tsubst_flags_t complain)
{
/* 5.5/6: In a .* expression whose object expression is an rvalue, the
program is ill-formed if the second operand is a pointer to member
function with ref-qualifier & (for C++2A: unless its cv-qualifier-seq
function with ref-qualifier & (for C++20: unless its cv-qualifier-seq
is const). In a .* expression whose object expression is an lvalue,
the program is ill-formed if the second operand is a pointer to member
function with ref-qualifier &&. */
@ -2261,12 +2261,12 @@ build_m_component_ref (tree datum, tree component, tsubst_flags_t complain)
"an lvalue", ptrmem_type);
return error_mark_node;
}
else if (cxx_dialect < cxx2a)
else if (cxx_dialect < cxx20)
{
if (complain & tf_warning_or_error)
pedwarn (input_location, OPT_Wpedantic,
"pointer-to-member-function type %qT requires "
"an lvalue before C++2a", ptrmem_type);
"an lvalue before C++20", ptrmem_type);
else
return error_mark_node;
}

View File

@ -13609,7 +13609,7 @@ generic_parameter_die (tree parm, tree arg,
dw_die_ref tmpl_die = NULL;
const char *name = NULL;
/* C++2a accepts class literals as template parameters, and var
/* C++20 accepts class literals as template parameters, and var
decls with initializers represent them. The VAR_DECLs would be
rejected, but we can take the DECL_INITIAL constructor and
attempt to expand it. */

View File

@ -1,15 +1,15 @@
// { dg-do compile { target c++11 } }
struct A {
A () = delete; // { dg-message "declared here" "" { target c++2a } }
A () = delete; // { dg-message "declared here" "" { target c++20 } }
};
struct B {
B () = default;
int b = 0;
};
struct C {
C (C&&) = default; // { dg-message "candidate" "" { target c++2a } }
C (C&&) = default; // { dg-message "candidate" "" { target c++20 } }
int c, d;
};
A a {}; // { dg-error "use of deleted function" "" { target c++2a } }
B b = {1}; // { dg-error "could not convert" "" { target { c++11_only || c++2a } } }
C *c = new C {2, 3}; // { dg-error "no matching function for call to" "" { target c++2a } }
A a {}; // { dg-error "use of deleted function" "" { target c++20 } }
B b = {1}; // { dg-error "could not convert" "" { target { c++11_only || c++20 } } }
C *c = new C {2, 3}; // { dg-error "no matching function for call to" "" { target c++20 } }

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-options "-Wpedantic" }
// Test flexible array member. Here we're binding int[] to int[]. This worked

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-options "-Wpedantic" }
int arr[1] = { 42 };

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename T> void foo(T);

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
void f(const int(*)[]);
void fb(const int(*)[3]);

View File

@ -1,5 +1,5 @@
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
int f(int, int const(&)[2]) { return 1; }
int f(double, int const(&)[2]) { return 2; }

View File

@ -1,5 +1,5 @@
// PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
using P = int *(*)[3];
using S = const int *const (*)[];

View File

@ -1,5 +1,5 @@
// PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// As conversion/qual1.C, but with [].

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
struct A {
A();

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
// Ranking of reference initialization conversions

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// Ranking of reference initialization conversions

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
// Ranking of list-initialization sequences
int b(int (&&)[] ) { return 1; } // #1

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
// Ranking of reference initialization conversions

View File

@ -1,5 +1,5 @@
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
int f(int const(&)[]) { return 1; }
int f(int const(&)[2]) { return 2; }

View File

@ -1,5 +1,5 @@
// PR c++/69531 - DR 1307, Overload resolution based on size of array init-list.
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
// Example from [over.ics.rank].
int f(int (&&)[] ) { return 1; } // #1

View File

@ -1,5 +1,5 @@
// PR c++/91364 - Implement P0388R4: Permit conversions to arrays of unknown bound.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
int arr[1];
extern int arr2[];

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-additional-options -fdump-tree-gimple }
// { dg-final { scan-tree-dump-times "hot label" 5 "gimple" } }
// { dg-final { scan-tree-dump-times "cold label" 3 "gimple" } }

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
bool b;
int main()

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
[[likely]] void f() { } // { dg-warning "function" }

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
int a, b, c;

View File

@ -1,5 +1,5 @@
// Testcase from P1816R0
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename T>
struct S {

View File

@ -1,5 +1,5 @@
// Test that non-aggregates don't get the aggregate deduction.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-prune-output "no matching function" }
struct A { A(); };

View File

@ -1,5 +1,5 @@
// Testcase from P1814R0
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T> struct identity { using type = T; };
template <class T> using identity_t = typename identity<T>::type;

View File

@ -1,6 +1,6 @@
// Test that a non-template deduction guide that doesn't match the alias is
// ignored.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T> struct identity { using type = T; };
template <class T> using identity_t = typename identity<T>::type;

View File

@ -8,19 +8,19 @@ struct S {
void
fn (int *a, int b, int c)
{
a[b,c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
a[b,c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[(b,c)];
a[(void) b, c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
a[(void) b, c]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[((void) b, c)];
a[(void) b, (void) c, (void) b, b]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
a[(void) b, (void) c, (void) b, b]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[((void) b, (void) c, (void) b, b)];
a[S(), 10]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
a[S(), 10]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[(S(), 10)];
a[int{(1,2)}];
a[int{(1,2)}, int{}]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++2a } }
a[int{(1,2)}, int{}]; // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20 } }
a[(int{(1,2)}, int{})];
}

View File

@ -1,5 +1,5 @@
// PR c++/91338 - P1161R3: Deprecate a[b,c].
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-options "-Wno-comma-subscript" }
struct S {

View File

@ -1,5 +1,5 @@
// PR c++/91338 - P1161R3: Deprecate a[b,c].
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-options "-Wno-deprecated" }
struct S {

View File

@ -1,5 +1,5 @@
// PR c++/91391 - bogus -Wcomma-subscript warning.
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T, typename U>
int foo(T t, U u) { return t + u; }

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept Class = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename T> struct A { };
template <typename T> concept int_type = __is_same_as (T, int);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename T> struct A { };
template <typename T> concept int_type = __is_same_as (T, int);

View File

@ -1,5 +1,5 @@
// PR c++/93377
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
struct empty
{};

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept Class = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
#include <cmath>

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T> concept has_mem_type = requires { typename T::type; };

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,5 +1,5 @@
// PR c++/94597
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename b, typename c> concept d = requires(b e) { e.operator c(); };

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// Tests constrained decltype(auto).

View File

@ -1,5 +1,5 @@
// PR c++/66092
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename T, typename U, typename... Args>
concept Similar = true;

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-final { scan-assembler "_Z1gI1XEvT_" } }
// { dg-final { scan-assembler "_Z1gI1YEvT_" } }
// { dg-final { scan-assembler "_Z1gIiEvT_" } }

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
#include <cassert>

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
#include <cassert>

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
#include <cassert>

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
struct A {

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
#ifndef __cpp_concepts
#error __cpp_concepts not defined

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept Type = true;

View File

@ -1,4 +1,4 @@
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
#define assert(E) if (!(E)) __builtin_abort();

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept type = true;

View File

@ -1,5 +1,5 @@
// Testcase from [expr.prim.id]/5
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T> struct A {
static void f(int) requires false;

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept Eq = requires(T t) { t == t; }; // { dg-message "in requirements" }

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept Eq = requires(T t) { t == t; }; // { dg-message "in requirements" }

View File

@ -1,5 +1,5 @@
// C++20 NB comment US115
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T> concept Any = true;

View File

@ -1,5 +1,5 @@
// PR c++/67240
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-diagnostics-depth=2" }
template <class T, class U> concept Same = __is_same_as(T,U);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,5 +1,5 @@
// PR c++/91930
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <typename T> struct basic_mixin {
basic_mixin() requires true;

View File

@ -1,5 +1,5 @@
// PR c++/82565
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
struct string
{

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept False = false;

View File

@ -1,4 +1,4 @@
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
template<typename T>
concept C1 = __is_same_as(T, int)

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
struct a {};
template <bool> using b = a;

View File

@ -1,5 +1,5 @@
// PR c++/92556
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// Having this as a hard error is consistent with template argument deduction;
// it's an open core issue (jason 2020-02-14).

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
struct S
{

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
// FIXME: Diagnostics should be better.

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<typename T>
concept C = __is_class(T);

View File

@ -1,4 +1,4 @@
// { dg-do run { target c++2a } }
// { dg-do run { target c++20 } }
#include <cassert>

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T>
struct A {

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
void f1(int);
void f2(int) noexcept;

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T> concept is_int = __is_same_as(T,int);

View File

@ -1,5 +1,5 @@
// PR c++/67138
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T>
concept Auto = true;

View File

@ -1,5 +1,5 @@
// PR c++/67152
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template <class T>
concept HasType = requires { typename T::type; };

View File

@ -1,4 +1,4 @@
// { dg-do compile { target c++2a } }
// { dg-do compile { target c++20 } }
template<class T, class U>
concept Same = __is_same_as(T, U);

Some files were not shown because too many files have changed in this diff Show More