// { dg-do compile { target c++26 } } #include #if !defined(__cpp_lib_is_virtual_base_of) || __cpp_lib_is_virtual_base_of < 202406L #error "__cpp_lib_is_virtual_base_of should have been defined to 202406L or more" #endif class B { }; class X : virtual public B { }; class Y : virtual public B { }; class Z : public B { }; class AA : public X, public Y, public Z { }; template constexpr bool test() { constexpr bool t1 = std::is_virtual_base_of::value; constexpr bool t2 = std::is_virtual_base_of_v; static_assert(t1 == t2); return t1; } void test01() { static_assert(!test()); static_assert( test()); static_assert( test()); static_assert(!test()); static_assert( test()); static_assert(!test()); static_assert(!test()); static_assert(!test()); }