[libcxx-commits] [libcxx] 76476ef - Rewording "static_assert" diagnostics
Aaron Ballman via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 25 04:23:57 PDT 2022
Author: Muhammad Usman Shahid
Date: 2022-07-25T07:22:54-04:00
New Revision: 76476efd68951907a94def92b2bb6ba6e32ca5b4
URL: https://github.com/llvm/llvm-project/commit/76476efd68951907a94def92b2bb6ba6e32ca5b4
DIFF: https://github.com/llvm/llvm-project/commit/76476efd68951907a94def92b2bb6ba6e32ca5b4.diff
LOG: Rewording "static_assert" diagnostics
This patch rewords the static assert diagnostic output. Failing a
_Static_assert in C should not report that static_assert failed. This
changes the wording to be more like GCC and uses "static assertion"
when possible instead of hard coding the name. This also changes some
instances of 'static_assert' to instead be based on the token in the
source code.
Differential Revision: https://reviews.llvm.org/D129048
Added:
Modified:
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/Parser.cpp
clang/test/C/drs/dr0xx.c
clang/test/CXX/dcl.dcl/p4-0x.cpp
clang/test/CXX/drs/dr19xx.cpp
clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
clang/test/PCH/cxx-static_assert.cpp
clang/test/PCH/cxx-templates.cpp
clang/test/Parser/objc-static-assert.m
clang/test/Parser/objc-static-assert.mm
clang/test/Sema/builtin-align.c
clang/test/Sema/sizeless-1.c
clang/test/Sema/static-assert.c
clang/test/SemaCXX/access-base-class.cpp
clang/test/SemaCXX/alias-template.cpp
clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
clang/test/SemaCXX/builtin-std-move.cpp
clang/test/SemaCXX/builtins.cpp
clang/test/SemaCXX/complex-folding.cpp
clang/test/SemaCXX/constant-expression-cxx11.cpp
clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
clang/test/SemaCXX/coroutines-exp-namespace.cpp
clang/test/SemaCXX/coroutines.cpp
clang/test/SemaCXX/cxx2a-template-lambdas.cpp
clang/test/SemaCXX/cxx98-compat.cpp
clang/test/SemaCXX/delete-and-function-templates.cpp
clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp
clang/test/SemaCXX/recovery-expr-type.cpp
clang/test/SemaCXX/sizeless-1.cpp
clang/test/SemaCXX/static-assert-cxx17.cpp
clang/test/SemaCXX/static-assert.cpp
clang/test/SemaCXX/using-decl-templates.cpp
clang/test/SemaCXX/weak-init.cpp
clang/test/SemaTemplate/instantiate-var-template.cpp
clang/test/SemaTemplate/pr52909.cpp
clang/test/SemaTemplate/pr52970.cpp
clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp
libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp
libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
libcxx/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp
libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp
libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp
libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
libcxx/test/std/numerics/numbers/illformed.verify.cpp
libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/params.fail.cpp
libcxx/test/std/strings/basic.string/char.bad.verify.cpp
libcxx/test/std/strings/string.view/char.bad.fail.cpp
libcxx/test/std/time/time.hms/hhmmss.fail.cpp
libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.fail.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
libcxx/test/std/utilities/utility/forward/forward.fail.cpp
libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
libcxx/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
libcxx/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
libcxx/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
libcxx/test/std/utilities/variant/variant.variant/variant_void.fail.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
index bad6c094cde10..18adb21e2be08 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -282,7 +282,7 @@ def err_inline_nested_namespace_definition : Error<
def err_expected_semi_after_attribute_list : Error<
"expected ';' after attribute list">;
def err_expected_semi_after_static_assert : Error<
- "expected ';' after static_assert">;
+ "expected ';' after '%0'">;
def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">;
def err_single_decl_assign_in_for_range : Error<
"range-based 'for' statement uses ':', not '='">;
@@ -425,7 +425,7 @@ def err_unexpected_token_in_nested_name_spec : Error<
def err_bool_redeclaration : Error<
"redeclaration of C++ built-in type 'bool'">;
def warn_cxx98_compat_static_assert : Warning<
- "static_assert declarations are incompatible with C++98">,
+ "'static_assert' declarations are incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
def ext_ms_static_assert : ExtWarn<
"use of 'static_assert' without inclusion of <assert.h> is a Microsoft "
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 7561027200493..c2cabcb04f2f7 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1526,12 +1526,12 @@ def err_messaging_class_with_direct_method : Error<
// C++ declarations
def err_static_assert_expression_is_not_constant : Error<
- "static_assert expression is not an integral constant expression">;
+ "static assertion expression is not an integral constant expression">;
def err_constexpr_if_condition_expression_is_not_constant : Error<
"constexpr if condition is not a constant expression">;
-def err_static_assert_failed : Error<"static_assert failed%select{: %1|}0">;
+def err_static_assert_failed : Error<"static assertion failed%select{: %1|}0">;
def err_static_assert_requirement_failed : Error<
- "static_assert failed due to requirement '%0'%select{: %2|}1">;
+ "static assertion failed due to requirement '%0'%select{: %2|}1">;
def warn_consteval_if_always_true : Warning<
"consteval if is always true in an %select{unevaluated|immediate}0 context">,
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 76e1c9db5284e..a9c85ceb434c4 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -1043,7 +1043,7 @@ class Parser : public CodeCompletionHandler {
/// If the next token is not a semicolon, this emits the specified diagnostic,
/// or, if there's just some closing-delimiter noise (e.g., ')' or ']') prior
/// to the semicolon, consumes that extra token.
- bool ExpectAndConsumeSemi(unsigned DiagID);
+ bool ExpectAndConsumeSemi(unsigned DiagID , StringRef TokenUsed = "");
/// The kind of extra semi diagnostic to emit.
enum ExtraSemiKind {
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 143b373e9ea54..bf73ddfd10311 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -60,7 +60,7 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context,
SourceLocation &DeclEnd,
SourceLocation InlineLoc) {
assert(Tok.is(tok::kw_namespace) && "Not a namespace!");
- SourceLocation NamespaceLoc = ConsumeToken(); // eat the 'namespace'.
+ SourceLocation NamespaceLoc = ConsumeToken(); // eat the 'namespace'.
ObjCDeclContextSwitch ObjCDC(*this);
if (Tok.is(tok::code_completion)) {
@@ -99,7 +99,7 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context,
if (Tok.is(tok::identifier)) {
Ident = Tok.getIdentifierInfo();
- IdentLoc = ConsumeToken(); // eat the identifier.
+ IdentLoc = ConsumeToken(); // eat the identifier.
while (Tok.is(tok::coloncolon) &&
(NextToken().is(tok::identifier) ||
(NextToken().is(tok::kw_inline) &&
@@ -199,7 +199,7 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context,
std::string RBraces;
for (unsigned i = 0, e = ExtraNSs.size(); i != e; ++i)
- RBraces += "} ";
+ RBraces += "} ";
Diag(ExtraNSs[0].NamespaceLoc, diag::ext_nested_namespace_definition)
<< FixItHint::CreateReplacement(
@@ -216,8 +216,9 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context,
// If we're still good, complain about inline namespaces in non-C++0x now.
if (InlineLoc.isValid())
- Diag(InlineLoc, getLangOpts().CPlusPlus11 ?
- diag::warn_cxx98_compat_inline_namespace : diag::ext_inline_namespace);
+ Diag(InlineLoc, getLangOpts().CPlusPlus11
+ ? diag::warn_cxx98_compat_inline_namespace
+ : diag::ext_inline_namespace);
// Enter a scope for the namespace.
ParseScope NamespaceScope(this, Scope::DeclScope);
@@ -496,7 +497,7 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDirectiveOrDeclaration(
if (TemplateInfo.Kind) {
SourceRange R = TemplateInfo.getSourceRange();
Diag(UsingLoc, diag::err_templated_using_directive_declaration)
- << 0 /* directive */ << R << FixItHint::CreateRemoval(R);
+ << 0 /* directive */ << R << FixItHint::CreateRemoval(R);
}
Decl *UsingDir = ParseUsingDirective(Context, UsingLoc, DeclEnd, Attrs);
@@ -651,9 +652,9 @@ bool Parser::ParseUsingDeclarator(DeclaratorContext Context,
}
if (TryConsumeToken(tok::ellipsis, D.EllipsisLoc))
- Diag(Tok.getLocation(), getLangOpts().CPlusPlus17 ?
- diag::warn_cxx17_compat_using_declaration_pack :
- diag::ext_using_declaration_pack);
+ Diag(Tok.getLocation(), getLangOpts().CPlusPlus17
+ ? diag::warn_cxx17_compat_using_declaration_pack
+ : diag::ext_using_declaration_pack);
return false;
}
@@ -766,7 +767,7 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration(
if (TemplateInfo.Kind) {
SourceRange R = TemplateInfo.getSourceRange();
Diag(UsingLoc, diag::err_templated_using_directive_declaration)
- << 1 /* declaration */ << R << FixItHint::CreateRemoval(R);
+ << 1 /* declaration */ << R << FixItHint::CreateRemoval(R);
// Unfortunately, we have to bail out instead of recovering by
// ignoring the parameters, just in case the nested name specifier
@@ -811,9 +812,10 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration(
}
if (DeclsInGroup.size() > 1)
- Diag(Tok.getLocation(), getLangOpts().CPlusPlus17 ?
- diag::warn_cxx17_compat_multi_using_declaration :
- diag::ext_multi_using_declaration);
+ Diag(Tok.getLocation(),
+ getLangOpts().CPlusPlus17
+ ? diag::warn_cxx17_compat_multi_using_declaration
+ : diag::ext_multi_using_declaration);
// Eat ';'.
DeclEnd = Tok.getLocation();
@@ -835,9 +837,9 @@ Decl *Parser::ParseAliasDeclarationAfterDeclarator(
return nullptr;
}
- Diag(Tok.getLocation(), getLangOpts().CPlusPlus11 ?
- diag::warn_cxx98_compat_alias_declaration :
- diag::ext_alias_declaration);
+ Diag(Tok.getLocation(), getLangOpts().CPlusPlus11
+ ? diag::warn_cxx98_compat_alias_declaration
+ : diag::ext_alias_declaration);
// Type alias templates cannot be specialized.
int SpecKind = -1;
@@ -856,7 +858,7 @@ Decl *Parser::ParseAliasDeclarationAfterDeclarator(
else
Range = TemplateInfo.getSourceRange();
Diag(Range.getBegin(), diag::err_alias_declaration_specialization)
- << SpecKind << Range;
+ << SpecKind << Range;
SkipUntil(tok::semi);
return nullptr;
}
@@ -869,15 +871,15 @@ Decl *Parser::ParseAliasDeclarationAfterDeclarator(
return nullptr;
} else if (D.TypenameLoc.isValid())
Diag(D.TypenameLoc, diag::err_alias_declaration_not_identifier)
- << FixItHint::CreateRemoval(SourceRange(
- D.TypenameLoc,
- D.SS.isNotEmpty() ? D.SS.getEndLoc() : D.TypenameLoc));
+ << FixItHint::CreateRemoval(
+ SourceRange(D.TypenameLoc, D.SS.isNotEmpty() ? D.SS.getEndLoc()
+ : D.TypenameLoc));
else if (D.SS.isNotEmpty())
Diag(D.SS.getBeginLoc(), diag::err_alias_declaration_not_identifier)
- << FixItHint::CreateRemoval(D.SS.getRange());
+ << FixItHint::CreateRemoval(D.SS.getRange());
if (D.EllipsisLoc.isValid())
Diag(D.EllipsisLoc, diag::err_alias_declaration_pack_expansion)
- << FixItHint::CreateRemoval(SourceRange(D.EllipsisLoc));
+ << FixItHint::CreateRemoval(SourceRange(D.EllipsisLoc));
Decl *DeclFromDeclSpec = nullptr;
TypeResult TypeAlias =
@@ -897,8 +899,8 @@ Decl *Parser::ParseAliasDeclarationAfterDeclarator(
TemplateParameterLists *TemplateParams = TemplateInfo.TemplateParams;
MultiTemplateParamsArg TemplateParamsArg(
- TemplateParams ? TemplateParams->data() : nullptr,
- TemplateParams ? TemplateParams->size() : 0);
+ TemplateParams ? TemplateParams->data() : nullptr,
+ TemplateParams ? TemplateParams->size() : 0);
return Actions.ActOnAliasDeclaration(getCurScope(), AS, TemplateParamsArg,
UsingLoc, D.Name, Attrs, TypeAlias,
DeclFromDeclSpec);
@@ -922,10 +924,13 @@ static FixItHint getStaticAssertNoMessageFixIt(const Expr *AssertExpr,
/// [C11] static_assert-declaration:
/// _Static_assert ( constant-expression , string-literal ) ;
///
-Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
+Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd) {
assert(Tok.isOneOf(tok::kw_static_assert, tok::kw__Static_assert) &&
"Not a static_assert declaration");
+ // Save the token used for static assertion.
+ Token SavedTok = Tok;
+
if (Tok.is(tok::kw__Static_assert) && !getLangOpts().C11)
Diag(Tok, diag::ext_c11_feature) << Tok.getName();
if (Tok.is(tok::kw_static_assert)) {
@@ -974,7 +979,7 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
if (!isTokenStringLiteral()) {
Diag(Tok, diag::err_expected_string_literal)
- << /*Source='static_assert'*/1;
+ << /*Source='static_assert'*/ 1;
SkipMalformedDecl();
return nullptr;
}
@@ -989,10 +994,11 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
T.consumeClose();
DeclEnd = Tok.getLocation();
- ExpectAndConsumeSemi(diag::err_expected_semi_after_static_assert);
+ // Passing the token used to the error message.
+ ExpectAndConsumeSemi(diag::err_expected_semi_after_static_assert,
+ SavedTok.getName());
- return Actions.ActOnStaticAssertDeclaration(StaticAssertLoc,
- AssertExpr.get(),
+ return Actions.ActOnStaticAssertDeclaration(StaticAssertLoc, AssertExpr.get(),
AssertMessage.get(),
T.getCloseLocation());
}
@@ -1003,8 +1009,8 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
/// 'decltype' ( 'auto' ) [C++1y]
///
SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
- assert(Tok.isOneOf(tok::kw_decltype, tok::annot_decltype)
- && "Not a decltype specifier");
+ assert(Tok.isOneOf(tok::kw_decltype, tok::annot_decltype) &&
+ "Not a decltype specifier");
ExprResult Result;
SourceLocation StartLoc = Tok.getLocation();
@@ -1028,11 +1034,11 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
ConsumeToken();
BalancedDelimiterTracker T(*this, tok::l_paren);
- if (T.expectAndConsume(diag::err_expected_lparen_after,
- "decltype", tok::r_paren)) {
+ if (T.expectAndConsume(diag::err_expected_lparen_after, "decltype",
+ tok::r_paren)) {
DS.SetTypeSpecError();
- return T.getOpenLocation() == Tok.getLocation() ?
- StartLoc : T.getOpenLocation();
+ return T.getOpenLocation() == Tok.getLocation() ? StartLoc
+ : T.getOpenLocation();
}
// Check for C++1y 'decltype(auto)'.
@@ -1041,8 +1047,8 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
// be 'auto' since C++2b.
Diag(Tok.getLocation(),
getLangOpts().CPlusPlus14
- ? diag::warn_cxx11_compat_decltype_auto_type_specifier
- : diag::ext_decltype_auto_type_specifier);
+ ? diag::warn_cxx11_compat_decltype_auto_type_specifier
+ : diag::ext_decltype_auto_type_specifier);
ConsumeToken();
} else {
// Parse the expression
@@ -1100,18 +1106,17 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
unsigned DiagID;
const PrintingPolicy &Policy = Actions.getASTContext().getPrintingPolicy();
// Check for duplicate type specifiers (e.g. "int decltype(a)").
- if (Result.get()
- ? DS.SetTypeSpecType(DeclSpec::TST_decltype, StartLoc, PrevSpec,
- DiagID, Result.get(), Policy)
- : DS.SetTypeSpecType(DeclSpec::TST_decltype_auto, StartLoc, PrevSpec,
- DiagID, Policy)) {
+ if (Result.get() ? DS.SetTypeSpecType(DeclSpec::TST_decltype, StartLoc,
+ PrevSpec, DiagID, Result.get(), Policy)
+ : DS.SetTypeSpecType(DeclSpec::TST_decltype_auto, StartLoc,
+ PrevSpec, DiagID, Policy)) {
Diag(StartLoc, DiagID) << PrevSpec;
DS.SetTypeSpecError();
}
return EndLoc;
}
-void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec& DS,
+void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec &DS,
SourceLocation StartLoc,
SourceLocation EndLoc) {
// make sure we have a token we can turn into an annotation token
@@ -1124,15 +1129,14 @@ void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec& DS,
// semi-colon.
EndLoc = PP.getLastCachedTokenLocation();
}
- }
- else
- PP.EnterToken(Tok, /*IsReinject*/true);
+ } else
+ PP.EnterToken(Tok, /*IsReinject*/ true);
Tok.setKind(tok::annot_decltype);
setExprAnnotation(Tok,
- DS.getTypeSpecType() == TST_decltype ? DS.getRepAsExpr() :
- DS.getTypeSpecType() == TST_decltype_auto ? ExprResult() :
- ExprError());
+ DS.getTypeSpecType() == TST_decltype ? DS.getRepAsExpr()
+ : DS.getTypeSpecType() == TST_decltype_auto ? ExprResult()
+ : ExprError());
Tok.setAnnotationEndLoc(EndLoc);
Tok.setLocation(StartLoc);
PP.AnnotateCachedTokens(Tok);
@@ -1144,8 +1148,8 @@ void Parser::ParseUnderlyingTypeSpecifier(DeclSpec &DS) {
SourceLocation StartLoc = ConsumeToken();
BalancedDelimiterTracker T(*this, tok::l_paren);
- if (T.expectAndConsume(diag::err_expected_lparen_after,
- "__underlying_type", tok::r_paren)) {
+ if (T.expectAndConsume(diag::err_expected_lparen_after, "__underlying_type",
+ tok::r_paren)) {
return;
}
@@ -1192,7 +1196,7 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
// Ignore attempts to use typename
if (Tok.is(tok::kw_typename)) {
Diag(Tok, diag::err_expected_class_name_not_template)
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << FixItHint::CreateRemoval(Tok.getLocation());
ConsumeToken();
}
@@ -1211,7 +1215,7 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
if (Tok.isOneOf(tok::kw_decltype, tok::annot_decltype)) {
if (SS.isNotEmpty())
Diag(SS.getBeginLoc(), diag::err_unexpected_scope_on_base_decltype)
- << FixItHint::CreateRemoval(SS.getRange());
+ << FixItHint::CreateRemoval(SS.getRange());
// Fake up a Declarator to use with ActOnTypeName.
DeclSpec DS(AttrFactory);
@@ -1226,7 +1230,7 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
if (Tok.is(tok::annot_template_id)) {
TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
if (TemplateId->mightBeType()) {
- AnnotateTemplateIdTokenAsType(SS, /*IsClassName*/true);
+ AnnotateTemplateIdTokenAsType(SS, /*IsClassName*/ true);
assert(Tok.is(tok::annot_typename) && "template-id -> type failed");
TypeResult Type = getTypeAnnotation(Tok);
@@ -1253,10 +1257,9 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
// required nor permitted" mode, and do this there.
TemplateNameKind TNK = TNK_Non_template;
TemplateTy Template;
- if (!Actions.DiagnoseUnknownTemplateName(*Id, IdLoc, getCurScope(),
- &SS, Template, TNK)) {
- Diag(IdLoc, diag::err_unknown_template_name)
- << Id;
+ if (!Actions.DiagnoseUnknownTemplateName(*Id, IdLoc, getCurScope(), &SS,
+ Template, TNK)) {
+ Diag(IdLoc, diag::err_unknown_template_name) << Id;
}
// Form the template name
@@ -1269,7 +1272,7 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
return true;
if (Tok.is(tok::annot_template_id) &&
takeTemplateIdAnnotation(Tok)->mightBeType())
- AnnotateTemplateIdTokenAsType(SS, /*IsClassName*/true);
+ AnnotateTemplateIdTokenAsType(SS, /*IsClassName*/ true);
// If we didn't end up with a typename token, there's nothing more we
// can do.
@@ -1332,28 +1335,29 @@ void Parser::ParseMicrosoftInheritanceClassAttributes(ParsedAttributes &attrs) {
bool Parser::isValidAfterTypeSpecifier(bool CouldBeBitfield) {
// This switch enumerates the valid "follow" set for type-specifiers.
switch (Tok.getKind()) {
- default: break;
- case tok::semi: // struct foo {...} ;
- case tok::star: // struct foo {...} * P;
- case tok::amp: // struct foo {...} & R = ...
- case tok::ampamp: // struct foo {...} && R = ...
- case tok::identifier: // struct foo {...} V ;
- case tok::r_paren: //(struct foo {...} ) {4}
- case tok::coloncolon: // struct foo {...} :: a::b;
- case tok::annot_cxxscope: // struct foo {...} a:: b;
- case tok::annot_typename: // struct foo {...} a ::b;
- case tok::annot_template_id: // struct foo {...} a<int> ::b;
- case tok::kw_decltype: // struct foo {...} decltype (a)::b;
- case tok::l_paren: // struct foo {...} ( x);
- case tok::comma: // __builtin_offsetof(struct foo{...} ,
- case tok::kw_operator: // struct foo operator ++() {...}
- case tok::kw___declspec: // struct foo {...} __declspec(...)
- case tok::l_square: // void f(struct f [ 3])
- case tok::ellipsis: // void f(struct f ... [Ns])
+ default:
+ break;
+ case tok::semi: // struct foo {...} ;
+ case tok::star: // struct foo {...} * P;
+ case tok::amp: // struct foo {...} & R = ...
+ case tok::ampamp: // struct foo {...} && R = ...
+ case tok::identifier: // struct foo {...} V ;
+ case tok::r_paren: //(struct foo {...} ) {4}
+ case tok::coloncolon: // struct foo {...} :: a::b;
+ case tok::annot_cxxscope: // struct foo {...} a:: b;
+ case tok::annot_typename: // struct foo {...} a ::b;
+ case tok::annot_template_id: // struct foo {...} a<int> ::b;
+ case tok::kw_decltype: // struct foo {...} decltype (a)::b;
+ case tok::l_paren: // struct foo {...} ( x);
+ case tok::comma: // __builtin_offsetof(struct foo{...} ,
+ case tok::kw_operator: // struct foo operator ++() {...}
+ case tok::kw___declspec: // struct foo {...} __declspec(...)
+ case tok::l_square: // void f(struct f [ 3])
+ case tok::ellipsis: // void f(struct f ... [Ns])
// FIXME: we should emit semantic diagnostic when declaration
// attribute is in type attribute position.
- case tok::kw___attribute: // struct foo __attribute__((used)) x;
- case tok::annot_pragma_pack: // struct foo {...} _Pragma(pack(pop));
+ case tok::kw___attribute: // struct foo __attribute__((used)) x;
+ case tok::annot_pragma_pack: // struct foo {...} _Pragma(pack(pop));
// struct foo {...} _Pragma(section(...));
case tok::annot_pragma_ms_pragma:
// struct foo {...} _Pragma(vtordisp(pop));
@@ -1362,40 +1366,40 @@ bool Parser::isValidAfterTypeSpecifier(bool CouldBeBitfield) {
case tok::annot_pragma_ms_pointers_to_members:
return true;
case tok::colon:
- return CouldBeBitfield || // enum E { ... } : 2;
- ColonIsSacred; // _Generic(..., enum E : 2);
+ return CouldBeBitfield || // enum E { ... } : 2;
+ ColonIsSacred; // _Generic(..., enum E : 2);
// Microsoft compatibility
- case tok::kw___cdecl: // struct foo {...} __cdecl x;
- case tok::kw___fastcall: // struct foo {...} __fastcall x;
- case tok::kw___stdcall: // struct foo {...} __stdcall x;
- case tok::kw___thiscall: // struct foo {...} __thiscall x;
- case tok::kw___vectorcall: // struct foo {...} __vectorcall x;
+ case tok::kw___cdecl: // struct foo {...} __cdecl x;
+ case tok::kw___fastcall: // struct foo {...} __fastcall x;
+ case tok::kw___stdcall: // struct foo {...} __stdcall x;
+ case tok::kw___thiscall: // struct foo {...} __thiscall x;
+ case tok::kw___vectorcall: // struct foo {...} __vectorcall x;
// We will diagnose these calling-convention specifiers on non-function
// declarations later, so claim they are valid after a type specifier.
return getLangOpts().MicrosoftExt;
// Type qualifiers
- case tok::kw_const: // struct foo {...} const x;
- case tok::kw_volatile: // struct foo {...} volatile x;
- case tok::kw_restrict: // struct foo {...} restrict x;
- case tok::kw__Atomic: // struct foo {...} _Atomic x;
- case tok::kw___unaligned: // struct foo {...} __unaligned *x;
+ case tok::kw_const: // struct foo {...} const x;
+ case tok::kw_volatile: // struct foo {...} volatile x;
+ case tok::kw_restrict: // struct foo {...} restrict x;
+ case tok::kw__Atomic: // struct foo {...} _Atomic x;
+ case tok::kw___unaligned: // struct foo {...} __unaligned *x;
// Function specifiers
// Note, no 'explicit'. An explicit function must be either a conversion
// operator or a constructor. Either way, it can't have a return type.
- case tok::kw_inline: // struct foo inline f();
- case tok::kw_virtual: // struct foo virtual f();
- case tok::kw_friend: // struct foo friend f();
+ case tok::kw_inline: // struct foo inline f();
+ case tok::kw_virtual: // struct foo virtual f();
+ case tok::kw_friend: // struct foo friend f();
// Storage-class specifiers
- case tok::kw_static: // struct foo {...} static x;
- case tok::kw_extern: // struct foo {...} extern x;
- case tok::kw_typedef: // struct foo {...} typedef x;
- case tok::kw_register: // struct foo {...} register x;
- case tok::kw_auto: // struct foo {...} auto x;
- case tok::kw_mutable: // struct foo {...} mutable x;
- case tok::kw_thread_local: // struct foo {...} thread_local x;
- case tok::kw_constexpr: // struct foo {...} constexpr x;
- case tok::kw_consteval: // struct foo {...} consteval x;
- case tok::kw_constinit: // struct foo {...} constinit x;
+ case tok::kw_static: // struct foo {...} static x;
+ case tok::kw_extern: // struct foo {...} extern x;
+ case tok::kw_typedef: // struct foo {...} typedef x;
+ case tok::kw_register: // struct foo {...} register x;
+ case tok::kw_auto: // struct foo {...} auto x;
+ case tok::kw_mutable: // struct foo {...} mutable x;
+ case tok::kw_thread_local: // struct foo {...} thread_local x;
+ case tok::kw_constexpr: // struct foo {...} constexpr x;
+ case tok::kw_consteval: // struct foo {...} consteval x;
+ case tok::kw_constinit: // struct foo {...} constinit x;
// As shown above, type qualifiers and storage class specifiers absolutely
// can occur after class specifiers according to the grammar. However,
// almost no one actually writes code like this. If we see one of these,
@@ -1414,7 +1418,7 @@ bool Parser::isValidAfterTypeSpecifier(bool CouldBeBitfield) {
if (!isKnownToBeTypeSpecifier(NextToken()))
return true;
break;
- case tok::r_brace: // struct bar { struct foo {...} }
+ case tok::r_brace: // struct bar { struct foo {...} }
// Missing ';' at end of struct is accepted as an extension in C mode.
if (!getLangOpts().CPlusPlus)
return true;
@@ -1507,8 +1511,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
MaybeParseAttributes(PAKM_CXX11 | PAKM_Declspec | PAKM_GNU, attrs);
// Parse inheritance specifiers.
- if (Tok.isOneOf(tok::kw___single_inheritance,
- tok::kw___multiple_inheritance,
+ if (Tok.isOneOf(tok::kw___single_inheritance, tok::kw___multiple_inheritance,
tok::kw___virtual_inheritance))
ParseMicrosoftInheritanceClassAttributes(attrs);
@@ -1519,61 +1522,32 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// C++11 attributes
SourceLocation AttrFixitLoc = Tok.getLocation();
- if (TagType == DeclSpec::TST_struct &&
- Tok.isNot(tok::identifier) &&
- !Tok.isAnnotation() &&
- Tok.getIdentifierInfo() &&
- Tok.isOneOf(tok::kw___is_abstract,
- tok::kw___is_aggregate,
- tok::kw___is_arithmetic,
- tok::kw___is_array,
- tok::kw___is_assignable,
- tok::kw___is_base_of,
- tok::kw___is_class,
- tok::kw___is_complete_type,
- tok::kw___is_compound,
- tok::kw___is_const,
- tok::kw___is_constructible,
- tok::kw___is_convertible,
- tok::kw___is_convertible_to,
- tok::kw___is_destructible,
- tok::kw___is_empty,
- tok::kw___is_enum,
- tok::kw___is_floating_point,
- tok::kw___is_final,
- tok::kw___is_function,
- tok::kw___is_fundamental,
- tok::kw___is_integral,
- tok::kw___is_interface_class,
- tok::kw___is_literal,
- tok::kw___is_lvalue_expr,
- tok::kw___is_lvalue_reference,
- tok::kw___is_member_function_pointer,
- tok::kw___is_member_object_pointer,
- tok::kw___is_member_pointer,
- tok::kw___is_nothrow_assignable,
- tok::kw___is_nothrow_constructible,
- tok::kw___is_nothrow_destructible,
- tok::kw___is_object,
- tok::kw___is_pod,
- tok::kw___is_pointer,
- tok::kw___is_polymorphic,
- tok::kw___is_reference,
- tok::kw___is_rvalue_expr,
- tok::kw___is_rvalue_reference,
- tok::kw___is_same,
- tok::kw___is_scalar,
- tok::kw___is_sealed,
- tok::kw___is_signed,
- tok::kw___is_standard_layout,
- tok::kw___is_trivial,
- tok::kw___is_trivially_assignable,
- tok::kw___is_trivially_constructible,
- tok::kw___is_trivially_copyable,
- tok::kw___is_union,
- tok::kw___is_unsigned,
- tok::kw___is_void,
- tok::kw___is_volatile))
+ if (TagType == DeclSpec::TST_struct && Tok.isNot(tok::identifier) &&
+ !Tok.isAnnotation() && Tok.getIdentifierInfo() &&
+ Tok.isOneOf(
+ tok::kw___is_abstract, tok::kw___is_aggregate,
+ tok::kw___is_arithmetic, tok::kw___is_array, tok::kw___is_assignable,
+ tok::kw___is_base_of, tok::kw___is_class, tok::kw___is_complete_type,
+ tok::kw___is_compound, tok::kw___is_const, tok::kw___is_constructible,
+ tok::kw___is_convertible, tok::kw___is_convertible_to,
+ tok::kw___is_destructible, tok::kw___is_empty, tok::kw___is_enum,
+ tok::kw___is_floating_point, tok::kw___is_final,
+ tok::kw___is_function, tok::kw___is_fundamental,
+ tok::kw___is_integral, tok::kw___is_interface_class,
+ tok::kw___is_literal, tok::kw___is_lvalue_expr,
+ tok::kw___is_lvalue_reference, tok::kw___is_member_function_pointer,
+ tok::kw___is_member_object_pointer, tok::kw___is_member_pointer,
+ tok::kw___is_nothrow_assignable, tok::kw___is_nothrow_constructible,
+ tok::kw___is_nothrow_destructible, tok::kw___is_object,
+ tok::kw___is_pod, tok::kw___is_pointer, tok::kw___is_polymorphic,
+ tok::kw___is_reference, tok::kw___is_rvalue_expr,
+ tok::kw___is_rvalue_reference, tok::kw___is_same, tok::kw___is_scalar,
+ tok::kw___is_sealed, tok::kw___is_signed,
+ tok::kw___is_standard_layout, tok::kw___is_trivial,
+ tok::kw___is_trivially_assignable,
+ tok::kw___is_trivially_constructible, tok::kw___is_trivially_copyable,
+ tok::kw___is_union, tok::kw___is_unsigned, tok::kw___is_void,
+ tok::kw___is_volatile))
// GNU libstdc++ 4.2 and libc++ use certain intrinsic names as the
// name of struct templates, but some are keywords in GCC >= 4.3
// and Clang. Therefore, when we see the token sequence "struct
@@ -1767,7 +1741,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// C++ [class.friend]p2:
// A class shall not be defined in a friend declaration.
Diag(Tok.getLocation(), diag::err_friend_decl_defines_type)
- << SourceRange(DS.getFriendSpecLoc());
+ << SourceRange(DS.getFriendSpecLoc());
// Skip everything up to the semicolon, so that this looks like a proper
// friend class (or template thereof) declaration.
@@ -1821,7 +1795,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// A semicolon was missing after this declaration. Diagnose and recover.
ExpectAndConsume(tok::semi, diag::err_expected_after,
DeclSpec::getSpecifierName(TagType, PPol));
- PP.EnterToken(Tok, /*IsReinject*/true);
+ PP.EnterToken(Tok, /*IsReinject*/ true);
Tok.setKind(tok::semi);
}
} else
@@ -1838,10 +1812,10 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
SourceRange AttrRange = Attributes.Range;
if (AttrRange.isValid()) {
Diag(AttrRange.getBegin(), diag::err_attributes_not_allowed)
- << AttrRange
- << FixItHint::CreateInsertionFromRange(AttrFixitLoc,
- CharSourceRange(AttrRange, true))
- << FixItHint::CreateRemoval(AttrRange);
+ << AttrRange
+ << FixItHint::CreateInsertionFromRange(
+ AttrFixitLoc, CharSourceRange(AttrRange, true))
+ << FixItHint::CreateRemoval(AttrRange);
// Recover by adding misplaced attributes to the attribute list
// of the class so they can be applied on the class later.
@@ -1849,12 +1823,13 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
}
}
- if (!Name && !TemplateId && (DS.getTypeSpecType() == DeclSpec::TST_error ||
- TUK != Sema::TUK_Definition)) {
+ if (!Name && !TemplateId &&
+ (DS.getTypeSpecType() == DeclSpec::TST_error ||
+ TUK != Sema::TUK_Definition)) {
if (DS.getTypeSpecType() != DeclSpec::TST_error) {
// We have a declaration or reference to an anonymous class.
Diag(StartLoc, diag::err_anon_type_definition)
- << DeclSpec::getSpecifierName(TagType, Policy);
+ << DeclSpec::getSpecifierName(TagType, Policy);
}
// If we are parsing a definition and stop at a base-clause, continue on
@@ -1869,7 +1844,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// Create the tag portion of the class or class template.
DeclResult TagOrTempResult = true; // invalid
- TypeResult TypeResult = true; // invalid
+ TypeResult TypeResult = true; // invalid
bool Owned = false;
Sema::SkipBodyInfo SkipBody;
@@ -1881,7 +1856,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
if (TemplateId->isInvalid()) {
// Can't build the declaration.
} else if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation &&
- TUK == Sema::TUK_Declaration) {
+ TUK == Sema::TUK_Declaration) {
// This is an explicit instantiation of a class template.
ProhibitCXX11Attributes(attrs, diag::err_attributes_not_allowed,
/*DiagnoseEmptyAttrs=*/true);
@@ -1901,14 +1876,10 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
TemplateInfo.Kind == ParsedTemplateInfo::NonTemplate)) {
ProhibitCXX11Attributes(attrs, diag::err_attributes_not_allowed,
/*DiagnoseEmptyAttrs=*/true);
- TypeResult = Actions.ActOnTagTemplateIdType(TUK, TagType, StartLoc,
- SS,
- TemplateId->TemplateKWLoc,
- TemplateId->Template,
- TemplateId->TemplateNameLoc,
- TemplateId->LAngleLoc,
- TemplateArgsPtr,
- TemplateId->RAngleLoc);
+ TypeResult = Actions.ActOnTagTemplateIdType(
+ TUK, TagType, StartLoc, SS, TemplateId->TemplateKWLoc,
+ TemplateId->Template, TemplateId->TemplateNameLoc,
+ TemplateId->LAngleLoc, TemplateArgsPtr, TemplateId->RAngleLoc);
} else {
// This is an explicit specialization or a class template
// partial specialization.
@@ -1990,7 +1961,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// If the declarator-id is not a template-id, issue a diagnostic and
// recover by ignoring the 'template' keyword.
Diag(Tok, diag::err_template_defn_explicit_instantiation)
- << 1 << FixItHint::CreateRemoval(TemplateInfo.TemplateLoc);
+ << 1 << FixItHint::CreateRemoval(TemplateInfo.TemplateLoc);
TemplateParams = nullptr;
}
@@ -2002,7 +1973,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
MultiTemplateParamsArg TParams;
if (TUK != Sema::TUK_Reference && TemplateParams)
TParams =
- MultiTemplateParamsArg(&(*TemplateParams)[0], TemplateParams->size());
+ MultiTemplateParamsArg(&(*TemplateParams)[0], TemplateParams->size());
stripTypeAttributesOffDeclSpec(attrs, DS, TUK);
@@ -2020,8 +1991,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
// less common call.
if (IsDependent) {
assert(TUK == Sema::TUK_Reference || TUK == Sema::TUK_Friend);
- TypeResult = Actions.ActOnDependentTag(getCurScope(), TagType, TUK,
- SS, Name, StartLoc, NameLoc);
+ TypeResult = Actions.ActOnDependentTag(getCurScope(), TagType, TUK, SS,
+ Name, StartLoc, NameLoc);
}
}
@@ -2071,10 +2042,9 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
NameLoc.isValid() ? NameLoc : StartLoc,
PrevSpec, DiagID, TypeResult.get(), Policy);
} else if (!TagOrTempResult.isInvalid()) {
- Result = DS.SetTypeSpecType(TagType, StartLoc,
- NameLoc.isValid() ? NameLoc : StartLoc,
- PrevSpec, DiagID, TagOrTempResult.get(), Owned,
- Policy);
+ Result = DS.SetTypeSpecType(
+ TagType, StartLoc, NameLoc.isValid() ? NameLoc : StartLoc, PrevSpec,
+ DiagID, TagOrTempResult.get(), Owned, Policy);
} else {
DS.SetTypeSpecError();
return;
@@ -2183,12 +2153,12 @@ BaseResult Parser::ParseBaseSpecifier(Decl *ClassDecl) {
// Parse the 'virtual' keyword (again!), in case it came after the
// access specifier.
- if (Tok.is(tok::kw_virtual)) {
+ if (Tok.is(tok::kw_virtual)) {
SourceLocation VirtualLoc = ConsumeToken();
if (IsVirtual) {
// Complain about duplicate 'virtual'
Diag(VirtualLoc, diag::err_dup_virtual)
- << FixItHint::CreateRemoval(VirtualLoc);
+ << FixItHint::CreateRemoval(VirtualLoc);
}
IsVirtual = true;
@@ -2237,10 +2207,14 @@ BaseResult Parser::ParseBaseSpecifier(Decl *ClassDecl) {
/// 'public'
AccessSpecifier Parser::getAccessSpecifierIfPresent() const {
switch (Tok.getKind()) {
- default: return AS_none;
- case tok::kw_private: return AS_private;
- case tok::kw_protected: return AS_protected;
- case tok::kw_public: return AS_public;
+ default:
+ return AS_none;
+ case tok::kw_private:
+ return AS_private;
+ case tok::kw_protected:
+ return AS_protected;
+ case tok::kw_public:
+ return AS_public;
}
}
@@ -2248,10 +2222,9 @@ AccessSpecifier Parser::getAccessSpecifierIfPresent() const {
/// delayed, e.g., default arguments or an exception-specification, create a
/// late-parsed method declaration record to handle the parsing at the end of
/// the class definition.
-void Parser::HandleMemberFunctionDeclDelays(Declarator& DeclaratorInfo,
+void Parser::HandleMemberFunctionDeclDelays(Declarator &DeclaratorInfo,
Decl *ThisDecl) {
- DeclaratorChunk::FunctionTypeInfo &FTI
- = DeclaratorInfo.getFunctionTypeInfo();
+ DeclaratorChunk::FunctionTypeInfo &FTI = DeclaratorInfo.getFunctionTypeInfo();
// If there was a late-parsed exception-specification, we'll need a
// late parse
bool NeedLateParse = FTI.getExceptionSpecType() == EST_Unparsed;
@@ -2348,9 +2321,9 @@ void Parser::ParseOptionalCXX11VirtSpecifierSeq(VirtSpecifiers &VS,
if (FriendLoc.isValid()) {
Diag(Tok.getLocation(), diag::err_friend_decl_spec)
- << VirtSpecifiers::getSpecifierName(Specifier)
- << FixItHint::CreateRemoval(Tok.getLocation())
- << SourceRange(FriendLoc, FriendLoc);
+ << VirtSpecifiers::getSpecifierName(Specifier)
+ << FixItHint::CreateRemoval(Tok.getLocation())
+ << SourceRange(FriendLoc, FriendLoc);
ConsumeToken();
continue;
}
@@ -2360,13 +2333,12 @@ void Parser::ParseOptionalCXX11VirtSpecifierSeq(VirtSpecifiers &VS,
const char *PrevSpec = nullptr;
if (VS.SetSpecifier(Specifier, Tok.getLocation(), PrevSpec))
Diag(Tok.getLocation(), diag::err_duplicate_virt_specifier)
- << PrevSpec
- << FixItHint::CreateRemoval(Tok.getLocation());
+ << PrevSpec << FixItHint::CreateRemoval(Tok.getLocation());
if (IsInterface && (Specifier == VirtSpecifiers::VS_Final ||
Specifier == VirtSpecifiers::VS_Sealed)) {
Diag(Tok.getLocation(), diag::err_override_control_interface)
- << VirtSpecifiers::getSpecifierName(Specifier);
+ << VirtSpecifiers::getSpecifierName(Specifier);
} else if (Specifier == VirtSpecifiers::VS_Sealed) {
Diag(Tok.getLocation(), diag::ext_ms_sealed_keyword);
} else if (Specifier == VirtSpecifiers::VS_Abstract) {
@@ -2436,7 +2408,8 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
VS, getCurrentClass().IsInterface,
DeclaratorInfo.getDeclSpec().getFriendSpecLoc());
if (!VS.isUnset())
- MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(DeclaratorInfo, VS);
+ MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(DeclaratorInfo,
+ VS);
}
// If a simple-asm-expr is present, parse it.
@@ -2470,7 +2443,8 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
if (AL.isKnownToGCC() && !AL.isCXX11Attribute())
Diag(AL.getLoc(), diag::warn_gcc_attribute_location);
- MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(DeclaratorInfo, VS);
+ MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(DeclaratorInfo,
+ VS);
}
}
@@ -2487,8 +2461,7 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
/// Look for declaration specifiers possibly occurring after C++11
/// virt-specifier-seq and diagnose them.
void Parser::MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(
- Declarator &D,
- VirtSpecifiers &VS) {
+ Declarator &D, VirtSpecifiers &VS) {
DeclSpec DS(AttrFactory);
// GNU-style and C++11 attributes are not allowed here, but they will be
@@ -2526,15 +2499,15 @@ void Parser::MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(
SourceLocation RefQualifierLoc;
if (ParseRefQualifier(RefQualifierIsLValueRef, RefQualifierLoc)) {
const char *Name = (RefQualifierIsLValueRef ? "& " : "&& ");
- FixItHint Insertion = FixItHint::CreateInsertion(VS.getFirstLocation(), Name);
+ FixItHint Insertion =
+ FixItHint::CreateInsertion(VS.getFirstLocation(), Name);
Function.RefQualifierIsLValueRef = RefQualifierIsLValueRef;
Function.RefQualifierLoc = RefQualifierLoc;
Diag(RefQualifierLoc, diag::err_declspec_after_virtspec)
- << (RefQualifierIsLValueRef ? "&" : "&&")
- << VirtSpecifiers::getSpecifierName(VS.getLastSpecifier())
- << FixItHint::CreateRemoval(RefQualifierLoc)
- << Insertion;
+ << (RefQualifierIsLValueRef ? "&" : "&&")
+ << VirtSpecifiers::getSpecifierName(VS.getLastSpecifier())
+ << FixItHint::CreateRemoval(RefQualifierLoc) << Insertion;
D.SetRangeEnd(RefQualifierLoc);
}
}
@@ -2676,10 +2649,10 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
// Handle: member-declaration ::= '__extension__' member-declaration
if (Tok.is(tok::kw___extension__)) {
// __extension__ silences extension warnings in the subexpression.
- ExtensionRAIIObject O(Diags); // Use RAII to do this.
+ ExtensionRAIIObject O(Diags); // Use RAII to do this.
ConsumeToken();
- return ParseCXXClassMemberDeclaration(AS, AccessAttrs,
- TemplateInfo, TemplateDiags);
+ return ParseCXXClassMemberDeclaration(AS, AccessAttrs, TemplateInfo,
+ TemplateDiags);
}
ParsedAttributes DeclAttrs(AttrFactory);
@@ -2756,9 +2729,9 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
return nullptr;
MultiTemplateParamsArg TemplateParams(
- TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->data()
- : nullptr,
- TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->size() : 0);
+ TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data()
+ : nullptr,
+ TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->size() : 0);
if (TryConsumeToken(tok::semi)) {
if (DS.isFriendSpecified())
@@ -2769,7 +2742,7 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
getCurScope(), AS, DS, DeclAttrs, TemplateParams, false, AnonRecord);
DS.complete(TheDecl);
if (AnonRecord) {
- Decl* decls[] = {AnonRecord, TheDecl};
+ Decl *decls[] = {AnonRecord, TheDecl};
return Actions.BuildDeclaratorGroup(decls);
}
return Actions.ConvertDeclToDeclGroup(TheDecl);
@@ -2787,7 +2760,7 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
SourceLocation EqualLoc;
SourceLocation PureSpecLoc;
- auto TryConsumePureSpecifier = [&] (bool AllowDefinition) {
+ auto TryConsumePureSpecifier = [&](bool AllowDefinition) {
if (Tok.isNot(tok::equal))
return false;
@@ -2891,9 +2864,8 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
DS.ClearStorageClassSpecs();
}
- Decl *FunDecl =
- ParseCXXInlineMethodDef(AS, AccessAttrs, DeclaratorInfo, TemplateInfo,
- VS, PureSpecLoc);
+ Decl *FunDecl = ParseCXXInlineMethodDef(AS, AccessAttrs, DeclaratorInfo,
+ TemplateInfo, VS, PureSpecLoc);
if (FunDecl) {
for (unsigned i = 0, ni = CommonLateParsedAttrs.size(); i < ni; ++i) {
@@ -2961,17 +2933,16 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
SmallVector<SourceRange, 4> Ranges;
DeclaratorInfo.getCXX11AttributeRanges(Ranges);
for (SmallVectorImpl<SourceRange>::iterator I = Ranges.begin(),
- E = Ranges.end(); I != E; ++I)
+ E = Ranges.end();
+ I != E; ++I)
Diag((*I).getBegin(), diag::err_attributes_not_allowed) << *I;
ThisDecl = Actions.ActOnFriendFunctionDecl(getCurScope(), DeclaratorInfo,
TemplateParams);
} else {
- ThisDecl = Actions.ActOnCXXMemberDeclarator(getCurScope(), AS,
- DeclaratorInfo,
- TemplateParams,
- BitfieldSize.get(),
- VS, HasInClassInit);
+ ThisDecl = Actions.ActOnCXXMemberDeclarator(
+ getCurScope(), AS, DeclaratorInfo, TemplateParams, BitfieldSize.get(),
+ VS, HasInClassInit);
if (VarTemplateDecl *VT =
ThisDecl ? dyn_cast<VarTemplateDecl>(ThisDecl) : nullptr)
@@ -3031,7 +3002,8 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
Actions.ActOnUninitializedDecl(ThisDecl);
SkipUntil(tok::comma, StopAtSemi | StopBeforeMatch);
} else if (ThisDecl)
- Actions.AddInitializerToDecl(ThisDecl, Init.get(), EqualLoc.isInvalid());
+ Actions.AddInitializerToDecl(ThisDecl, Init.get(),
+ EqualLoc.isInvalid());
} else if (ThisDecl && DS.getStorageClassSpec() == DeclSpec::SCS_static)
// No initializer.
Actions.ActOnUninitializedDecl(ThisDecl);
@@ -3069,7 +3041,7 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
// the start of a declarator. The comma was probably a typo for a
// semicolon.
Diag(CommaLoc, diag::err_expected_semi_declaration)
- << FixItHint::CreateReplacement(CommaLoc, ";");
+ << FixItHint::CreateReplacement(CommaLoc, ";");
ExpectSemi = false;
break;
}
@@ -3127,23 +3099,23 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
/// be a constant-expression.
ExprResult Parser::ParseCXXMemberInitializer(Decl *D, bool IsFunction,
SourceLocation &EqualLoc) {
- assert(Tok.isOneOf(tok::equal, tok::l_brace)
- && "Data member initializer not starting with '=' or '{'");
+ assert(Tok.isOneOf(tok::equal, tok::l_brace) &&
+ "Data member initializer not starting with '=' or '{'");
EnterExpressionEvaluationContext Context(
Actions, Sema::ExpressionEvaluationContext::PotentiallyEvaluated, D);
if (TryConsumeToken(tok::equal, EqualLoc)) {
if (Tok.is(tok::kw_delete)) {
// In principle, an initializer of '= delete p;' is legal, but it will
- // never type-check. It's better to diagnose it as an ill-formed expression
- // than as an ill-formed deleted non-function member.
- // An initializer of '= delete p, foo' will never be parsed, because
- // a top-level comma always ends the initializer expression.
+ // never type-check. It's better to diagnose it as an ill-formed
+ // expression than as an ill-formed deleted non-function member. An
+ // initializer of '= delete p, foo' will never be parsed, because a
+ // top-level comma always ends the initializer expression.
const Token &Next = NextToken();
if (IsFunction || Next.isOneOf(tok::semi, tok::comma, tok::eof)) {
if (IsFunction)
Diag(ConsumeToken(), diag::err_default_delete_in_multiple_declaration)
- << 1 /* delete */;
+ << 1 /* delete */;
else
Diag(ConsumeToken(), diag::err_deleted_non_function);
return ExprError();
@@ -3151,7 +3123,7 @@ ExprResult Parser::ParseCXXMemberInitializer(Decl *D, bool IsFunction,
} else if (Tok.is(tok::kw_default)) {
if (IsFunction)
Diag(Tok, diag::err_default_delete_in_multiple_declaration)
- << 0 /* default */;
+ << 0 /* default */;
else
Diag(ConsumeToken(), diag::err_default_special_members)
<< getLangOpts().CPlusPlus20;
@@ -3190,7 +3162,7 @@ void Parser::SkipCXXMemberSpecification(SourceLocation RecordLoc,
// within a template argument).
if (Tok.is(tok::colon)) {
// Enter the scope of the class so that we can correctly parse its bases.
- ParseScope ClassScope(this, Scope::ClassScope|Scope::DeclScope);
+ ParseScope ClassScope(this, Scope::ClassScope | Scope::DeclScope);
ParsingClassDefinition ParsingDef(*this, TagDecl, /*NonNestedClass*/ true,
TagType == DeclSpec::TST_interface);
auto OldContext =
@@ -3318,8 +3290,8 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclarationWithPragmas(
default:
if (tok::isPragmaAnnotation(Tok.getKind())) {
Diag(Tok.getLocation(), diag::err_pragma_misplaced_in_decl)
- << DeclSpec::getSpecifierName(TagType,
- Actions.getASTContext().getPrintingPolicy());
+ << DeclSpec::getSpecifierName(
+ TagType, Actions.getASTContext().getPrintingPolicy());
ConsumeAnnotationToken();
return nullptr;
}
@@ -3338,9 +3310,9 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
ParsedAttributes &Attrs,
unsigned TagType, Decl *TagDecl) {
assert((TagType == DeclSpec::TST_struct ||
- TagType == DeclSpec::TST_interface ||
- TagType == DeclSpec::TST_union ||
- TagType == DeclSpec::TST_class) && "Invalid TagType!");
+ TagType == DeclSpec::TST_interface ||
+ TagType == DeclSpec::TST_union || TagType == DeclSpec::TST_class) &&
+ "Invalid TagType!");
llvm::TimeTraceScope TimeScope("ParseClass", [&]() {
if (auto *TD = dyn_cast_or_null<NamedDecl>(TagDecl))
@@ -3363,10 +3335,10 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
// The Microsoft extension __interface does not permit nested classes.
if (getCurrentClass().IsInterface) {
Diag(RecordLoc, diag::err_invalid_member_in_interface)
- << /*ErrorType=*/6
- << (isa<NamedDecl>(TagDecl)
- ? cast<NamedDecl>(TagDecl)->getQualifiedNameAsString()
- : "(anonymous)");
+ << /*ErrorType=*/6
+ << (isa<NamedDecl>(TagDecl)
+ ? cast<NamedDecl>(TagDecl)->getQualifiedNameAsString()
+ : "(anonymous)");
}
break;
}
@@ -3379,7 +3351,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
}
// Enter a scope for the class.
- ParseScope ClassScope(this, Scope::ClassScope|Scope::DeclScope);
+ ParseScope ClassScope(this, Scope::ClassScope | Scope::DeclScope);
// Note that we are parsing a new (potentially-nested) class definition.
ParsingClassDefinition ParsingDef(*this, TagDecl, NonNestedClass,
@@ -3492,7 +3464,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
if (SuggestFixIt) {
LBraceDiag << FixItHint::CreateInsertion(BraceLoc, " {");
// Try recovering from missing { after base-clause.
- PP.EnterToken(Tok, /*IsReinject*/true);
+ PP.EnterToken(Tok, /*IsReinject*/ true);
Tok.setKind(tok::l_brace);
} else {
if (TagDecl)
@@ -3586,10 +3558,8 @@ void Parser::DiagnoseUnexpectedNamespace(NamedDecl *D) {
// FIXME: Suggest where the close brace should have gone by looking
// at indentation changes within the definition body.
- Diag(D->getLocation(),
- diag::err_missing_end_of_definition) << D;
- Diag(Tok.getLocation(),
- diag::note_missing_end_of_definition_before) << D;
+ Diag(D->getLocation(), diag::err_missing_end_of_definition) << D;
+ Diag(Tok.getLocation(), diag::note_missing_end_of_definition_before) << D;
// Push '};' onto the token stream to recover.
PP.EnterToken(Tok, /*IsReinject*/ true);
@@ -3632,7 +3602,7 @@ void Parser::ParseConstructorInitializer(Decl *ConstructorDecl) {
PoisonSEHIdentifiersRAIIObject PoisonSEHIdentifiers(*this, true);
SourceLocation ColonLoc = ConsumeToken();
- SmallVector<CXXCtorInitializer*, 4> MemInitializers;
+ SmallVector<CXXCtorInitializer *, 4> MemInitializers;
bool AnyErrors = false;
do {
@@ -3659,12 +3629,12 @@ void Parser::ParseConstructorInitializer(Decl *ConstructorDecl) {
Tok.isOneOf(tok::identifier, tok::coloncolon)) {
SourceLocation Loc = PP.getLocForEndOfToken(PrevTokLocation);
Diag(Loc, diag::err_ctor_init_missing_comma)
- << FixItHint::CreateInsertion(Loc, ", ");
+ << FixItHint::CreateInsertion(Loc, ", ");
} else {
// Skip over garbage, until we get to '{'. Don't eat the '{'.
if (!MemInit.isInvalid())
- Diag(Tok.getLocation(), diag::err_expected_either) << tok::l_brace
- << tok::comma;
+ Diag(Tok.getLocation(), diag::err_expected_either)
+ << tok::l_brace << tok::comma;
SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch);
break;
}
@@ -3718,7 +3688,7 @@ MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
? takeTemplateIdAnnotation(Tok)
: nullptr;
if (TemplateId && TemplateId->mightBeType()) {
- AnnotateTemplateIdTokenAsType(SS, /*IsClassName*/true);
+ AnnotateTemplateIdTokenAsType(SS, /*IsClassName*/ true);
assert(Tok.is(tok::annot_typename) && "template-id -> type failed");
TemplateTypeTy = getTypeAnnotation(Tok);
ConsumeAnnotationToken();
@@ -3745,7 +3715,7 @@ MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
TemplateTypeTy.get(), DS, IdLoc,
InitList.get(), EllipsisLoc);
- } else if(Tok.is(tok::l_paren)) {
+ } else if (Tok.is(tok::l_paren)) {
BalancedDelimiterTracker T(*this, tok::l_paren);
T.consumeOpen();
@@ -3779,10 +3749,9 @@ MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
if (TemplateTypeTy.isInvalid())
return true;
- return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
- TemplateTypeTy.get(), DS, IdLoc,
- T.getOpenLocation(), ArgExprs,
- T.getCloseLocation(), EllipsisLoc);
+ return Actions.ActOnMemInitializer(
+ ConstructorDecl, getCurScope(), SS, II, TemplateTypeTy.get(), DS, IdLoc,
+ T.getOpenLocation(), ArgExprs, T.getCloseLocation(), EllipsisLoc);
}
if (TemplateTypeTy.isInvalid())
@@ -3803,13 +3772,11 @@ MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
/// noexcept-specification:
/// 'noexcept'
/// 'noexcept' '(' constant-expression ')'
-ExceptionSpecificationType
-Parser::tryParseExceptionSpecification(bool Delayed,
- SourceRange &SpecificationRange,
- SmallVectorImpl<ParsedType> &DynamicExceptions,
- SmallVectorImpl<SourceRange> &DynamicExceptionRanges,
- ExprResult &NoexceptExpr,
- CachedTokens *&ExceptionSpecTokens) {
+ExceptionSpecificationType Parser::tryParseExceptionSpecification(
+ bool Delayed, SourceRange &SpecificationRange,
+ SmallVectorImpl<ParsedType> &DynamicExceptions,
+ SmallVectorImpl<SourceRange> &DynamicExceptionRanges,
+ ExprResult &NoexceptExpr, CachedTokens *&ExceptionSpecTokens) {
ExceptionSpecificationType Result = EST_None;
ExceptionSpecTokens = nullptr;
@@ -3838,8 +3805,8 @@ Parser::tryParseExceptionSpecification(bool Delayed,
// Cache the tokens for the exception-specification.
ExceptionSpecTokens = new CachedTokens;
- ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept'
- ExceptionSpecTokens->push_back(Tok); // '('
+ ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept'
+ ExceptionSpecTokens->push_back(Tok); // '('
SpecificationRange.setEnd(ConsumeParen()); // '('
ConsumeAndStoreUntil(tok::r_paren, *ExceptionSpecTokens,
@@ -3852,9 +3819,8 @@ Parser::tryParseExceptionSpecification(bool Delayed,
// See if there's a dynamic specification.
if (Tok.is(tok::kw_throw)) {
- Result = ParseDynamicExceptionSpecification(SpecificationRange,
- DynamicExceptions,
- DynamicExceptionRanges);
+ Result = ParseDynamicExceptionSpecification(
+ SpecificationRange, DynamicExceptions, DynamicExceptionRanges);
assert(DynamicExceptions.size() == DynamicExceptionRanges.size() &&
"Produced
diff erent number of exception types and ranges.");
}
@@ -3878,8 +3844,8 @@ Parser::tryParseExceptionSpecification(bool Delayed,
NoexceptExpr = ParseConstantExpression();
T.consumeClose();
if (!NoexceptExpr.isInvalid()) {
- NoexceptExpr = Actions.ActOnNoexceptSpec(NoexceptExpr.get(),
- NoexceptType);
+ NoexceptExpr =
+ Actions.ActOnNoexceptSpec(NoexceptExpr.get(), NoexceptType);
NoexceptRange = SourceRange(KeywordLoc, T.getCloseLocation());
} else {
NoexceptType = EST_BasicNoexcept;
@@ -3908,17 +3874,16 @@ Parser::tryParseExceptionSpecification(bool Delayed,
return Result;
}
-static void diagnoseDynamicExceptionSpecification(
- Parser &P, SourceRange Range, bool IsNoexcept) {
+static void diagnoseDynamicExceptionSpecification(Parser &P, SourceRange Range,
+ bool IsNoexcept) {
if (P.getLangOpts().CPlusPlus11) {
const char *Replacement = IsNoexcept ? "noexcept" : "noexcept(false)";
- P.Diag(Range.getBegin(),
- P.getLangOpts().CPlusPlus17 && !IsNoexcept
- ? diag::ext_dynamic_exception_spec
- : diag::warn_exception_spec_deprecated)
+ P.Diag(Range.getBegin(), P.getLangOpts().CPlusPlus17 && !IsNoexcept
+ ? diag::ext_dynamic_exception_spec
+ : diag::warn_exception_spec_deprecated)
<< Range;
P.Diag(Range.getBegin(), diag::note_exception_spec_deprecated)
- << Replacement << FixItHint::CreateReplacement(Range, Replacement);
+ << Replacement << FixItHint::CreateReplacement(Range, Replacement);
}
}
@@ -3934,9 +3899,8 @@ static void diagnoseDynamicExceptionSpecification(
/// type-id-list ',' type-id ... [opt]
///
ExceptionSpecificationType Parser::ParseDynamicExceptionSpecification(
- SourceRange &SpecificationRange,
- SmallVectorImpl<ParsedType> &Exceptions,
- SmallVectorImpl<SourceRange> &Ranges) {
+ SourceRange &SpecificationRange, SmallVectorImpl<ParsedType> &Exceptions,
+ SmallVectorImpl<SourceRange> &Ranges) {
assert(Tok.is(tok::kw_throw) && "expected throw");
SpecificationRange.setBegin(ConsumeToken());
@@ -4010,10 +3974,9 @@ void Parser::ParseTrailingRequiresClause(Declarator &D) {
SourceLocation RequiresKWLoc = ConsumeToken();
ExprResult TrailingRequiresClause;
- ParseScope ParamScope(this,
- Scope::DeclScope |
- Scope::FunctionDeclarationScope |
- Scope::FunctionPrototypeScope);
+ ParseScope ParamScope(this, Scope::DeclScope |
+ Scope::FunctionDeclarationScope |
+ Scope::FunctionPrototypeScope);
Actions.ActOnStartTrailingRequiresClause(getCurScope(), D);
@@ -4063,9 +4026,9 @@ void Parser::ParseTrailingRequiresClause(Declarator &D) {
/// We have just started parsing the definition of a new class,
/// so push that class onto our stack of classes that is currently
/// being parsed.
-Sema::ParsingClassState
-Parser::PushParsingClass(Decl *ClassDecl, bool NonNestedClass,
- bool IsInterface) {
+Sema::ParsingClassState Parser::PushParsingClass(Decl *ClassDecl,
+ bool NonNestedClass,
+ bool IsInterface) {
assert((NonNestedClass || !ClassStack.empty()) &&
"Nested class without outer class");
ClassStack.push(new ParsingClass(ClassDecl, NonNestedClass, IsInterface));
@@ -4113,7 +4076,8 @@ void Parser::PopParsingClass(Sema::ParsingClassState state) {
// This nested class has some members that will need to be processed
// after the top-level class is completely defined. Therefore, add
// it to the list of nested classes within its parent.
- assert(getCurScope()->isClassScope() && "Nested class outside of class scope?");
+ assert(getCurScope()->isClassScope() &&
+ "Nested class outside of class scope?");
ClassStack.top()->LateParsedDeclarations.push_back(
new LateParsedClass(this, Victim));
}
@@ -4295,13 +4259,10 @@ static bool IsBuiltInOrStandardCXX11Attribute(IdentifierInfo *AttrName,
/// '[' balanced-token-seq ']'
/// '{' balanced-token-seq '}'
/// any token but '(', ')', '[', ']', '{', or '}'
-bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
- SourceLocation AttrNameLoc,
- ParsedAttributes &Attrs,
- SourceLocation *EndLoc,
- IdentifierInfo *ScopeName,
- SourceLocation ScopeLoc,
- CachedTokens &OpenMPTokens) {
+bool Parser::ParseCXX11AttributeArgs(
+ IdentifierInfo *AttrName, SourceLocation AttrNameLoc,
+ ParsedAttributes &Attrs, SourceLocation *EndLoc, IdentifierInfo *ScopeName,
+ SourceLocation ScopeLoc, CachedTokens &OpenMPTokens) {
assert(Tok.is(tok::l_paren) && "Not a C++11 attribute argument list");
SourceLocation LParenLoc = Tok.getLocation();
const LangOptions &LO = getLangOpts();
@@ -4321,7 +4282,8 @@ bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
!hasAttribute(LO.CPlusPlus ? AttributeCommonInfo::Syntax::AS_CXX11
: AttributeCommonInfo::Syntax::AS_C2x,
ScopeName, AttrName, getTargetInfo(), getLangOpts())) {
- if (getLangOpts().MicrosoftExt || getLangOpts().HLSL) {}
+ if (getLangOpts().MicrosoftExt || getLangOpts().HLSL) {
+ }
// Eat the left paren, then skip to the ending right paren.
ConsumeParen();
SkipUntil(tok::r_paren);
@@ -4339,7 +4301,7 @@ bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
if (ScopeName && ScopeName->isStr("omp")) {
Diag(AttrNameLoc, getLangOpts().OpenMP >= 51
? diag::warn_omp51_compat_attributes
- : diag::ext_omp_attributes);
+ : diag::ext_omp_attributes);
ParseOpenMPAttributeArgs(AttrName, OpenMPTokens);
@@ -4354,9 +4316,8 @@ bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
NumArgs = ParseClangAttributeArgs(AttrName, AttrNameLoc, Attrs, EndLoc,
ScopeName, ScopeLoc, Syntax);
else
- NumArgs =
- ParseAttributeArgsCommon(AttrName, AttrNameLoc, Attrs, EndLoc,
- ScopeName, ScopeLoc, Syntax);
+ NumArgs = ParseAttributeArgsCommon(AttrName, AttrNameLoc, Attrs, EndLoc,
+ ScopeName, ScopeLoc, Syntax);
if (!Attrs.empty() &&
IsBuiltInOrStandardCXX11Attribute(AttrName, ScopeName)) {
@@ -4444,7 +4405,7 @@ void Parser::ParseCXX11AttributeSpecifierInternal(ParsedAttributes &Attrs,
Diag(Tok.getLocation(), diag::err_expected) << tok::colon;
}
- llvm::SmallDenseMap<IdentifierInfo*, SourceLocation, 4> SeenAttrs;
+ llvm::SmallDenseMap<IdentifierInfo *, SourceLocation, 4> SeenAttrs;
bool AttrParsed = false;
while (!Tok.isOneOf(tok::r_square, tok::semi, tok::eof)) {
@@ -4510,8 +4471,7 @@ void Parser::ParseCXX11AttributeSpecifierInternal(ParsedAttributes &Attrs,
}
if (TryConsumeToken(tok::ellipsis))
- Diag(Tok, diag::err_cxx11_attribute_forbids_ellipsis)
- << AttrName;
+ Diag(Tok, diag::err_cxx11_attribute_forbids_ellipsis) << AttrName;
}
// If we hit an error and recovered by parsing up to a semicolon, eat the
@@ -4556,8 +4516,7 @@ void Parser::DiagnoseAndSkipCXX11Attributes() {
if (EndLoc.isValid()) {
SourceRange Range(StartLoc, EndLoc);
- Diag(StartLoc, diag::err_attributes_not_allowed)
- << Range;
+ Diag(StartLoc, diag::err_attributes_not_allowed) << Range;
}
}
@@ -4756,7 +4715,7 @@ void Parser::ParseMicrosoftIfExistsClassDeclaration(
case IEB_Dependent:
Diag(Result.KeywordLoc, diag::warn_microsoft_dependent_exists)
- << Result.IsIfExists;
+ << Result.IsIfExists;
// Fall through to skip.
LLVM_FALLTHROUGH;
@@ -4768,8 +4727,7 @@ void Parser::ParseMicrosoftIfExistsClassDeclaration(
while (Tok.isNot(tok::r_brace) && !isEofOrEom()) {
// __if_exists, __if_not_exists can nest.
if (Tok.isOneOf(tok::kw___if_exists, tok::kw___if_not_exists)) {
- ParseMicrosoftIfExistsClassDeclaration(TagType,
- AccessAttrs, CurAS);
+ ParseMicrosoftIfExistsClassDeclaration(TagType, AccessAttrs, CurAS);
continue;
}
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index ab8748c2c63da..fd044660845be 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -153,7 +153,7 @@ bool Parser::ExpectAndConsume(tok::TokenKind ExpectedTok, unsigned DiagID,
return true;
}
-bool Parser::ExpectAndConsumeSemi(unsigned DiagID) {
+bool Parser::ExpectAndConsumeSemi(unsigned DiagID, StringRef TokenUsed) {
if (TryConsumeToken(tok::semi))
return false;
@@ -172,7 +172,7 @@ bool Parser::ExpectAndConsumeSemi(unsigned DiagID) {
return false;
}
- return ExpectAndConsume(tok::semi, DiagID);
+ return ExpectAndConsume(tok::semi, DiagID , TokenUsed);
}
void Parser::ConsumeExtraSemi(ExtraSemiKind Kind, DeclSpec::TST TST) {
diff --git a/clang/test/C/drs/dr0xx.c b/clang/test/C/drs/dr0xx.c
index 43130e8688f19..183382406475c 100644
--- a/clang/test/C/drs/dr0xx.c
+++ b/clang/test/C/drs/dr0xx.c
@@ -203,7 +203,7 @@ _Static_assert(THIS$AND$THAT(1, 1) == 2, "fail"); /* expected-warning 2 {{'$' in
* Note: the rule changed in C99 to be
diff erent than the resolution to DR029,
* so it's not clear there's value in implementing this DR.
*/
-_Static_assert(__builtin_types_compatible_p(struct S { int a; }, union U { int a; }), "fail"); /* expected-error {{static_assert failed due to requirement '__builtin_types_compatible_p(struct S, union U)': fail}} */
+_Static_assert(__builtin_types_compatible_p(struct S { int a; }, union U { int a; }), "fail"); /* expected-error {{static assertion failed due to requirement '__builtin_types_compatible_p(struct S, union U)': fail}} */
/* WG14 DR031: yes
* Can constant expressions overflow?
diff --git a/clang/test/CXX/dcl.dcl/p4-0x.cpp b/clang/test/CXX/dcl.dcl/p4-0x.cpp
index f3988b31df3a2..925dea9d471f4 100644
--- a/clang/test/CXX/dcl.dcl/p4-0x.cpp
+++ b/clang/test/CXX/dcl.dcl/p4-0x.cpp
@@ -18,4 +18,4 @@ static_assert(S(false), "not so fast"); // expected-error {{not so fast}}
static_assert(T(), "");
static_assert(U(), ""); // expected-error {{ambiguous}}
-static_assert(false, L"\x14hi" "!" R"x(")x"); // expected-error {{static_assert failed: L"\024hi!\""}}
+static_assert(false, L"\x14hi" "!" R"x(")x"); // expected-error {{static assertion failed: L"\024hi!\""}}
diff --git a/clang/test/CXX/drs/dr19xx.cpp b/clang/test/CXX/drs/dr19xx.cpp
index 38d3ca589eca7..08ee2ee77a84f 100644
--- a/clang/test/CXX/drs/dr19xx.cpp
+++ b/clang/test/CXX/drs/dr19xx.cpp
@@ -83,7 +83,7 @@ namespace dr1940 { // dr1940: yes
#if __cplusplus >= 201103L
static union {
static_assert(true, ""); // ok
- static_assert(false, ""); // expected-error {{static_assert failed}}
+ static_assert(false, ""); // expected-error {{static assertion failed}}
int not_empty;
};
#endif
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
index ed26bcbf6b944..28b5d0adcf054 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
@@ -161,10 +161,10 @@ concept Large = sizeof(T) > 100;
struct small { };
static_assert(Large<small>);
-// expected-error at -1 {{static_assert failed}}
+// expected-error at -1 {{static assertion failed}}
// expected-note at -2 {{because 'small' does not satisfy 'Large'}}
static_assert(Large<small>, "small isn't large");
-// expected-error at -1 {{static_assert failed: small isn't large}}
+// expected-error at -1 {{static assertion failed: small isn't large}}
// expected-note at -2 {{because 'small' does not satisfy 'Large'}}
// Make sure access-checking can fail a concept specialization
@@ -173,7 +173,7 @@ class T4 { static constexpr bool f = true; };
template<typename T> concept AccessPrivate = T{}.f;
// expected-note at -1{{because substituted constraint expression is ill-formed: 'f' is a private member of 'T4'}}
static_assert(AccessPrivate<T4>);
-// expected-error at -1{{static_assert failed}}
+// expected-error at -1{{static assertion failed}}
// expected-note at -2{{because 'T4' does not satisfy 'AccessPrivate'}}
template<typename T, typename U>
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
index b45b57f6b9242..02c1a9dcaf3b3 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
@@ -43,5 +43,5 @@ namespace std_example {
requires sizeof(a) == 4; // OK
requires a == 0; // expected-note{{because 'a == 0' would be invalid: constraint variable 'a' cannot be used in an evaluated context}}
};
- static_assert(C2<int>); // expected-note{{because 'int' does not satisfy 'C2'}} expected-error{{static_assert failed}}
-}
\ No newline at end of file
+ static_assert(C2<int>); // expected-note{{because 'int' does not satisfy 'C2'}} expected-error{{static assertion failed}}
+}
diff --git a/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp b/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
index 7d5c8c40da057..309a434b7fb34 100644
--- a/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
+++ b/clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
@@ -79,6 +79,6 @@ namespace variable_templates
// expected-note at -1{{while checking constraint satisfaction for variable template partial specialization 'v1<int>' required here}}
// expected-note at -2{{during template argument deduction for variable template partial specialization 'v1<T *>' [with T = int *]}}
// expected-note at -3{{during template argument deduction for variable template partial specialization 'v1<T **>' [with T = int]}}
- // expected-error at -4{{static_assert failed due to requirement 'v1<int **>'}}
+ // expected-error at -4{{static assertion failed due to requirement 'v1<int **>'}}
-}
\ No newline at end of file
+}
diff --git a/clang/test/PCH/cxx-static_assert.cpp b/clang/test/PCH/cxx-static_assert.cpp
index d2cf8926a88f0..5cbde183bb6dc 100644
--- a/clang/test/PCH/cxx-static_assert.cpp
+++ b/clang/test/PCH/cxx-static_assert.cpp
@@ -17,7 +17,7 @@ template<int N> struct T {
#else
-// expected-error at 15 {{static_assert failed due to requirement '1 == 2': N is not 2!}}
+// expected-error at 15 {{static assertion failed due to requirement '1 == 2': N is not 2!}}
T<1> t1; // expected-note {{in instantiation of template class 'T<1>' requested here}}
T<2> t2;
diff --git a/clang/test/PCH/cxx-templates.cpp b/clang/test/PCH/cxx-templates.cpp
index c5694425585db..804c42e6760b2 100644
--- a/clang/test/PCH/cxx-templates.cpp
+++ b/clang/test/PCH/cxx-templates.cpp
@@ -167,7 +167,7 @@ namespace DependentMemberExpr {
// This used to mark 'f' invalid without producing any diagnostic. That's a
// little hard to detect, but we can make sure that constexpr evaluation
// fails when it should.
- static_assert(A<int>().f() == 1); // expected-error {{static_assert failed}}
+ static_assert(A<int>().f() == 1); // expected-error {{static assertion failed}}
#endif
}
diff --git a/clang/test/Parser/objc-static-assert.m b/clang/test/Parser/objc-static-assert.m
index 138b4fce2058d..b16405787d57b 100644
--- a/clang/test/Parser/objc-static-assert.m
+++ b/clang/test/Parser/objc-static-assert.m
@@ -15,7 +15,7 @@
@interface A {
int a;
_Static_assert(1, "");
- _Static_assert(0, ""); // expected-error {{static_assert failed}}
+ _Static_assert(0, ""); // expected-error {{static assertion failed}}
_Static_assert(a, ""); // expected-error {{use of undeclared identifier 'a'}}
_Static_assert(sizeof(a), ""); // expected-error {{use of undeclared identifier 'a'}}
@@ -44,7 +44,7 @@ @interface A {
@interface A {
int a;
_Static_assert(1, "");
- _Static_assert(0, ""); // expected-error {{static_assert failed}}
+ _Static_assert(0, ""); // expected-error {{static assertion failed}}
}
_Static_assert(1, "");
diff --git a/clang/test/Parser/objc-static-assert.mm b/clang/test/Parser/objc-static-assert.mm
index 125dd4856a5e3..936e484909f53 100644
--- a/clang/test/Parser/objc-static-assert.mm
+++ b/clang/test/Parser/objc-static-assert.mm
@@ -21,12 +21,12 @@ @interface A {
static_assert(1, "");
_Static_assert(1, "");
- static_assert(0, ""); // expected-error {{static_assert failed}}
- _Static_assert(0, ""); // expected-error {{static_assert failed}}
+ static_assert(0, ""); // expected-error {{static assertion failed}}
+ _Static_assert(0, ""); // expected-error {{static assertion failed}}
- static_assert(a, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ static_assert(a, ""); // expected-error {{static assertion expression is not an integral constant expression}}
static_assert(sizeof(a) == 4, "");
- static_assert(sizeof(a) == 3, ""); // expected-error {{static_assert failed}}
+ static_assert(sizeof(a) == 3, ""); // expected-error {{static assertion failed}}
}
static_assert(1, "");
@@ -40,7 +40,7 @@ @implementation A {
static_assert(1, "");
_Static_assert(1, "");
static_assert(sizeof(b) == 4, "");
- static_assert(sizeof(b) == 3, ""); // expected-error {{static_assert failed}}
+ static_assert(sizeof(b) == 3, ""); // expected-error {{static assertion failed}}
}
static_assert(1, "");
@@ -56,7 +56,7 @@ @interface B
@interface B () {
int b;
static_assert(sizeof(b) == 4, "");
- static_assert(sizeof(b) == 3, ""); // expected-error {{static_assert failed}}
+ static_assert(sizeof(b) == 3, ""); // expected-error {{static assertion failed}}
}
@end
@@ -71,7 +71,7 @@ @interface A {
int a;
static_assert(1, ""); // expected-error {{type name requires a specifier or qualifier}} expected-error{{expected parameter declarator}} expected-error {{expected ')'}} expected-note {{to match this '('}}
_Static_assert(1, "");
- _Static_assert(0, ""); // expected-error {{static_assert failed}}
+ _Static_assert(0, ""); // expected-error {{static assertion failed}}
}
@end
#endif
diff --git a/clang/test/Sema/builtin-align.c b/clang/test/Sema/builtin-align.c
index d4cdc230e914f..9c73218f70c23 100644
--- a/clang/test/Sema/builtin-align.c
+++ b/clang/test/Sema/builtin-align.c
@@ -113,8 +113,8 @@ void constant_expression(int x) {
_Static_assert(__builtin_align_down(33, 32) == 32, "");
// But not if one of the arguments isn't constant:
- _Static_assert(ALIGN_BUILTIN(33, x) != 100, ""); // expected-error {{static_assert expression is not an integral constant expression}}
- _Static_assert(ALIGN_BUILTIN(x, 4) != 100, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ _Static_assert(ALIGN_BUILTIN(33, x) != 100, ""); // expected-error {{static assertion expression is not an integral constant expression}}
+ _Static_assert(ALIGN_BUILTIN(x, 4) != 100, ""); // expected-error {{static assertion expression is not an integral constant expression}}
}
// Check that it is a constant expression that can be assigned to globals:
diff --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c
index d50d1c629d13d..5e7e3be772e8c 100644
--- a/clang/test/Sema/sizeless-1.c
+++ b/clang/test/Sema/sizeless-1.c
@@ -69,7 +69,7 @@ void func(int sel) {
// Using pointers to sizeless data isn't wrong here, but because the
// type is incomplete, it doesn't provide any alignment guarantees.
_Static_assert(__atomic_is_lock_free(1, &local_int8) == __atomic_is_lock_free(1, incomplete_ptr), "");
- _Static_assert(__atomic_is_lock_free(2, &local_int8) == __atomic_is_lock_free(2, incomplete_ptr), ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ _Static_assert(__atomic_is_lock_free(2, &local_int8) == __atomic_is_lock_free(2, incomplete_ptr), ""); // expected-error {{static assertion expression is not an integral constant expression}}
_Static_assert(__atomic_always_lock_free(1, &local_int8) == __atomic_always_lock_free(1, incomplete_ptr), "");
local_int8; // expected-warning {{expression result unused}}
diff --git a/clang/test/Sema/static-assert.c b/clang/test/Sema/static-assert.c
index 3958aeaaa77e7..60a45af3d1d2a 100644
--- a/clang/test/Sema/static-assert.c
+++ b/clang/test/Sema/static-assert.c
@@ -5,11 +5,11 @@
_Static_assert("foo", "string is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
#ifndef __cplusplus
-// expected-error at -2 {{static_assert expression is not an integral constant expression}}
+// expected-error at -2 {{static assertion expression is not an integral constant expression}}
#endif
_Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
-_Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed: 0 is nonzero}} \
+_Static_assert(0, "0 is nonzero"); // expected-error {{static assertion failed: 0 is nonzero}} \
// ext-warning {{'_Static_assert' is a C11 extension}}
#ifdef MS
@@ -18,7 +18,7 @@ static_assert(1, "1 is nonzero"); // ms-warning {{use of 'static_assert' without
void foo(void) {
_Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
- _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed: 0 is nonzero}} \
+ _Static_assert(0, "0 is nonzero"); // expected-error {{static assertion failed: 0 is nonzero}} \
// ext-warning {{'_Static_assert' is a C11 extension}}
#ifdef MS
static_assert(1, "1 is nonzero"); // ms-warning {{use of 'static_assert' without}}
@@ -31,7 +31,7 @@ _Static_assert(1, invalid); // expected-error {{expected string literal for diag
struct A {
int a;
_Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a C11 extension}}
- _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed: 0 is nonzero}} \
+ _Static_assert(0, "0 is nonzero"); // expected-error {{static assertion failed: 0 is nonzero}} \
// ext-warning {{'_Static_assert' is a C11 extension}}
#ifdef MS
static_assert(1, "1 is nonzero"); // ms-warning {{use of 'static_assert' without}}
@@ -54,7 +54,7 @@ struct A {
typedef UNION(unsigned, struct A) U1; // ext-warning 3 {{'_Static_assert' is a C11 extension}}
UNION(char[2], short) u2 = { .one = { 'a', 'b' } }; // ext-warning 3 {{'_Static_assert' is a C11 extension}} cxx-warning {{designated initializers are a C++20 extension}}
-typedef UNION(char, short) U3; // expected-error {{static_assert failed due to requirement 'sizeof(char) == sizeof(short)': type size mismatch}} \
+typedef UNION(char, short) U3; // expected-error {{static assertion failed due to requirement 'sizeof(char) == sizeof(short)': type size mismatch}} \
// ext-warning 3 {{'_Static_assert' is a C11 extension}}
typedef UNION(float, 0.5f) U4; // expected-error {{expected a type}} \
// ext-warning 3 {{'_Static_assert' is a C11 extension}}
@@ -70,3 +70,6 @@ static_assert(1, "1 is nonzero"); // ok
#undef static_assert
static_assert(1, "1 is nonzero"); // ms-warning {{use of 'static_assert' without}}
#endif
+
+_Static_assert(1 , "") // expected-error {{expected ';' after '_Static_assert'}} \
+ // ext-warning {{'_Static_assert' is a C11 extension}}
diff --git a/clang/test/SemaCXX/access-base-class.cpp b/clang/test/SemaCXX/access-base-class.cpp
index 2ed40ed536c5f..8273f2f378385 100644
--- a/clang/test/SemaCXX/access-base-class.cpp
+++ b/clang/test/SemaCXX/access-base-class.cpp
@@ -109,7 +109,7 @@ class b {
template <int>
struct Impossible {
- static_assert(false, ""); // expected-error {{static_assert failed}}
+ static_assert(false, ""); // expected-error {{static assertion failed}}
};
// verify "no member named 'value'" bogus diagnostic is not emitted.
diff --git a/clang/test/SemaCXX/alias-template.cpp b/clang/test/SemaCXX/alias-template.cpp
index 0e5d9dae7bb7f..c27c79ebd7cb6 100644
--- a/clang/test/SemaCXX/alias-template.cpp
+++ b/clang/test/SemaCXX/alias-template.cpp
@@ -174,7 +174,7 @@ struct S {
using T = X[J];
using U = T<I>;
};
-static_assert(__is_same(S<3>::U, X[2]), ""); // expected-error {{static_assert failed}}
+static_assert(__is_same(S<3>::U, X[2]), ""); // expected-error {{static assertion failed}}
}
namespace PR39623 {
diff --git a/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp b/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
index c54d7c1b7aa84..a1c003c85f732 100644
--- a/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
+++ b/clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
@@ -26,7 +26,7 @@ static_assert(cn == 11);
constexpr int bn = __builtin_is_constant_evaluated() ? dummy : 42; // expected-note {{non-const variable 'dummy' is not allowed}}
const int n2 = __builtin_is_constant_evaluated() ? dummy : 42; // expected-note {{declared here}}
-static_assert(n2 == 42); // expected-error {{static_assert expression is not an integral constant}}
+static_assert(n2 == 42); // expected-error {{static assertion expression is not an integral constant}}
// expected-note at -1 {{initializer of 'n2' is not a constant expression}}
template <bool V, bool Default = std::is_constant_evaluated()>
diff --git a/clang/test/SemaCXX/builtin-std-move.cpp b/clang/test/SemaCXX/builtin-std-move.cpp
index f220be972a350..eb2b85e8e7c7f 100644
--- a/clang/test/SemaCXX/builtin-std-move.cpp
+++ b/clang/test/SemaCXX/builtin-std-move.cpp
@@ -39,7 +39,7 @@ namespace std {
return static_cast<T&&>(x);
}
template<typename T> CONSTEXPR T &&forward(typename remove_reference<T>::type &&x) {
- static_assert(!is_lvalue_reference<T>::value, "should not forward rval as lval"); // expected-error {{static_assert failed}}
+ static_assert(!is_lvalue_reference<T>::value, "should not forward rval as lval"); // expected-error {{static assertion failed}}
return static_cast<T&&>(x);
}
diff --git a/clang/test/SemaCXX/builtins.cpp b/clang/test/SemaCXX/builtins.cpp
index 50e0fb42b403d..27f9267bbeea5 100644
--- a/clang/test/SemaCXX/builtins.cpp
+++ b/clang/test/SemaCXX/builtins.cpp
@@ -47,7 +47,7 @@ namespace function_start {
void a(void) {}
int n;
void *p = __builtin_function_start(n); // expected-error {{argument must be a function}}
-static_assert(__builtin_function_start(a) == a, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+static_assert(__builtin_function_start(a) == a, ""); // expected-error {{static assertion expression is not an integral constant expression}}
} // namespace function_start
void no_ms_builtins() {
diff --git a/clang/test/SemaCXX/complex-folding.cpp b/clang/test/SemaCXX/complex-folding.cpp
index 1c2f9c73eb313..8c56cf0e5d984 100644
--- a/clang/test/SemaCXX/complex-folding.cpp
+++ b/clang/test/SemaCXX/complex-folding.cpp
@@ -3,7 +3,7 @@
// Test the constant folding of builtin complex numbers.
static_assert((0.0 + 0.0j) == (0.0 + 0.0j));
-static_assert((0.0 + 0.0j) != (0.0 + 0.0j)); // expected-error {{static_assert}}
+static_assert((0.0 + 0.0j) != (0.0 + 0.0j)); // expected-error {{static assertion}}
static_assert((0.0 + 0.0j) == 0.0);
static_assert(0.0 == (0.0 + 0.0j));
@@ -14,21 +14,21 @@ static_assert(0.0 != 1.0j);
// Walk around the complex plane stepping between angular
diff erences and
// equality.
-static_assert((1.0 + 0.0j) == (0.0 + 0.0j)); // expected-error {{static_assert}}
+static_assert((1.0 + 0.0j) == (0.0 + 0.0j)); // expected-error {{static assertion}}
static_assert((1.0 + 0.0j) == (1.0 + 0.0j));
-static_assert((1.0 + 1.0j) == (1.0 + 0.0j)); // expected-error {{static_assert}}
+static_assert((1.0 + 1.0j) == (1.0 + 0.0j)); // expected-error {{static assertion}}
static_assert((1.0 + 1.0j) == (1.0 + 1.0j));
-static_assert((0.0 + 1.0j) == (1.0 + 1.0j)); // expected-error {{static_assert}}
+static_assert((0.0 + 1.0j) == (1.0 + 1.0j)); // expected-error {{static assertion}}
static_assert((0.0 + 1.0j) == (0.0 + 1.0j));
-static_assert((-1.0 + 1.0j) == (0.0 + 1.0j)); // expected-error {{static_assert}}
+static_assert((-1.0 + 1.0j) == (0.0 + 1.0j)); // expected-error {{static assertion}}
static_assert((-1.0 + 1.0j) == (-1.0 + 1.0j));
-static_assert((-1.0 + 0.0j) == (-1.0 + 1.0j)); // expected-error {{static_assert}}
+static_assert((-1.0 + 0.0j) == (-1.0 + 1.0j)); // expected-error {{static assertion}}
static_assert((-1.0 + 0.0j) == (-1.0 + 0.0j));
-static_assert((-1.0 - 1.0j) == (-1.0 + 0.0j)); // expected-error {{static_assert}}
+static_assert((-1.0 - 1.0j) == (-1.0 + 0.0j)); // expected-error {{static assertion}}
static_assert((-1.0 - 1.0j) == (-1.0 - 1.0j));
-static_assert((0.0 - 1.0j) == (-1.0 - 1.0j)); // expected-error {{static_assert}}
+static_assert((0.0 - 1.0j) == (-1.0 - 1.0j)); // expected-error {{static assertion}}
static_assert((0.0 - 1.0j) == (0.0 - 1.0j));
-static_assert((1.0 - 1.0j) == (0.0 - 1.0j)); // expected-error {{static_assert}}
+static_assert((1.0 - 1.0j) == (0.0 - 1.0j)); // expected-error {{static assertion}}
static_assert((1.0 - 1.0j) == (1.0 - 1.0j));
// Test basic mathematical folding of both complex and real operands.
diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp
index b03cb7696aae5..aaca34cd65839 100644
--- a/clang/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp
@@ -580,7 +580,7 @@ constexpr int fail(const int &p) {
return (&p)[64]; // expected-note {{cannot refer to element 64 of array of 2 elements}}
}
static_assert(fail(*(&(&(*(*&(&zs[2] - 1)[0] + 2 - 2))[2])[-1][2] - 2)) == 11, ""); // \
-expected-error {{static_assert expression is not an integral constant expression}} \
+expected-error {{static assertion expression is not an integral constant expression}} \
expected-note {{in call to 'fail(zs[1][0][1][0])'}}
constexpr int arr[40] = { 1, 2, 3, [8] = 4 };
@@ -1596,11 +1596,11 @@ namespace CompoundLiteral {
// Matching GCC, file-scope array compound literals initialized by constants
// are lifetime-extended.
constexpr int *p = (int*)(int[1]){3}; // expected-warning {{C99}}
- static_assert(*p == 3, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ static_assert(*p == 3, ""); // expected-error {{static assertion expression is not an integral constant expression}}
// expected-note at -1 {{subexpression not valid}}
// expected-note at -3 {{declared here}}
static_assert((int[2]){1, 2}[1] == 2, ""); // expected-warning {{C99}}
- // expected-error at -1 {{static_assert expression is not an integral constant expression}}
+ // expected-error at -1 {{static assertion expression is not an integral constant expression}}
// expected-note at -2 {{subexpression not valid}}
// expected-note at -3 {{declared here}}
@@ -1912,12 +1912,12 @@ namespace VirtualFromBase {
static_assert(p->f() == sizeof(X<S1>), "");
// cxx11-error at -1 {{not an integral constant expression}}
// cxx11-note at -2 {{call to virtual function}}
- // cxx20_2b-error at -3 {{static_assert failed}}
+ // cxx20_2b-error at -3 {{static assertion failed}}
// Non-virtual f(), OK.
constexpr X<X<S2>> xxs2;
constexpr X<S2> *q = const_cast<X<X<S2>>*>(&xxs2);
- static_assert(q->f() == sizeof(S2), ""); // cxx20_2b-error {{static_assert failed}}
+ static_assert(q->f() == sizeof(S2), ""); // cxx20_2b-error {{static assertion failed}}
}
namespace ConstexprConstructorRecovery {
diff --git a/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp b/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
index cb1812905d3d2..36ced2e298c69 100644
--- a/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
+++ b/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
@@ -446,7 +446,7 @@ constexpr bool f(bool read_uninit) {
}
static_assert(f(/*read_uninit=*/false), "");
-static_assert(f(/*read_uninit=*/true), ""); // expected-error{{static_assert expression is not an integral constant expression}} expected-note{{in call to 'f(true)'}}
+static_assert(f(/*read_uninit=*/true), ""); // expected-error{{static assertion expression is not an integral constant expression}} expected-note{{in call to 'f(true)'}}
constexpr bytes ld539 = {
0x0, 0x0, 0x0, 0x0,
diff --git a/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp b/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
index 77e22a911cb49..07bc5e57ae13c 100644
--- a/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
+++ b/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
@@ -68,7 +68,7 @@ constexpr int test9(int x) {
}
constexpr int test10() { return undef(); } // expected-error {{use of undeclared identifier 'undef'}}
-static_assert(test10() <= 1, "should not crash"); // expected-error {{static_assert expression is not an integral constant expression}}
+static_assert(test10() <= 1, "should not crash"); // expected-error {{static assertion expression is not an integral constant expression}}
struct X {} array[] = {undef()}; // expected-error {{use of undeclared identifier 'undef'}}
constexpr void test11() {
diff --git a/clang/test/SemaCXX/coroutines-exp-namespace.cpp b/clang/test/SemaCXX/coroutines-exp-namespace.cpp
index 534d47dfa776e..48f0dd0126345 100644
--- a/clang/test/SemaCXX/coroutines-exp-namespace.cpp
+++ b/clang/test/SemaCXX/coroutines-exp-namespace.cpp
@@ -1109,8 +1109,8 @@ struct TestType {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
- static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
- static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
+ static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static assertion failed}}
+ static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static assertion failed}}
static_assert(TC.MatchesArgs<const TestType &, int *>, "");
}
@@ -1201,8 +1201,8 @@ struct DepTestType {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
- static_assert(TC.template MatchesArgs<const DepTestType &>, ""); // expected-error {{static_assert failed}}
- static_assert(TC.template MatchesArgs<>, ""); // expected-error {{static_assert failed}}
+ static_assert(TC.template MatchesArgs<const DepTestType &>, ""); // expected-error {{static assertion failed}}
+ static_assert(TC.template MatchesArgs<>, ""); // expected-error {{static assertion failed}}
static_assert(TC.template MatchesArgs<const DepTestType &, int *>, "");
}
@@ -1265,7 +1265,7 @@ struct DepTestType {
static_assert(!TCT::MatchesArgs<DepTestType *>, "");
// Ensure diagnostics are actually being generated here
- static_assert(TCT::MatchesArgs<int>, ""); // expected-error {{static_assert failed}}
+ static_assert(TCT::MatchesArgs<int>, ""); // expected-error {{static assertion failed}}
}
static CoroMemberTag test_static(volatile void *const, char &&) {
diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp
index 5d6ef7f73cfd7..b646810809a06 100644
--- a/clang/test/SemaCXX/coroutines.cpp
+++ b/clang/test/SemaCXX/coroutines.cpp
@@ -1130,8 +1130,8 @@ struct TestType {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
- static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
- static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static_assert failed}}
+ static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static assertion failed}}
+ static_assert(TC.MatchesArgs<const TestType &>, ""); // expected-error {{static assertion failed}}
static_assert(TC.MatchesArgs<const TestType &, int *>, "");
}
@@ -1222,8 +1222,8 @@ struct DepTestType {
CoroMemberTag test_asserts(int *) const {
auto TC = co_yield 0;
- static_assert(TC.template MatchesArgs<const DepTestType &>, ""); // expected-error {{static_assert failed}}
- static_assert(TC.template MatchesArgs<>, ""); // expected-error {{static_assert failed}}
+ static_assert(TC.template MatchesArgs<const DepTestType &>, ""); // expected-error {{static assertion failed}}
+ static_assert(TC.template MatchesArgs<>, ""); // expected-error {{static assertion failed}}
static_assert(TC.template MatchesArgs<const DepTestType &, int *>, "");
}
@@ -1286,7 +1286,7 @@ struct DepTestType {
static_assert(!TCT::MatchesArgs<DepTestType *>, "");
// Ensure diagnostics are actually being generated here
- static_assert(TCT::MatchesArgs<int>, ""); // expected-error {{static_assert failed}}
+ static_assert(TCT::MatchesArgs<int>, ""); // expected-error {{static assertion failed}}
}
static CoroMemberTag test_static(volatile void *const, char &&) {
diff --git a/clang/test/SemaCXX/cxx2a-template-lambdas.cpp b/clang/test/SemaCXX/cxx2a-template-lambdas.cpp
index 6d22be44d836d..65baf29718f06 100644
--- a/clang/test/SemaCXX/cxx2a-template-lambdas.cpp
+++ b/clang/test/SemaCXX/cxx2a-template-lambdas.cpp
@@ -11,19 +11,19 @@ struct DummyTemplate { };
void func() {
auto L0 = []<typename T>(T arg) {
- static_assert(is_same<T, int>); // expected-error {{static_assert failed}}
+ static_assert(is_same<T, int>); // expected-error {{static assertion failed}}
};
L0(0);
L0(0.0); // expected-note {{in instantiation}}
auto L1 = []<int I> {
- static_assert(I == 5); // expected-error {{static_assert failed}}
+ static_assert(I == 5); // expected-error {{static assertion failed}}
};
L1.operator()<5>();
L1.operator()<6>(); // expected-note {{in instantiation}}
auto L2 = []<template<typename> class T, class U>(T<U> &&arg) {
- static_assert(is_same<T<U>, DummyTemplate<float>>); // // expected-error {{static_assert failed}}
+ static_assert(is_same<T<U>, DummyTemplate<float>>); // // expected-error {{static assertion failed}}
};
L2(DummyTemplate<float>());
L2(DummyTemplate<double>()); // expected-note {{in instantiation}}
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp
index 581b620c70727..f12d7c2d3f051 100644
--- a/clang/test/SemaCXX/cxx98-compat.cpp
+++ b/clang/test/SemaCXX/cxx98-compat.cpp
@@ -152,7 +152,7 @@ __decltype(const_expr) decl_type2 = 0; // ok
void no_except() noexcept; // expected-warning {{noexcept specifications are incompatible with C++98}}
bool no_except_expr = noexcept(1 + 1); // expected-warning {{noexcept expressions are incompatible with C++98}}
void *null = nullptr; // expected-warning {{'nullptr' is incompatible with C++98}}
-static_assert(true, "!"); // expected-warning {{static_assert declarations are incompatible with C++98}}
+static_assert(true, "!"); // expected-warning {{'static_assert' declarations are incompatible with C++98}}
struct InhCtorBase {
InhCtorBase(int);
diff --git a/clang/test/SemaCXX/delete-and-function-templates.cpp b/clang/test/SemaCXX/delete-and-function-templates.cpp
index 22e95cb7937a4..0232b5bc6f12f 100644
--- a/clang/test/SemaCXX/delete-and-function-templates.cpp
+++ b/clang/test/SemaCXX/delete-and-function-templates.cpp
@@ -12,7 +12,7 @@ namespace ns1 {
template<class T> double f(T) = delete; //expected-note{{candidate}}
char f(...); //expected-note{{candidate}}
-static_assert(is_same<decltype(f(3)),char>::value, ""); //expected-error{{call to deleted function}} expected-error{{static_assert failed}}
+static_assert(is_same<decltype(f(3)),char>::value, ""); //expected-error{{call to deleted function}} expected-error{{static assertion failed}}
template<class T> decltype(f(T{})) g(T); // this one sfinae's out.
template<class T> int *g(T);
diff --git a/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp b/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp
index a3a38d42818b7..736c09d68b523 100644
--- a/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp
+++ b/clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp
@@ -19,4 +19,4 @@ template<typename T> false_type test(...);
template<typename T>
static const auto has_minus_assign = decltype(test<T>())::value;
-static_assert(has_minus_assign<int*>, "failed"); // expected-error {{static_assert failed due to requirement 'has_minus_assign<int *>': failed}}
+static_assert(has_minus_assign<int*>, "failed"); // expected-error {{static assertion failed due to requirement 'has_minus_assign<int *>': failed}}
diff --git a/clang/test/SemaCXX/recovery-expr-type.cpp b/clang/test/SemaCXX/recovery-expr-type.cpp
index 3db11466529e1..920cf35fee153 100644
--- a/clang/test/SemaCXX/recovery-expr-type.cpp
+++ b/clang/test/SemaCXX/recovery-expr-type.cpp
@@ -149,7 +149,7 @@ enum Circular { // expected-note {{not complete until the closing '}
Circular_A = Circular(1), // expected-error {{'test13::Circular' is an incomplete type}}
};
// Enumerators can be evaluated (they evaluate as zero, but we don't care).
-static_assert(Circular_A == 0 && Circular_A != 0, ""); // expected-error {{static_assert failed}}
+static_assert(Circular_A == 0 && Circular_A != 0, ""); // expected-error {{static assertion failed}}
}
namespace test14 {
diff --git a/clang/test/SemaCXX/sizeless-1.cpp b/clang/test/SemaCXX/sizeless-1.cpp
index 5986be91233f2..80e74db49c0f4 100644
--- a/clang/test/SemaCXX/sizeless-1.cpp
+++ b/clang/test/SemaCXX/sizeless-1.cpp
@@ -78,7 +78,7 @@ void func(int sel) {
// Using pointers to sizeless data isn't wrong here, but because the
// type is incomplete, it doesn't provide any alignment guarantees.
_Static_assert(__atomic_is_lock_free(1, &local_int8) == __atomic_is_lock_free(1, incomplete_ptr), "");
- _Static_assert(__atomic_is_lock_free(2, &local_int8) == __atomic_is_lock_free(2, incomplete_ptr), ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ _Static_assert(__atomic_is_lock_free(2, &local_int8) == __atomic_is_lock_free(2, incomplete_ptr), ""); // expected-error {{static assertion expression is not an integral constant expression}}
_Static_assert(__atomic_always_lock_free(1, &local_int8) == __atomic_always_lock_free(1, incomplete_ptr), "");
local_int8; // expected-warning {{expression result unused}}
diff --git a/clang/test/SemaCXX/static-assert-cxx17.cpp b/clang/test/SemaCXX/static-assert-cxx17.cpp
index ce9826795d5de..888117d9f27c7 100644
--- a/clang/test/SemaCXX/static-assert-cxx17.cpp
+++ b/clang/test/SemaCXX/static-assert-cxx17.cpp
@@ -22,7 +22,7 @@ inline constexpr bool constexpr_return_false() {
template <typename U, typename V>
void foo() {
static_assert(S1<U, V>::value);
- // expected-error at -1{{static_assert failed due to requirement 'S1<int, float>::value'}}
+ // expected-error at -1{{static assertion failed due to requirement 'S1<int, float>::value'}}
}
template void foo<int, float>();
// expected-note at -1{{in instantiation of function template specialization 'foo<int, float>' requested here}}
@@ -30,7 +30,7 @@ template void foo<int, float>();
template <typename U, typename V>
void foo2() {
static_assert(global_inline_var<U, V>);
- // expected-error at -1{{static_assert failed due to requirement 'global_inline_var<int, float>'}}
+ // expected-error at -1{{static assertion failed due to requirement 'global_inline_var<int, float>'}}
}
template void foo2<int, float>();
// expected-note at -1{{in instantiation of function template specialization 'foo2<int, float>' requested here}}
@@ -38,7 +38,7 @@ template void foo2<int, float>();
template <typename T, typename U, typename V>
void foo3() {
static_assert(T::template var<U, V>);
- // expected-error at -1{{static_assert failed due to requirement 'S2<long>::var<int, float>'}}
+ // expected-error at -1{{static assertion failed due to requirement 'S2<long>::var<int, float>'}}
}
template void foo3<S2<long>, int, float>();
// expected-note at -1{{in instantiation of function template specialization 'foo3<S2<long>, int, float>' requested here}}
@@ -46,7 +46,7 @@ template void foo3<S2<long>, int, float>();
template <typename T>
void foo4() {
static_assert(S1<T[sizeof(T)], int[4]>::value, "");
- // expected-error at -1{{static_assert failed due to requirement 'S1<float[4], int[4]>::value'}}
+ // expected-error at -1{{static assertion failed due to requirement 'S1<float[4], int[4]>::value'}}
};
template void foo4<float>();
// expected-note at -1{{in instantiation of function template specialization 'foo4<float>' requested here}}
@@ -55,7 +55,7 @@ template void foo4<float>();
template <typename U, typename V>
void foo5() {
static_assert(!!(global_inline_var<U, V>));
- // expected-error at -1{{static_assert failed due to requirement '!!(global_inline_var<int, float>)'}}
+ // expected-error at -1{{static assertion failed due to requirement '!!(global_inline_var<int, float>)'}}
}
template void foo5<int, float>();
// expected-note at -1{{in instantiation of function template specialization 'foo5<int, float>' requested here}}
@@ -76,29 +76,29 @@ struct X {
template <class T>
void foo6() {
static_assert(X<typename T::T>());
- // expected-error at -1{{static_assert failed due to requirement 'X<int>()'}}
+ // expected-error at -1{{static assertion failed due to requirement 'X<int>()'}}
static_assert(X<typename T::T>{});
- // expected-error at -1{{static_assert failed due to requirement 'X<int>{}'}}
+ // expected-error at -1{{static assertion failed due to requirement 'X<int>{}'}}
static_assert(X<typename T::T>{1, 2});
- // expected-error at -1{{static_assert failed due to requirement 'X<int>{1, 2}'}}
+ // expected-error at -1{{static assertion failed due to requirement 'X<int>{1, 2}'}}
static_assert(X<typename T::T>({1, 2}));
- // expected-error at -1{{static_assert failed due to requirement 'X<int>({1, 2})'}}
+ // expected-error at -1{{static assertion failed due to requirement 'X<int>({1, 2})'}}
static_assert(typename T::T{0});
- // expected-error at -1{{static_assert failed due to requirement 'int{0}'}}
+ // expected-error at -1{{static assertion failed due to requirement 'int{0}'}}
static_assert(typename T::T(0));
- // expected-error at -1{{static_assert failed due to requirement 'int(0)'}}
+ // expected-error at -1{{static assertion failed due to requirement 'int(0)'}}
static_assert(sizeof(X<typename T::T>) == 0);
- // expected-error at -1{{static_assert failed due to requirement 'sizeof(X<int>) == 0'}}
+ // expected-error at -1{{static assertion failed due to requirement 'sizeof(X<int>) == 0'}}
static_assert((const X<typename T::T> *)nullptr);
- // expected-error at -1{{static_assert failed due to requirement '(const X<int> *)nullptr'}}
+ // expected-error at -1{{static assertion failed due to requirement '(const X<int> *)nullptr'}}
static_assert(static_cast<const X<typename T::T> *>(nullptr));
- // expected-error at -1{{static_assert failed due to requirement 'static_cast<const X<int> *>(nullptr)'}}
+ // expected-error at -1{{static assertion failed due to requirement 'static_cast<const X<int> *>(nullptr)'}}
static_assert((const X<typename T::T>[]){} == nullptr);
- // expected-error at -1{{static_assert failed due to requirement '(const X<int>[0]){} == nullptr'}}
+ // expected-error at -1{{static assertion failed due to requirement '(const X<int>[0]){} == nullptr'}}
static_assert(sizeof(X<decltype(X<typename T::T>().X<typename T::T>::~X())>) == 0);
- // expected-error at -1{{static_assert failed due to requirement 'sizeof(X<void>) == 0'}}
+ // expected-error at -1{{static assertion failed due to requirement 'sizeof(X<void>) == 0'}}
static_assert(constexpr_return_false<typename T::T, typename T::U>());
- // expected-error at -1{{static_assert failed due to requirement 'constexpr_return_false<int, float>()'}}
+ // expected-error at -1{{static assertion failed due to requirement 'constexpr_return_false<int, float>()'}}
}
template void foo6<ExampleTypes>();
// expected-note at -1{{in instantiation of function template specialization 'foo6<ExampleTypes>' requested here}}
diff --git a/clang/test/SemaCXX/static-assert.cpp b/clang/test/SemaCXX/static-assert.cpp
index 2ac0dfdea9eae..7e1ffb325a1b3 100644
--- a/clang/test/SemaCXX/static-assert.cpp
+++ b/clang/test/SemaCXX/static-assert.cpp
@@ -2,61 +2,61 @@
int f(); // expected-note {{declared here}}
-static_assert(f(), "f"); // expected-error {{static_assert expression is not an integral constant expression}} expected-note {{non-constexpr function 'f' cannot be used in a constant expression}}
+static_assert(f(), "f"); // expected-error {{static assertion expression is not an integral constant expression}} expected-note {{non-constexpr function 'f' cannot be used in a constant expression}}
static_assert(true, "true is not false");
-static_assert(false, "false is false"); // expected-error {{static_assert failed: false is false}}
+static_assert(false, "false is false"); // expected-error {{static assertion failed: false is false}}
void g() {
- static_assert(false, "false is false"); // expected-error {{static_assert failed: false is false}}
+ static_assert(false, "false is false"); // expected-error {{static assertion failed: false is false}}
}
class C {
- static_assert(false, "false is false"); // expected-error {{static_assert failed: false is false}}
+ static_assert(false, "false is false"); // expected-error {{static assertion failed: false is false}}
};
template<int N> struct T {
- static_assert(N == 2, "N is not 2!"); // expected-error {{static_assert failed due to requirement '1 == 2': N is not 2!}}
+ static_assert(N == 2, "N is not 2!"); // expected-error {{static assertion failed due to requirement '1 == 2': N is not 2!}}
};
T<1> t1; // expected-note {{in instantiation of template class 'T<1>' requested here}}
T<2> t2;
template<typename T> struct S {
- static_assert(sizeof(T) > sizeof(char), "Type not big enough!"); // expected-error {{static_assert failed due to requirement 'sizeof(char) > sizeof(char)': Type not big enough!}}
+ static_assert(sizeof(T) > sizeof(char), "Type not big enough!"); // expected-error {{static assertion failed due to requirement 'sizeof(char) > sizeof(char)': Type not big enough!}}
};
S<char> s1; // expected-note {{in instantiation of template class 'S<char>' requested here}}
S<int> s2;
-static_assert(false, L"\xFFFFFFFF"); // expected-error {{static_assert failed: L"\xFFFFFFFF"}}
-static_assert(false, u"\U000317FF"); // expected-error {{static_assert failed: u"\U000317FF"}}
+static_assert(false, L"\xFFFFFFFF"); // expected-error {{static assertion failed: L"\xFFFFFFFF"}}
+static_assert(false, u"\U000317FF"); // expected-error {{static assertion failed: u"\U000317FF"}}
-static_assert(false, u8"Ω"); // expected-error {{static_assert failed: u8"\316\251"}}
-static_assert(false, L"\u1234"); // expected-error {{static_assert failed: L"\x1234"}}
-static_assert(false, L"\x1ff" "0\x123" "fx\xfffff" "goop"); // expected-error {{static_assert failed: L"\x1FF""0\x123""fx\xFFFFFgoop"}}
+static_assert(false, u8"Ω"); // expected-error {{static assertion failed: u8"\316\251"}}
+static_assert(false, L"\u1234"); // expected-error {{static assertion failed: L"\x1234"}}
+static_assert(false, L"\x1ff" "0\x123" "fx\xfffff" "goop"); // expected-error {{static assertion failed: L"\x1FF""0\x123""fx\xFFFFFgoop"}}
static_assert(false, R"(a
\tb
c
-)"); // expected-error at -3 {{static_assert failed: a\n\tb\nc\n}}
+)"); // expected-error at -3 {{static assertion failed: a\n\tb\nc\n}}
static_assert(false, "\u0080\u0081\u0082\u0083\u0099\u009A\u009B\u009C\u009D\u009E\u009F");
-// expected-error at -1 {{static_assert failed: <U+0080><U+0081><U+0082><U+0083><U+0099><U+009A><U+009B><U+009C><U+009D><U+009E><U+009F>}}
+// expected-error at -1 {{static assertion failed: <U+0080><U+0081><U+0082><U+0083><U+0099><U+009A><U+009B><U+009C><U+009D><U+009E><U+009F>}}
//! Contains RTL/LTR marks
-static_assert(false, "\u200Eabc\u200Fdef\u200Fgh"); // expected-error {{static_assert failed: abcdefgh}}
+static_assert(false, "\u200Eabc\u200Fdef\u200Fgh"); // expected-error {{static assertion failed: abcdefgh}}
//! Contains ZWJ/regional indicators
-static_assert(false, "🏳️🌈 🏴 🇪🇺"); // expected-error {{static_assert failed: 🏳️🌈 🏴 🇪🇺}}
+static_assert(false, "🏳️🌈 🏴 🇪🇺"); // expected-error {{static assertion failed: 🏳️🌈 🏴 🇪🇺}}
template<typename T> struct AlwaysFails {
// Only give one error here.
- static_assert(false, ""); // expected-error {{static_assert failed}}
+ static_assert(false, ""); // expected-error {{static assertion failed}}
};
AlwaysFails<int> alwaysFails;
template<typename T> struct StaticAssertProtected {
- static_assert(__is_literal(T), ""); // expected-error {{static_assert failed}}
+ static_assert(__is_literal(T), ""); // expected-error {{static assertion failed}}
static constexpr T t = {}; // no error here
};
struct X { ~X(); };
@@ -81,7 +81,7 @@ template<typename T> struct second_trait {
static const bool value = false;
};
-static_assert(first_trait<X>::value && second_trait<X>::value, "message"); // expected-error{{static_assert failed due to requirement 'second_trait<X>::value': message}}
+static_assert(first_trait<X>::value && second_trait<X>::value, "message"); // expected-error{{static assertion failed due to requirement 'second_trait<X>::value': message}}
namespace std {
@@ -125,29 +125,29 @@ struct ExampleTypes {
};
static_assert(std::is_same<ExampleTypes::T, ExampleTypes::U>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_same<int, float>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_same<int, float>::value': message}}
static_assert(std::is_const<ExampleTypes::T>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_const<int>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_const<int>::value': message}}
static_assert(!std::is_const<const ExampleTypes::T>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement '!std::is_const<const int>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement '!std::is_const<const int>::value': message}}
static_assert(!(std::is_const<const ExampleTypes::T>::value), "message");
-// expected-error at -1{{static_assert failed due to requirement '!(std::is_const<const int>::value)': message}}
+// expected-error at -1{{static assertion failed due to requirement '!(std::is_const<const int>::value)': message}}
static_assert(std::is_const<const ExampleTypes::T>::value == false, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_const<const int>::value == false': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_const<const int>::value == false': message}}
static_assert(!(std::is_const<const ExampleTypes::T>::value == true), "message");
-// expected-error at -1{{static_assert failed due to requirement '!(std::is_const<const int>::value == true)': message}}
+// expected-error at -1{{static assertion failed due to requirement '!(std::is_const<const int>::value == true)': message}}
static_assert(std::is_const<ExampleTypes::T>(), "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_const<int>()': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_const<int>()': message}}
static_assert(!(std::is_const<const ExampleTypes::T>()()), "message");
-// expected-error at -1{{static_assert failed due to requirement '!(std::is_const<const int>()())': message}}
+// expected-error at -1{{static assertion failed due to requirement '!(std::is_const<const int>()())': message}}
static_assert(std::is_same<decltype(std::is_const<const ExampleTypes::T>()), int>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_same<std::is_const<const int>, int>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_same<std::is_const<const int>, int>::value': message}}
static_assert(std::is_const<decltype(ExampleTypes::T(3))>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_const<int>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_const<int>::value': message}}
static_assert(std::is_const<decltype(ExampleTypes::T())>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_const<int>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_const<int>::value': message}}
static_assert(std::is_const<decltype(ExampleTypes(3))>::value, "message");
-// expected-error at -1{{static_assert failed due to requirement 'std::is_const<ExampleTypes>::value': message}}
+// expected-error at -1{{static assertion failed due to requirement 'std::is_const<ExampleTypes>::value': message}}
struct BI_tag {};
struct RAI_tag : BI_tag {};
@@ -160,7 +160,7 @@ struct MyContainer {
template <class Container>
void foo() {
static_assert(std::is_same<RAI_tag, typename Container::iterator::tag>::value, "message");
- // expected-error at -1{{static_assert failed due to requirement 'std::is_same<RAI_tag, BI_tag>::value': message}}
+ // expected-error at -1{{static assertion failed due to requirement 'std::is_same<RAI_tag, BI_tag>::value': message}}
}
template void foo<MyContainer>();
// expected-note at -1{{in instantiation of function template specialization 'foo<MyContainer>' requested here}}
@@ -178,7 +178,7 @@ struct NestedTemplates1 {
template <typename T, typename U, int a>
void foo2() {
static_assert(::ns::NestedTemplates1<T, a>::NestedTemplates2::template NestedTemplates3<U>::value, "message");
- // expected-error at -1{{static_assert failed due to requirement '::ns::NestedTemplates1<int, 3>::NestedTemplates2::NestedTemplates3<float>::value': message}}
+ // expected-error at -1{{static assertion failed due to requirement '::ns::NestedTemplates1<int, 3>::NestedTemplates2::NestedTemplates3<float>::value': message}}
}
template void foo2<int, float, 3>();
// expected-note at -1{{in instantiation of function template specialization 'foo2<int, float, 3>' requested here}}
@@ -186,9 +186,9 @@ template void foo2<int, float, 3>();
template <class T>
void foo3(T t) {
static_assert(std::is_const<T>::value, "message");
- // expected-error-re at -1{{static_assert failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value': message}}
+ // expected-error-re at -1{{static assertion failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value': message}}
static_assert(std::is_const<decltype(t)>::value, "message");
- // expected-error-re at -1{{static_assert failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value': message}}
+ // expected-error-re at -1{{static assertion failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value': message}}
}
void callFoo3() {
foo3([]() {});
@@ -206,10 +206,12 @@ void callFoo4() { foo4(42); }
static_assert(42, "message");
static_assert(42.0, "message"); // expected-warning {{implicit conversion from 'double' to 'bool' changes value from 42 to true}}
constexpr int *p = 0;
-static_assert(p, "message"); // expected-error {{static_assert failed}}
+static_assert(p, "message"); // expected-error {{static assertion failed}}
struct NotBool {
} notBool;
constexpr NotBool constexprNotBool;
static_assert(notBool, "message"); // expected-error {{value of type 'struct NotBool' is not contextually convertible to 'bool'}}
static_assert(constexprNotBool, "message"); // expected-error {{value of type 'const NotBool' is not contextually convertible to 'bool'}}
+
+static_assert(1 , "") // expected-error {{expected ';' after 'static_assert'}}
diff --git a/clang/test/SemaCXX/using-decl-templates.cpp b/clang/test/SemaCXX/using-decl-templates.cpp
index d825971954ec2..73d9bc3e774cb 100644
--- a/clang/test/SemaCXX/using-decl-templates.cpp
+++ b/clang/test/SemaCXX/using-decl-templates.cpp
@@ -95,7 +95,7 @@ namespace aliastemplateinst {
namespace DontDiagnoseInvalidTest {
template <bool Value> struct Base {
- static_assert(Value, ""); // expected-error {{static_assert failed}}
+ static_assert(Value, ""); // expected-error {{static assertion failed}}
};
struct Derived : Base<false> { // expected-note {{requested here}}
using Base<false>::Base; // OK. Don't diagnose that 'Base' isn't a base class of Derived.
diff --git a/clang/test/SemaCXX/weak-init.cpp b/clang/test/SemaCXX/weak-init.cpp
index c040330bb274a..a88d32bdca5a1 100644
--- a/clang/test/SemaCXX/weak-init.cpp
+++ b/clang/test/SemaCXX/weak-init.cpp
@@ -2,7 +2,7 @@
extern const int W1 __attribute__((weak)) = 10; // expected-note {{declared here}}
-static_assert(W1 == 10, ""); // expected-error {{static_assert expression is not an integral constant expression}}
+static_assert(W1 == 10, ""); // expected-error {{static assertion expression is not an integral constant expression}}
// expected-note at -1 {{initializer of weak variable 'W1' is not considered constant because it may be
diff erent at runtime}}
extern const int W2 __attribute__((weak)) = 20;
diff --git a/clang/test/SemaTemplate/instantiate-var-template.cpp b/clang/test/SemaTemplate/instantiate-var-template.cpp
index 8037a4865a8bf..89c4a65249cc2 100644
--- a/clang/test/SemaTemplate/instantiate-var-template.cpp
+++ b/clang/test/SemaTemplate/instantiate-var-template.cpp
@@ -31,7 +31,7 @@ namespace InstantiationDependent {
static_assert(b<char> == 1, ""); // expected-note {{in instantiation of}} expected-error {{not an integral constant}}
template<typename T> void f() {
- static_assert(a<sizeof(sizeof(f(T())))> == 0, ""); // expected-error {{static_assert failed due to requirement 'a<sizeof (sizeof (f(type-parameter-0-0())))> == 0'}}
+ static_assert(a<sizeof(sizeof(f(T())))> == 0, ""); // expected-error {{static assertion failed due to requirement 'a<sizeof (sizeof (f(type-parameter-0-0())))> == 0'}}
}
}
diff --git a/clang/test/SemaTemplate/pr52909.cpp b/clang/test/SemaTemplate/pr52909.cpp
index a17ede44fce08..b06c97c3cb67d 100644
--- a/clang/test/SemaTemplate/pr52909.cpp
+++ b/clang/test/SemaTemplate/pr52909.cpp
@@ -15,7 +15,7 @@ concept Beginable = requires (T t) {
// expected-note at -1 {{because 't.begin' would be invalid: reference to non-static member function must be called}}
};
-static_assert(Beginable<A>); // expected-error {{static_assert failed}}
+static_assert(Beginable<A>); // expected-error {{static assertion failed}}
// expected-note at -1 {{does not satisfy 'Beginable'}}
} // namespace PR52905
@@ -48,7 +48,7 @@ struct A {
static void begin(double);
};
-static_assert(C<A>); // expected-error {{static_assert failed}}
+static_assert(C<A>); // expected-error {{static assertion failed}}
// expected-note at -1 {{because 'PR52909b::A' does not satisfy 'C'}}
} // namespace PR52909b
@@ -65,7 +65,7 @@ struct S {
int *f() const;
};
-static_assert(C<S>); // expected-error {{static_assert failed}}
+static_assert(C<S>); // expected-error {{static assertion failed}}
// expected-note at -1 {{because 'PR53075::S' does not satisfy 'C'}}
} // namespace PR53075
diff --git a/clang/test/SemaTemplate/pr52970.cpp b/clang/test/SemaTemplate/pr52970.cpp
index 7585fba412081..e7d5fc601221f 100644
--- a/clang/test/SemaTemplate/pr52970.cpp
+++ b/clang/test/SemaTemplate/pr52970.cpp
@@ -32,7 +32,7 @@ concept C = requires(T t) { t.a.b; };
static_assert(C<Good>);
static_assert(!C<Bad>);
-static_assert(C<Bad>); // cxx20-error {{static_assert failed}}
+static_assert(C<Bad>); // cxx20-error {{static assertion failed}}
// cxx20-note at -1 {{because 'DotFollowingFunctionName::Bad' does not satisfy 'C'}}
#endif
} // namespace DotFollowingFunctionName
@@ -57,7 +57,7 @@ concept C = requires(T t) { t.begin(); };
static_assert(C<Good>);
static_assert(!C<Bad>);
-static_assert(C<Bad>); // cxx20-error {{static_assert failed}}
+static_assert(C<Bad>); // cxx20-error {{static assertion failed}}
// cxx20-note at -1 {{because 'DotFollowingPointer::Bad' (aka 'Holder<Incomplete> *') does not satisfy 'C'}}
#endif
} // namespace DotFollowingPointer
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
index ad9cfc7cdd9de..feb9bcde92735 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
@@ -184,7 +184,7 @@ namespace TemplateSpecializations {
namespace Diags {
struct A { int n, m; };
- template<A a> struct X { static_assert(a.n == a.m); }; // expected-error {{static_assert failed due to requirement 'Diags::A{1, 2}.n == Diags::A{1, 2}.m'}}
+ template<A a> struct X { static_assert(a.n == a.m); }; // expected-error {{static assertion failed due to requirement 'Diags::A{1, 2}.n == Diags::A{1, 2}.m'}}
template struct X<A{1, 2}>; // expected-note {{in instantiation of template class 'Diags::X<{1, 2}>' requested here}}
}
diff --git a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
index 6c4ac602ce729..ca6f0069a155d 100644
--- a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
@@ -46,12 +46,12 @@ void pointer_to_incomplete_type() {
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add(&fun, 0);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add(&fun, 0);
}
}
diff --git a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
index bb45929a5041c..773dbc7fa432c 100644
--- a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
@@ -49,12 +49,12 @@ void pointer_to_incomplete_type() {
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
}
diff --git a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
index f996110f4977f..c2cf156b7f764 100644
--- a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
@@ -46,12 +46,12 @@ void pointer_to_incomplete_type() {
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub(&fun, 0);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub(&fun, 0);
}
}
diff --git a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
index 97416428433d4..73c2b963b4f39 100644
--- a/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
+++ b/libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
@@ -49,12 +49,12 @@ void pointer_to_incomplete_type() {
void function_pointer() {
{
volatile std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (*)(int)> fun;
- // expected-error-re at atomic:* {{static_assert failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
+ // expected-error-re at atomic:* {{{{(static_assert|static assertion)}} failed due to requirement '!is_function<void (int)>::value'{{.*}}Pointer to function isn't allowed}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
}
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
index 1615cc9869e7d..0cec4ca35a020 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
@@ -18,7 +18,7 @@
int main(int, char**)
{
std::basic_filebuf<char, std::char_traits<wchar_t> > f;
-// expected-error-re at streambuf:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
return 0;
}
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
index b8475f193c857..4ec84bb7c45a3 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
@@ -18,8 +18,8 @@
int main(int, char**)
{
std::basic_fstream<char, std::char_traits<wchar_t> > f;
-// expected-error-re at ios:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
-// expected-error-re at streambuf:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
// FIXME: As of commit r324062 Clang incorrectly generates a diagnostic about mismatching
// exception specifications for types which are already invalid for one reason or another.
diff --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
index 55998289eb834..009ed31cf9e80 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
@@ -25,7 +25,7 @@ struct test_istream
int main(int, char**)
{
-// expected-error-re at ios:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
return 0;
}
diff --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
index 54878a2c9972f..9dba983f748e2 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
@@ -25,7 +25,7 @@ struct test_ostream
int main(int, char**)
{
-// expected-error-re at ios:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
return 0;
}
diff --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
index a0df8bb4cd01c..37641bcb9413d 100644
--- a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
@@ -21,8 +21,8 @@
int main(int, char**)
{
std::basic_stringbuf<char, std::char_traits<wchar_t> > sb;
-// expected-error-re at streambuf:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
-// expected-error-re at string:* {{static_assert failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
return 0;
}
diff --git a/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp b/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
index 564831fff4c7a..4ccf85ea528e2 100644
--- a/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
+++ b/libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
@@ -18,7 +18,7 @@
int main(int, char**) {
using BadIter = std::reverse_iterator<forward_iterator<int*>>;
- BadIter i; //expected-error-re@*:* {{static_assert failed{{.*}}reverse_iterator<It> requires It to be a bidirectional iterator.}}
+ BadIter i; //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}reverse_iterator<It> requires It to be a bidirectional iterator.}}
return 0;
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/bad_engine.verify.cpp
index 822411415d6ee..c2a349a72708f 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::bernoulli_distribution dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/bad_engine.verify.cpp
index 6680ea80d8228..b03f6b4f43b50 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::binomial_distribution<int> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp
index 01287f4160bf0..4adfda81b6662 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp
@@ -26,6 +26,6 @@ void test(std::geometric_distribution<int> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 7 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 7 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp
index fec66efe73648..6936d8b24847f 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp
@@ -26,6 +26,6 @@ void test(std::negative_binomial_distribution<int> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 7 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 7 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/bad_engine.verify.cpp
index 76d50e9eae3ae..118e0be11f499 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::cauchy_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/bad_engine.verify.cpp
index 7ef4c2869c8bb..347a5f289f0ae 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::chi_squared_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 3 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 3 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp
index 1f12398093c86..22268d7375f0e 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp
@@ -26,6 +26,6 @@ void test(std::fisher_f_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 4 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 4 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/bad_engine.verify.cpp
index c78ae61cf016b..b168a2ac0a5f4 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::lognormal_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/bad_engine.verify.cpp
index d865ab150a199..6ccec0b7412c1 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::normal_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/bad_engine.verify.cpp
index 71bc832581b8d..7daef43c0b9c6 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::student_t_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 5 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 5 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/bad_engine.verify.cpp
index 9214a83fc755d..5f43f802a617a 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::exponential_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/bad_engine.verify.cpp
index 4b4bdd0673005..f6fd32a7d4dca 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::extreme_value_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/bad_engine.verify.cpp
index e0552616087d9..5ae0083228970 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::gamma_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 3 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 3 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp
index 12551fa60b115..67b5a866968ab 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp
@@ -26,6 +26,6 @@ void test(std::poisson_distribution<int> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 4 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 4 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/bad_engine.verify.cpp
index 8d1f11376c900..0c3ae5c2b2461 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::weibull_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/bad_engine.verify.cpp
index d4172e770f724..bd5f2b1530b6a 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::discrete_distribution<int> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/bad_engine.verify.cpp
index 47f1caa34f777..ef65a494e9e55 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::piecewise_constant_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/bad_engine.verify.cpp
index 9f0422d45b7e7..e733aff79bece 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::piecewise_linear_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* 2 {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp
index 5ad27576e9803..5b2f44737f35f 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp
@@ -26,6 +26,6 @@ void test(std::uniform_int_distribution<int> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp
index 38f91f9267cdb..5c9feba1036e2 100644
--- a/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp
+++ b/libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp
@@ -25,6 +25,6 @@ void test(std::uniform_real_distribution<double> dist)
G<int> badg;
G<unsigned> okg;
- dist(badg); //expected-error@*:* {{static_assert failed}} //expected-note {{in instantiation}}
+ dist(badg); //expected-error-re@*:* {{{{(static_assert|static assertion)}} failed}} //expected-note {{in instantiation}}
dist(okg);
}
diff --git a/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp b/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
index 44824c3c140ce..68ac9e3fc5007 100644
--- a/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
+++ b/libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
@@ -45,7 +45,7 @@ int main(int, char**) {
SPtr<3> s3(nullptr, Deleter{}); // OK
}
- // expected-error-re@*:* {{static_assert failed{{.*}}default_delete cannot be instantiated for function types}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}default_delete cannot be instantiated for function types}}
std::default_delete<FnType<5>> deleter{}; // expected-note {{requested here}}
return 0;
diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
index 5e7b99b8fa16a..40e57df508959 100644
--- a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
+++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
@@ -19,7 +19,7 @@ int main(int, char**)
{
typedef std::pair<int, double> P;
std::tuple_element<2, P>::type foo; // expected-note {{requested here}}
- // expected-error-re@*:* {{static_assert failed{{( due to requirement '2U[L]{0,2} < 2')?}}{{.*}}Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '2U[L]{0,2} < 2')?}}{{.*}}Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
}
return 0;
diff --git a/libcxx/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp b/libcxx/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp
index 5473e65d90941..1e8037e0abbf2 100644
--- a/libcxx/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp
+++ b/libcxx/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp
@@ -30,7 +30,7 @@ int main(int, char**)
{
typedef std::variant<int, double> T;
std::variant_alternative<2, T>::type foo; // expected-note {{requested here}}
- // expected-error-re at variant:* {{static_assert failed{{( due to requirement '2U[L]{0,2} < sizeof...\(_Types\)')?}}{{.*}}Index out of bounds in std::variant_alternative<>}}
+ // expected-error-re at variant:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '2U[L]{0,2} < sizeof...\(_Types\)')?}}{{.*}}Index out of bounds in std::variant_alternative<>}}
}
return 0;
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
index 3e21576afc853..992a3e9886995 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
@@ -33,7 +33,7 @@ template <class PopulationIterator, class SampleIterator> void test() {
}
int main(int, char**) {
- // expected-error-re@*:* {{static_assert failed{{( due to requirement '.*')?}}{{.*}}SampleIterator must meet the requirements of RandomAccessIterator}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '.*')?}}{{.*}}SampleIterator must meet the requirements of RandomAccessIterator}}
// expected-error@*:* 2 {{does not provide a subscript operator}}
// expected-error@*:* {{invalid operands}}
test<cpp17_input_iterator<int *>, cpp17_output_iterator<int *> >();
diff --git a/libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp b/libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp
index ab77167c37418..0c0d21b28bf62 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp
@@ -63,7 +63,7 @@ int main(int, char**)
// refuse to rebind the allocator if Allocator::value_type is not exactly what we expect
const P arr[] = { {1,1L}, {2,2L}, {3,3L} };
std::map m(arr, arr + 3, std::allocator<P>());
- // expected-error-re at map:* {{static_assert failed{{( due to requirement '.*')?}}{{.*}}Allocator::value_type must be same type as value_type}}
+ // expected-error-re at map:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '.*')?}}{{.*}}Allocator::value_type must be same type as value_type}}
}
{
// cannot convert from some arbitrary unrelated type
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
index 47d32d7e1f4c1..3834033996404 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
@@ -63,7 +63,7 @@ int main(int, char**)
// refuse to rebind the allocator if Allocator::value_type is not exactly what we expect
const P arr[] = { {1,1L}, {2,2L}, {3,3L} };
std::multimap m(arr, arr + 3, std::allocator<P>());
- // expected-error-re at map:* {{static_assert failed{{( due to requirement '.*')?}}{{.*}}Allocator::value_type must be same type as value_type}}
+ // expected-error-re at map:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '.*')?}}{{.*}}Allocator::value_type must be same type as value_type}}
}
{
// cannot convert from some arbitrary unrelated type
diff --git a/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp b/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
index 9aea551dc6536..21ea6f899c3a5 100644
--- a/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
@@ -18,7 +18,7 @@ int main(int, char**) {
typedef double T;
typedef std::array<const T, 0> C;
C c = {};
- // expected-error-re at array:* {{static_assert failed{{.*}}cannot fill zero-sized array of type 'const T'}}
+ // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{.*}}cannot fill zero-sized array of type 'const T'}}
c.fill(5.5); // expected-note {{requested here}}
}
diff --git a/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp b/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
index d7726164d4b22..6b17887a40035 100644
--- a/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
@@ -19,7 +19,7 @@ int main(int, char**) {
typedef std::array<const T, 0> C;
C c = {};
C c2 = {};
- // expected-error-re at array:* {{static_assert failed{{.*}}cannot swap zero-sized array of type 'const T'}}
+ // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{.*}}cannot swap zero-sized array of type 'const T'}}
c.swap(c2); // expected-note {{requested here}}
}
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
index cd74522c92ce6..2e1071550a51c 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
@@ -25,7 +25,7 @@ int main(int, char**)
typedef std::array<T, 3> C;
C c = {1, 2, 3.5};
std::get<3>(c) = 5.5; // expected-note {{requested here}}
- // expected-error-re at array:* {{static_assert failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::get<> (std::array)}}
+ // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::get<> (std::array)}}
}
return 0;
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
index 26360790bf4df..6010c893d6995 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
@@ -19,7 +19,7 @@ int main(int, char**)
typedef double T;
typedef std::array<T, 3> C;
std::tuple_element<3, C> foo; // expected-note {{requested here}}
- // expected-error-re at array:* {{static_assert failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::tuple_element<> (std::array)}}
+ // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::tuple_element<> (std::array)}}
}
return 0;
diff --git a/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp b/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
index 8a9a64ef1b418..d02ae2f3ee16a 100644
--- a/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
+++ b/libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
@@ -36,7 +36,7 @@ int main(int, char**)
}
{
using H = coro::coroutine_handle<int>;
- // expected-error-re at experimental/coroutine:* 1 {{static_assert failed{{.*}}coroutine_handle<promise_type>::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead}}
+ // expected-error-re at experimental/coroutine:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}coroutine_handle<promise_type>::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead}}
H::from_address((const char*)nullptr); // expected-note {{requested here}}
// expected-error at experimental/coroutine:* 1 {{coroutine_handle<promise_type>::from_address cannot be called with non-void pointers}}
H::from_address((int*)nullptr); // expected-note {{requested here}}
diff --git a/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp b/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp
index 396053c8d78ba..2293c6b1c3b32 100644
--- a/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp
@@ -26,10 +26,10 @@ int main(int, char**)
(void) std::launder(( void *) nullptr);
(void) std::launder((const void *) nullptr);
(void) std::launder(( volatile void *) nullptr);
- (void) std::launder((const volatile void *) nullptr); // expected-error-re at new:* 4 {{static_assert failed{{.*}}can't launder cv-void}}
+ (void) std::launder((const volatile void *) nullptr); // expected-error-re at new:* 4 {{{{(static_assert|static assertion)}} failed{{.*}}can't launder cv-void}}
// expected-error at new:* 0-4 {{void pointer argument to '__builtin_launder' is not allowed}}
- (void) std::launder(foo); // expected-error-re at new:* 1 {{static_assert failed{{.*}}can't launder functions}}
+ (void) std::launder(foo); // expected-error-re at new:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}can't launder functions}}
// expected-error at new:* 0-1 {{function pointer argument to '__builtin_launder' is not allowed}}
return 0;
diff --git a/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp b/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
index ff6f29e8817fe..ba586ba92b22a 100644
--- a/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
+++ b/libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
@@ -34,19 +34,19 @@ constexpr bool toobig()
int main(int, char**)
{
// Make sure we generate a compile-time error for UB
- static_assert(toobig<unsigned char>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<unsigned short>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<unsigned>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<unsigned long>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<unsigned long long>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
-
- static_assert(toobig<uint8_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<uint16_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<uint32_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<uint64_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<size_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<uintmax_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
- static_assert(toobig<uintptr_t>(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ static_assert(toobig<unsigned char>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<unsigned short>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<unsigned>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<unsigned long>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<unsigned long long>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+
+ static_assert(toobig<uint8_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<uint16_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<uint32_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<uint64_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<size_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<uintmax_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ static_assert(toobig<uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
return 0;
}
diff --git a/libcxx/test/std/numerics/numbers/illformed.verify.cpp b/libcxx/test/std/numerics/numbers/illformed.verify.cpp
index 85e8f2dcb7cda..213f98cff952f 100644
--- a/libcxx/test/std/numerics/numbers/illformed.verify.cpp
+++ b/libcxx/test/std/numerics/numbers/illformed.verify.cpp
@@ -12,7 +12,7 @@
// Initializing the primary template is ill-formed.
int log2e{std::numbers::log2e_v<
- int>}; // expected-error-re at numbers:* {{static_assert failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}}
+ int>}; // expected-error-re at numbers:* {{{{(static_assert|static assertion)}} failed{{.*}}A program that instantiates a primary template of a mathematical constant variable template is ill-formed.}}
int log10e{std::numbers::log10e_v<int>};
int pi{std::numbers::pi_v<int>};
int inv_pi{std::numbers::inv_pi_v<int>};
diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/params.fail.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/params.fail.cpp
index c8df9927b0725..4eebedbe61ca3 100644
--- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/params.fail.cpp
+++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/params.fail.cpp
@@ -19,12 +19,12 @@ int main(int, char**)
{
typedef unsigned long long T;
- // expected-error-re@*:* {{static_assert failed due to requirement '1ULL == 0 || 1ULL < 1ULL'{{.*}}linear_congruential_engine invalid parameters}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '1ULL == 0 || 1ULL < 1ULL'{{.*}}linear_congruential_engine invalid parameters}}
std::linear_congruential_engine<T, 0, 0, 0> e2;
- // expected-error-re@*:* {{static_assert failed due to requirement '1ULL == 0 || 1ULL < 1ULL'{{.*}}linear_congruential_engine invalid parameters}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement '1ULL == 0 || 1ULL < 1ULL'{{.*}}linear_congruential_engine invalid parameters}}
std::linear_congruential_engine<T, 0, 1, 1> e3;
std::linear_congruential_engine<T, 1, 0, 1> e4;
- // expected-error-re@*:* {{static_assert failed due to requirement 'is_unsigned<int>::value'{{.*}}_UIntType must be unsigned type}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed due to requirement 'is_unsigned<int>::value'{{.*}}_UIntType must be unsigned type}}
std::linear_congruential_engine<int, 0, 0, 0> e5;
return 0;
diff --git a/libcxx/test/std/strings/basic.string/char.bad.verify.cpp b/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
index a3ab207f420a1..a93fdc7c8e65d 100644
--- a/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
+++ b/libcxx/test/std/strings/basic.string/char.bad.verify.cpp
@@ -32,20 +32,20 @@ void f() {
typedef char C[3];
static_assert(std::is_array<C>::value, "");
std::basic_string<C, test_traits<C> > s;
- // expected-error-re at string:* {{static_assert failed{{.*}}Character type of basic_string must not be an array}}
+ // expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}Character type of basic_string must not be an array}}
}
{
// not trivial
static_assert(!std::is_trivial<NotTrivial>::value, "");
std::basic_string<NotTrivial, test_traits<NotTrivial> > s;
- // expected-error-re at string:* {{static_assert failed{{.*}}Character type of basic_string must be trivial}}
+ // expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}Character type of basic_string must be trivial}}
}
{
// not standard layout
static_assert(!std::is_standard_layout<NotStandardLayout>::value, "");
std::basic_string<NotStandardLayout, test_traits<NotStandardLayout> > s;
- // expected-error-re at string:* {{static_assert failed{{.*}}Character type of basic_string must be standard-layout}}
+ // expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}Character type of basic_string must be standard-layout}}
}
}
diff --git a/libcxx/test/std/strings/string.view/char.bad.fail.cpp b/libcxx/test/std/strings/string.view/char.bad.fail.cpp
index d8b8878b19d7c..b1794bc303749 100644
--- a/libcxx/test/std/strings/string.view/char.bad.fail.cpp
+++ b/libcxx/test/std/strings/string.view/char.bad.fail.cpp
@@ -35,21 +35,21 @@ int main(int, char**)
typedef char C[3];
static_assert(std::is_array<C>::value, "");
std::basic_string_view<C, test_traits<C> > sv;
-// expected-error-re at string_view:* {{static_assert failed{{.*}}Character type of basic_string_view must not be an array}}
+// expected-error-re at string_view:* {{{{(static_assert|static assertion)}} failed{{.*}}Character type of basic_string_view must not be an array}}
}
{
// not trivial
static_assert(!std::is_trivial<NotTrivial>::value, "");
std::basic_string_view<NotTrivial, test_traits<NotTrivial> > sv;
-// expected-error-re at string_view:* {{static_assert failed{{.*}}Character type of basic_string_view must be trivial}}
+// expected-error-re at string_view:* {{{{(static_assert|static assertion)}} failed{{.*}}Character type of basic_string_view must be trivial}}
}
{
// not standard layout
static_assert(!std::is_standard_layout<NotStandardLayout>::value, "");
std::basic_string_view<NotStandardLayout, test_traits<NotStandardLayout> > sv;
-// expected-error-re at string_view:* {{static_assert failed{{.*}}Character type of basic_string_view must be standard-layout}}
+// expected-error-re at string_view:* {{{{(static_assert|static assertion)}} failed{{.*}}Character type of basic_string_view must be standard-layout}}
}
return 0;
diff --git a/libcxx/test/std/time/time.hms/hhmmss.fail.cpp b/libcxx/test/std/time/time.hms/hhmmss.fail.cpp
index c9d4788d7ad31..d900abad5c124 100644
--- a/libcxx/test/std/time/time.hms/hhmmss.fail.cpp
+++ b/libcxx/test/std/time/time.hms/hhmmss.fail.cpp
@@ -21,10 +21,10 @@ struct A {};
int main(int, char**)
{
- std::chrono::hh_mm_ss<void> h0; // expected-error-re@*:* {{static_assert failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
- std::chrono::hh_mm_ss<int> h1; // expected-error-re@*:* {{static_assert failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
- std::chrono::hh_mm_ss<std::string> h2; // expected-error-re@*:* {{static_assert failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
- std::chrono::hh_mm_ss<A> h3; // expected-error-re@*:* {{static_assert failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
+ std::chrono::hh_mm_ss<void> h0; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
+ std::chrono::hh_mm_ss<int> h1; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
+ std::chrono::hh_mm_ss<std::string> h2; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
+ std::chrono::hh_mm_ss<A> h3; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}template parameter of hh_mm_ss must be a std::chrono::duration}}
return 0;
}
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
index aa56b6d9cf25e..2dc8bd2e95177 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
@@ -25,12 +25,12 @@ struct TestType {};
void test_const_lvalue_cast_request_non_const_lvalue()
{
const std::any a;
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
// expected-error at any:* {{drops 'const' qualifier}}
std::any_cast<TestType &>(a); // expected-note {{requested here}}
const std::any a2(42);
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
// expected-error at any:* {{drops 'const' qualifier}}
std::any_cast<int&>(a2); // expected-note {{requested here}}
}
@@ -38,22 +38,22 @@ void test_const_lvalue_cast_request_non_const_lvalue()
void test_lvalue_any_cast_request_rvalue()
{
std::any a;
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
std::any_cast<TestType &&>(a); // expected-note {{requested here}}
std::any a2(42);
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
std::any_cast<int&&>(a2); // expected-note {{requested here}}
}
void test_rvalue_any_cast_request_lvalue()
{
std::any a;
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
// expected-error at any:* {{non-const lvalue reference to type 'TestType' cannot bind to a temporary}}
std::any_cast<TestType &>(std::move(a)); // expected-note {{requested here}}
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
// expected-error at any:* {{non-const lvalue reference to type 'int' cannot bind to a temporary}}
std::any_cast<int&>(42);
}
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
index 83fd47d95b515..a066c6af4998f 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
@@ -34,16 +34,16 @@ int main(int, char**)
{
std::any a;
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
std::any_cast<TestType &>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
std::any_cast<TestType &&>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
std::any_cast<TestType2 &>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
std::any_cast<TestType2 &&>(static_cast<std::any const&&>(a)); // expected-note {{requested here}}
return 0;
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
index c3cdfe7f94586..a3b3b3b6734e4 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
@@ -48,15 +48,15 @@ struct no_move {
int main(int, char**) {
std::any a;
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an lvalue reference or a CopyConstructible type}}
std::any_cast<no_copy>(static_cast<std::any&>(a)); // expected-note {{requested here}}
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be a const lvalue reference or a CopyConstructible type}}
std::any_cast<no_copy>(static_cast<std::any const&>(a)); // expected-note {{requested here}}
std::any_cast<no_copy>(static_cast<std::any &&>(a)); // OK
- // expected-error-re at any:* {{static_assert failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
+ // expected-error-re at any:* {{{{(static_assert|static assertion)}} failed{{.*}}ValueType is required to be an rvalue reference or a CopyConstructible type}}
std::any_cast<no_move>(static_cast<std::any &&>(a));
return 0;
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
index f362dd08645c6..4b3ce4d3a23e6 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
@@ -22,30 +22,30 @@ int main(int, char**)
{
std::any a = 1;
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int &>(&a); // expected-note {{requested here}}
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int &&>(&a); // expected-note {{requested here}}
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int const &>(&a); // expected-note {{requested here}}
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int const&&>(&a); // expected-note {{requested here}}
const std::any& a2 = a;
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int &>(&a2); // expected-note {{requested here}}
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int &&>(&a2); // expected-note {{requested here}}
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int const &>(&a2); // expected-note {{requested here}}
- // expected-error-re at any:* 1 {{static_assert failed{{.*}}_ValueType may not be a reference.}}
+ // expected-error-re at any:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}_ValueType may not be a reference.}}
std::any_cast<int const &&>(&a2); // expected-note {{requested here}}
return 0;
diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
index 5ab74bed27282..74342c7d0fdb4 100644
--- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
+++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
@@ -25,7 +25,7 @@ constexpr bool test() {
}
int main(int, char**) {
- // expected-error at +1 {{static_assert expression is not an integral constant expression}}
+ // expected-error-re at +1 {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(test());
return 0;
diff --git a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
index 729045961e1c4..f7d24998e09b5 100644
--- a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
@@ -40,7 +40,7 @@ int main(int, char**)
const int c = 1;
auto p = std::bind_front(pass, c);
- static_assert(p() == 1); // expected-error {{static_assert expression is not an integral constant expression}}
+ static_assert(p() == 1); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
auto d = std::bind_front(do_nothing, n); // expected-error {{no matching function for call to 'bind_front'}}
diff --git a/libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp b/libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
index 1394ff0c9d628..8ba71238a5f46 100644
--- a/libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
+++ b/libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
@@ -31,7 +31,7 @@ int main(int, char**)
#if TEST_HAS_BUILTIN(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
MakeSeqT i; // expected-error@*:* {{integer sequences must have non-negative sequence length}}
#else
- MakeSeqT i; // expected-error@*:* {{static_assert failed{{.*}}std::make_integer_sequence must have a non-negative sequence length}}
+ MakeSeqT i; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}std::make_integer_sequence must have a non-negative sequence length}}
#endif
return 0;
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
index f12b6808edeb3..a083e2d88b972 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
@@ -34,7 +34,7 @@ constexpr bool test()
int main(int, char**)
{
- static_assert(test<double>()); // expected-error {{static_assert expression is not an integral constant expression}}
- LIBCPP_STATIC_ASSERT(test<const double>()); // expected-error {{static_assert expression is not an integral constant expression}}
+ static_assert(test<double>()); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
+ LIBCPP_STATIC_ASSERT(test<const double>()); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
return 0;
}
diff --git a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
index 8b995a1784efe..f4865ff368079 100644
--- a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
+++ b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
@@ -22,7 +22,7 @@ int main(int, char**)
// expected-error at +1 {{no member named 'is_constant_evaluated' in namespace 'std'}}
bool b = std::is_constant_evaluated();
#else
- // expected-error at +1 {{static_assert failed}}
+ // expected-error-re at +1 {{{{(static_assert|static assertion)}} failed}}
static_assert(!std::is_constant_evaluated(), "");
// expected-warning at -1 0-1 {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
#endif
diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.fail.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.fail.cpp
index bb2483ecd2ca0..b3230d4602329 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.fail.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.fail.cpp
@@ -24,23 +24,23 @@ struct NonDestructible { ~NonDestructible() = delete; };
int main(int, char**)
{
{
- std::optional<char &> o1; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a reference type is ill-formed}}
- std::optional<NonDestructible> o2; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
- std::optional<char[20]> o3; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with an array type is ill-formed}}
+ std::optional<char &> o1; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a reference type is ill-formed}}
+ std::optional<NonDestructible> o2; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
+ std::optional<char[20]> o3; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with an array type is ill-formed}}
}
{
- std::optional< std::in_place_t> o1; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
- std::optional<const std::in_place_t> o2; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
- std::optional< volatile std::in_place_t> o3; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
- std::optional<const volatile std::in_place_t> o4; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
+ std::optional< std::in_place_t> o1; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
+ std::optional<const std::in_place_t> o2; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
+ std::optional< volatile std::in_place_t> o3; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
+ std::optional<const volatile std::in_place_t> o4; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with in_place_t is ill-formed}}
}
{
- std::optional< std::nullopt_t> o1; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
- std::optional<const std::nullopt_t> o2; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
- std::optional< volatile std::nullopt_t> o3; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
- std::optional<const volatile std::nullopt_t> o4; // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
+ std::optional< std::nullopt_t> o1; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
+ std::optional<const std::nullopt_t> o2; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
+ std::optional< volatile std::nullopt_t> o3; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
+ std::optional<const volatile std::nullopt_t> o4; // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
}
return 0;
diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
index 9b28b766be444..cd4c1bebf6b2d 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
@@ -30,7 +30,7 @@ int main(int, char**)
{
// optional(nullopt_t)
- std::optional opt(std::nullopt); // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
+ std::optional opt(std::nullopt); // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with nullopt_t is ill-formed}}
}
return 0;
diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
index e6b48b53b2185..4df41120d7e31 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
@@ -48,6 +48,6 @@ constexpr bool test() // expected-error {{constexpr function never produces a co
int main(int, char**)
{
static_assert (!std::is_trivially_move_constructible_v<S>, "" );
- static_assert (test(), ""); // expected-error {{static_assert expression is not an integral constant expression}}
+ static_assert (test(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
return 0;
}
diff --git a/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp b/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
index 3149e5a900db8..64e130caf839a 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
@@ -25,22 +25,22 @@ int main(int, char**)
{
using std::optional;
{
- // expected-error-re at optional:* 2 {{static_assert failed{{.*}}instantiation of optional with a reference type is ill-formed}}
+ // expected-error-re at optional:* 2 {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a reference type is ill-formed}}
optional<int&> opt1;
optional<int&&> opt2;
}
{
- // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
+ // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
optional<X> opt3;
}
{
- // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a non-object type is undefined behavior}}
- // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
+ // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a non-object type is undefined behavior}}
+ // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
optional<void()> opt4;
}
{
- // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a non-object type is undefined behavior}}
- // expected-error-re at optional:* {{static_assert failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
+ // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a non-object type is undefined behavior}}
+ // expected-error-re at optional:* {{{{(static_assert|static assertion)}} failed{{.*}}instantiation of optional with a non-destructible type is ill-formed}}
// expected-error at optional:* 1+ {{cannot form a reference to 'void'}}
optional<const void> opt4;
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
index 2599ec033cc73..2c297749f3b0a 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
@@ -27,7 +27,7 @@ int main(int, char**)
using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
using E2 = typename std::tuple_element<3, T>::type;
using E3 = typename std::tuple_element<4, T const>::type;
- // expected-error at __tuple:* 2 {{static_assert failed}}
+ // expected-error-re at __tuple:* 2 {{{{(static_assert|static assertion)}} failed}}
return 0;
diff --git a/libcxx/test/std/utilities/utility/forward/forward.fail.cpp b/libcxx/test/std/utilities/utility/forward/forward.fail.cpp
index 44ecddf744822..61a3e18340390 100644
--- a/libcxx/test/std/utilities/utility/forward/forward.fail.cpp
+++ b/libcxx/test/std/utilities/utility/forward/forward.fail.cpp
@@ -23,7 +23,7 @@ int main(int, char**)
{
{
(void)std::forward<A&>(source()); // expected-note {{requested here}}
- // expected-error-re@*:* 1 {{static_assert failed{{.*}}cannot forward an rvalue as an lvalue}}
+ // expected-error-re@*:* 1 {{{{(static_assert|static assertion)}} failed{{.*}}cannot forward an rvalue as an lvalue}}
}
{
const A ca = A();
diff --git a/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp b/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
index eaf7e79b971e5..ebc6020a484f3 100644
--- a/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
+++ b/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
@@ -75,7 +75,7 @@ int main(int, char**) {
using V = std::variant<int, ComparesToMyBoolExplicit>;
V v1(42);
V v2(101);
- // expected-error-re at variant:* 6 {{static_assert failed{{.*}}the relational operator does not return a type which is implicitly convertible to bool}}
+ // expected-error-re at variant:* 6 {{{{(static_assert|static assertion)}} failed{{.*}}the relational operator does not return a type which is implicitly convertible to bool}}
// expected-error at variant:* 6 {{no viable conversion}}
(void)(v1 == v2); // expected-note {{here}}
(void)(v1 != v2); // expected-note {{here}}
diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant_array.fail.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
index 0c531d0e0f847..39e2f9689915f 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
@@ -24,7 +24,7 @@
int main(int, char**)
{
- // expected-error at variant:* 3 {{static_assert failed}}
+ // expected-error-re at variant:* 3 {{{{(static_assert|static assertion)}} failed}}
std::variant<int, int[]> v; // expected-note {{requested here}}
std::variant<int, int[42]> v2; // expected-note {{requested here}}
std::variant<int, int[][42]> v3; // expected-note {{requested here}}
diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
index e57a6c8f38ae5..863947975ea55 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
@@ -19,7 +19,7 @@
int main(int, char**)
{
- // expected-error at variant:* 1 {{static_assert failed}}
+ // expected-error-re at variant:* 1 {{{{(static_assert|static assertion)}} failed}}
std::variant<> v; // expected-note {{requested here}}
return 0;
diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
index 193db411ec702..84ff882c7a228 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
@@ -19,7 +19,7 @@
int main(int, char**)
{
- // expected-error at variant:* 3 {{static_assert failed}}
+ // expected-error-re at variant:* 3 {{{{(static_assert|static assertion)}} failed}}
std::variant<int, int&> v; // expected-note {{requested here}}
std::variant<int, const int &> v2; // expected-note {{requested here}}
std::variant<int, int&&> v3; // expected-note {{requested here}}
diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant_void.fail.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant_void.fail.cpp
index ae7982069cd31..56c01a236a66f 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant_void.fail.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant_void.fail.cpp
@@ -24,7 +24,7 @@
int main(int, char**)
{
- // expected-error at variant:* 3 {{static_assert failed}}
+ // expected-error-re at variant:* 3 {{{{(static_assert|static assertion)}} failed}}
std::variant<int, void> v; // expected-note {{requested here}}
std::variant<int, const void> v2; // expected-note {{requested here}}
std::variant<const volatile void, int> v3; // expected-note {{requested here}}
More information about the libcxx-commits
mailing list