Richard Smith | be3980b | 2015-03-27 00:41:57 +0000 | [diff] [blame] | 1 | struct A { int a_member; }; |
Richard Smith | 9a71c99 | 2015-03-27 20:16:58 +0000 | [diff] [blame^] | 2 | inline int use_a(A a) { return a.a_member; } |
Richard Smith | be3980b | 2015-03-27 00:41:57 +0000 | [diff] [blame] | 3 | |
Richard Smith | 65ebb4a | 2015-03-26 04:09:53 +0000 | [diff] [blame] | 4 | class B { |
| 5 | struct Inner1 {}; |
Richard Smith | be3980b | 2015-03-27 00:41:57 +0000 | [diff] [blame] | 6 | public: |
Richard Smith | 65ebb4a | 2015-03-26 04:09:53 +0000 | [diff] [blame] | 7 | struct Inner2; |
| 8 | }; |
Richard Smith | be3980b | 2015-03-27 00:41:57 +0000 | [diff] [blame] | 9 | // Check that lookup and access checks are performed in the right context. |
Richard Smith | 65ebb4a | 2015-03-26 04:09:53 +0000 | [diff] [blame] | 10 | struct B::Inner2 : Inner1 {}; |
Richard Smith | be3980b | 2015-03-27 00:41:57 +0000 | [diff] [blame] | 11 | |
| 12 | // Check that base-specifiers are correctly disambiguated. |
| 13 | template<int N> struct C_Base { struct D { constexpr operator int() const { return 0; } }; }; |
| 14 | const int C_Const = 0; |
| 15 | struct C1 : C_Base<C_Base<0>::D{}> {} extern c1; |
| 16 | struct C2 : C_Base<C_Const<0>::D{} extern c2; |
Richard Smith | a523022 | 2015-03-27 01:37:43 +0000 | [diff] [blame] | 17 | |
| 18 | typedef struct { int a; void f(); struct X; } D; |
| 19 | struct D::X { int dx; } extern dx; |
Richard Smith | 9a71c99 | 2015-03-27 20:16:58 +0000 | [diff] [blame^] | 20 | inline int use_dx(D::X dx) { return dx.dx; } |