blob: f864d5762d26320d9811ac5f36cb97cc1415e44c [file] [log] [blame]
Richard Smithbe3980b2015-03-27 00:41:57 +00001struct A { int a_member; };
Richard Smith9a71c992015-03-27 20:16:58 +00002inline int use_a(A a) { return a.a_member; }
Richard Smithbe3980b2015-03-27 00:41:57 +00003
Richard Smith65ebb4a2015-03-26 04:09:53 +00004class B {
5 struct Inner1 {};
Richard Smithbe3980b2015-03-27 00:41:57 +00006public:
Richard Smith65ebb4a2015-03-26 04:09:53 +00007 struct Inner2;
Richard Smithd6aab592015-03-27 21:57:41 +00008 template<typename T> void f();
Richard Smith65ebb4a2015-03-26 04:09:53 +00009};
Richard Smithbe3980b2015-03-27 00:41:57 +000010// Check that lookup and access checks are performed in the right context.
Richard Smith65ebb4a2015-03-26 04:09:53 +000011struct B::Inner2 : Inner1 {};
Richard Smithd6aab592015-03-27 21:57:41 +000012template<typename T> void B::f() {}
Richard Smithbe3980b2015-03-27 00:41:57 +000013
14// Check that base-specifiers are correctly disambiguated.
15template<int N> struct C_Base { struct D { constexpr operator int() const { return 0; } }; };
16const int C_Const = 0;
17struct C1 : C_Base<C_Base<0>::D{}> {} extern c1;
18struct C2 : C_Base<C_Const<0>::D{} extern c2;
Richard Smitha5230222015-03-27 01:37:43 +000019
20typedef struct { int a; void f(); struct X; } D;
21struct D::X { int dx; } extern dx;
Richard Smith9a71c992015-03-27 20:16:58 +000022inline int use_dx(D::X dx) { return dx.dx; }
Richard Smithd6aab592015-03-27 21:57:41 +000023
24template<typename T> int E(T t) { return t; }
25
26template<typename T> struct F {
27 int f();
28 template<typename U> int g();
Richard Smith82e57fb2015-05-19 00:49:29 +000029 static int n;
Richard Smithd6aab592015-03-27 21:57:41 +000030};
31template<typename T> int F<T>::f() { return 0; }
32template<typename T> template<typename U> int F<T>::g() { return 0; }
Richard Smith82e57fb2015-05-19 00:49:29 +000033template<typename T> int F<T>::n = 0;
Richard Smithc7e6ff02015-05-18 20:36:47 +000034template<> template<typename U> int F<char>::g() { return 0; }
35template<> struct F<void> { int h(); };
36inline int F<void>::h() { return 0; }
37template<typename T> struct F<T *> { int i(); };
38template<typename T> int F<T*>::i() { return 0; }
Richard Smithd9ba2242015-05-07 03:54:19 +000039
40namespace G {
41 enum A { a, b, c, d, e };
42 enum { f, g, h };
43 typedef enum { i, j } k;
44 typedef enum {} l;
45}