blob: 916c4f949311cfb15858cd0d0db225ae25215ac0 [file] [log] [blame]
Douglas Gregor8ecdb652010-04-28 22:16:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Eli Friedmande99a452009-07-22 22:25:00 +00002
3template <class A> int x(A x) { return x++; }
4int y() { return x<int>(1); }
Douglas Gregor8ecdb652010-04-28 22:16:22 +00005
6namespace PR5880 {
7 template<typename T>
8 struct A {
9 static const int a = __builtin_offsetof(T, a.array[5].m); // expected-error{{error: no member named 'a' in 'HasM'}}
10 };
11 struct HasM {
12 float m;
13 };
14
15 struct ArrayOfHasM {
16 HasM array[10];
17 };
18
19 struct B { ArrayOfHasM a; };
20 A<B> x;
21 A<HasM> x2; // expected-note{{in instantiation of}}
22}