1 | struct X { |
2 | int v; |
3 | typedef int t; |
4 | }; |
5 | |
6 | struct YB { |
7 | typedef YB Y; |
8 | int value; |
9 | typedef int type; |
10 | }; |
11 | |
12 | struct YBRev { |
13 | typedef int value; |
14 | int type; |
15 | }; |
16 | |
17 | template<typename T> struct C : X, T { |
18 | using T::value; |
19 | using typename T::type; |
20 | using X::v; |
21 | using typename X::t; |
22 | }; |
23 | |
24 | template<typename T> struct D : X, T { |
25 | // Mismatch in type/non-type-ness. |
26 | using typename T::value; |
27 | using T::type; |
28 | using X::v; |
29 | using typename X::t; |
30 | }; |
31 | |
32 | #if __cplusplus <= 199711L // C++11 does not allow access declarations |
33 | template<typename T> struct E : X, T { |
34 | // Mismatch in using/access-declaration-ness. |
35 | T::value; |
36 | X::v; |
37 | }; |
38 | #endif |
39 | |
40 | template<typename T> struct F : X, T { |
41 | // Mismatch in nested-name-specifier. |
42 | using T::Y::value; |
43 | using typename T::Y::type; |
44 | using ::X::v; |
45 | using typename ::X::t; |
46 | }; |
47 | |
48 | // Force instantiation. |
49 | typedef C<YB>::type I; |
50 | typedef D<YBRev>::t I; |
51 | |
52 | #if __cplusplus <= 199711L // C++11 does not allow access declarations |
53 | typedef E<YB>::type I; |
54 | #endif |
55 | |
56 | typedef F<YB>::type I; |
57 | |