1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template <class A
> int x(A x
) { return x
++; }
4 int y() { return x
<int>(1); }
9 static const int a
= __builtin_offsetof(T
, a
.array
[5].m
); // expected-error{{no member named 'a' in 'HasM'}}
19 struct B
{ ArrayOfHasM a
; };
21 A
<HasM
> x2
; // expected-note{{in instantiation of}}
24 struct AnonymousUnion
{
32 void test_anon_union() {
33 int array1
[__builtin_offsetof(AnonymousUnion
<T
>, f
) == 0? 1 : -1];
34 int array2
[__builtin_offsetof(AnonymousUnion
<int>, f
) == 0? 1 : -1];
37 template void test_anon_union
<int>();
40 namespace AddrOfClassMember
{
41 template <typename T
> struct S
{
44 +T::n
; // expected-error {{invalid use of member}}
47 void g() { S
<S
<int> >::f(); } // expected-note {{in instantiation of}}