69 lines · c
1struct X {2 int v;3 typedef int t;4 void f(X);5};6 7struct YB {8 typedef YB Y;9 int value;10 typedef int type;11};12 13struct YBRev {14 typedef int value;15 int type;16};17 18struct Z {19 void f(Z);20};21 22template<typename T> struct C : X, T {23 using T::value;24 using typename T::type;25 using X::v;26 using typename X::t;27};28 29template<typename T> struct D : X, T {30 // Mismatch in type/non-type-ness.31 using typename T::value;32 using T::type;33 using X::v;34 using typename X::t;35};36 37#if __cplusplus <= 199711L // C++11 does not allow access declarations38template<typename T> struct E : X, T {39 // Mismatch in using/access-declaration-ness.40 T::value;41 X::v;42};43#endif44 45template<typename T> struct F : X, T {46 // Mismatch in nested-name-specifier.47 using T::Y::value;48 using typename T::Y::type;49 using ::X::v;50 using typename ::X::t;51};52 53// Force instantiation.54typedef C<YB>::type I;55typedef D<YBRev>::t I;56 57#if __cplusplus <= 199711L // C++11 does not allow access declarations58typedef E<YB>::type I;59#endif60 61typedef F<YB>::type I;62 63#if __cplusplus >= 201702L64template<typename ...T> struct G : T... {65 using T::f...;66};67using Q = decltype(G<X, Z>());68#endif69