@@ -991,6 +991,10 @@ static_assert(__is_abstract(Overrides));
991991// expected-note@-1 {{because it overrides all pure virtual functions from base class 'Abstract1'}} \
992992// expected-note@-1 {{because it overrides all pure virtual functions from base class 'Abstract2'}} \
993993
994+ static_assert (__is_abstract(NonAbstract));
995+ // expected-error@-1 {{static assertion failed due to requirement '__is_abstract(is_abstract_tests::NonAbstract)'}} \
996+ // expected-note@-1 {{'NonAbstract' is not abstract}}
997+
994998// Inheriting over two levels reports the last class only although the source of the pure virtual function
995999// is the top-most base.
9961000struct Derived : Abstract1 {
@@ -1012,7 +1016,7 @@ static_assert(__is_abstract(I));
10121016// expected-note@-1 {{'I' (aka 'int') is not abstract}} \
10131017// expected-note@-1 {{because it is not a struct or class type}}
10141018
1015- using Fty = void (); // function type
1019+ using Fty = void ();
10161020static_assert (__is_abstract(Fty));
10171021// expected-error@-1 {{static assertion failed due to requirement '__is_abstract(void ())'}} \
10181022// expected-note@-1 {{'Fty' (aka 'void ()') is not abstract}} \
@@ -1023,6 +1027,7 @@ using Arr = int[3];
10231027static_assert (__is_abstract(Arr));
10241028// expected-error@-1 {{static assertion failed due to requirement '__is_abstract(int[3])'}} \
10251029// expected-note@-1 {{'Arr' (aka 'int[3]') is not abstract}} \
1030+ // expected-note@-1 {{because it is an array type}} \
10261031// expected-note@-1 {{because it is not a struct or class type}}
10271032
10281033using Ref = int &;
@@ -1036,7 +1041,14 @@ using Ptr = int*;
10361041static_assert (__is_abstract(Ptr));
10371042// expected-error@-1 {{static assertion failed due to requirement '__is_abstract(int *)'}} \
10381043// expected-note@-1 {{'Ptr' (aka 'int *') is not abstract}} \
1044+ // expected-note@-1 {{because it is a pointer type}} \
10391045// expected-note@-1 {{because it is not a struct or class type}}
10401046
1047+ union U { int x; float y;};
1048+ static_assert (__is_abstract(U));
1049+ // expected-error@-1 {{static assertion failed due to requirement '__is_abstract(is_abstract_tests::U)'}} \
1050+ // expected-note@-1 {{'U' is not abstract}} \
1051+ // expected-note@-1 {{because it is a union type}} \
1052+ // expected-note@-1 {{because it is not a struct or class type}}
10411053
10421054}
0 commit comments