diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -1524,12 +1524,12 @@ // 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/test/SemaCXX/static-assert.cpp b/clang/test/SemaCXX/static-assert.cpp --- a/clang/test/SemaCXX/static-assert.cpp +++ b/clang/test/SemaCXX/static-assert.cpp @@ -2,47 +2,47 @@ 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 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 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 s1; // expected-note {{in instantiation of template class 'S' requested here}} S 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"}} // FIXME: render this as u8"\u03A9" -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"}} template struct AlwaysFails { // Only give one error here. - static_assert(false, ""); // expected-error {{static_assert failed}} + static_assert(false, ""); // expected-error {{static assertion failed}} }; AlwaysFails alwaysFails; template 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(); }; @@ -67,7 +67,7 @@ static const bool value = false; }; -static_assert(first_trait::value && second_trait::value, "message"); // expected-error{{static_assert failed due to requirement 'second_trait::value' "message"}} +static_assert(first_trait::value && second_trait::value, "message"); // expected-error{{static assertion failed due to requirement 'second_trait::value' "message"}} namespace std { @@ -111,29 +111,29 @@ }; static_assert(std::is_same::value, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_same::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_same::value' "message"}} static_assert(std::is_const::value, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_const::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_const::value' "message"}} static_assert(!std::is_const::value, "message"); -// expected-error@-1{{static_assert failed due to requirement '!std::is_const::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement '!std::is_const::value' "message"}} static_assert(!(std::is_const::value), "message"); -// expected-error@-1{{static_assert failed due to requirement '!(std::is_const::value)' "message"}} +// expected-error@-1{{static assertion failed due to requirement '!(std::is_const::value)' "message"}} static_assert(std::is_const::value == false, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_const::value == false' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_const::value == false' "message"}} static_assert(!(std::is_const::value == true), "message"); -// expected-error@-1{{static_assert failed due to requirement '!(std::is_const::value == true)' "message"}} +// expected-error@-1{{static assertion failed due to requirement '!(std::is_const::value == true)' "message"}} static_assert(std::is_const(), "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_const()' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_const()' "message"}} static_assert(!(std::is_const()()), "message"); -// expected-error@-1{{static_assert failed due to requirement '!(std::is_const()())' "message"}} +// expected-error@-1{{static assertion failed due to requirement '!(std::is_const()())' "message"}} static_assert(std::is_same()), int>::value, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_same, int>::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_same, int>::value' "message"}} static_assert(std::is_const::value, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_const::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_const::value' "message"}} static_assert(std::is_const::value, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_const::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_const::value' "message"}} static_assert(std::is_const::value, "message"); -// expected-error@-1{{static_assert failed due to requirement 'std::is_const::value' "message"}} +// expected-error@-1{{static assertion failed due to requirement 'std::is_const::value' "message"}} struct BI_tag {}; struct RAI_tag : BI_tag {}; @@ -146,7 +146,7 @@ template void foo() { static_assert(std::is_same::value, "message"); - // expected-error@-1{{static_assert failed due to requirement 'std::is_same::value' "message"}} + // expected-error@-1{{static assertion failed due to requirement 'std::is_same::value' "message"}} } template void foo(); // expected-note@-1{{in instantiation of function template specialization 'foo' requested here}} @@ -164,7 +164,7 @@ template void foo2() { static_assert(::ns::NestedTemplates1::NestedTemplates2::template NestedTemplates3::value, "message"); - // expected-error@-1{{static_assert failed due to requirement '::ns::NestedTemplates1::NestedTemplates2::NestedTemplates3::value' "message"}} + // expected-error@-1{{static assertion failed due to requirement '::ns::NestedTemplates1::NestedTemplates2::NestedTemplates3::value' "message"}} } template void foo2(); // expected-note@-1{{in instantiation of function template specialization 'foo2' requested here}} @@ -172,9 +172,9 @@ template void foo3(T t) { static_assert(std::is_const::value, "message"); - // expected-error-re@-1{{static_assert failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value' "message"}} + // expected-error-re@-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::value, "message"); - // expected-error-re@-1{{static_assert failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value' "message"}} + // expected-error-re@-1{{static assertion failed due to requirement 'std::is_const<(lambda at {{.*}}static-assert.cpp:{{[0-9]*}}:{{[0-9]*}})>::value' "message"}} } void callFoo3() { foo3([]() {}); @@ -192,7 +192,7 @@ 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;