|
@@ -39,6 +39,7 @@ struct B {};
|
|
struct B1 : B {};
|
|
struct B1 : B {};
|
|
struct B2 : B {};
|
|
struct B2 : B {};
|
|
struct D : private B1, private B2 {};
|
|
struct D : private B1, private B2 {};
|
|
|
|
+struct I0; // incomplete
|
|
|
|
|
|
int main(int, char**)
|
|
int main(int, char**)
|
|
{
|
|
{
|
|
@@ -54,5 +55,19 @@ int main(int, char**)
|
|
test_is_not_base_of<B[3], D[3]>();
|
|
test_is_not_base_of<B[3], D[3]>();
|
|
test_is_not_base_of<int, int>();
|
|
test_is_not_base_of<int, int>();
|
|
|
|
|
|
|
|
+// A scalar is never the base class of anything (including incomplete types)
|
|
|
|
+ test_is_not_base_of<int, B>();
|
|
|
|
+ test_is_not_base_of<int, B1>();
|
|
|
|
+ test_is_not_base_of<int, B2>();
|
|
|
|
+ test_is_not_base_of<int, D>();
|
|
|
|
+ test_is_not_base_of<int, I0>();
|
|
|
|
+
|
|
|
|
+// A scalar never has base classes (including incomplete types)
|
|
|
|
+ test_is_not_base_of<B, int>();
|
|
|
|
+ test_is_not_base_of<B1, int>();
|
|
|
|
+ test_is_not_base_of<B2, int>();
|
|
|
|
+ test_is_not_base_of<D, int>();
|
|
|
|
+ test_is_not_base_of<I0, int>();
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|