1 struct X { 2 int v; 3 typedef int t; 4 void f(X); 5 }; 6 7 struct YB { 8 typedef YB Y; 9 int value; 10 typedef int type; 11 }; 12 13 struct YBRev { 14 typedef int value; 15 int type; 16 }; 17 18 struct Z { 19 void f(Z); 20 }; 21 22 template<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 29 template<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 declarations 38 template<typename T> struct E : X, T { 39 // Mismatch in using/access-declaration-ness. 40 T::value; 41 X::v; 42 }; 43 #endif 44 45 template<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. 54 typedef C<YB>::type I; 55 typedef D<YBRev>::t I; 56 57 #if __cplusplus <= 199711L // C++11 does not allow access declarations 58 typedef E<YB>::type I; 59 #endif 60 61 typedef F<YB>::type I; 62 63 #if __cplusplus >= 201702L 64 template<typename ...T> struct G : T... { 65 using T::f...; 66 }; 67 using Q = decltype(G<X, Z>()); 68 #endif 69