diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-5.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-expr-5.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-expr-5.cpp b/test/SemaTemplate/instantiate-expr-5.cpp index 941dae4482..916c4f9493 100644 --- a/test/SemaTemplate/instantiate-expr-5.cpp +++ b/test/SemaTemplate/instantiate-expr-5.cpp @@ -1,4 +1,22 @@ -// RUN: %clang_cc1 -fsyntax-only %s +// RUN: %clang_cc1 -fsyntax-only -verify %s template <class A> int x(A x) { return x++; } int y() { return x<int>(1); } + +namespace PR5880 { + template<typename T> + struct A { + static const int a = __builtin_offsetof(T, a.array[5].m); // expected-error{{error: no member named 'a' in 'HasM'}} + }; + struct HasM { + float m; + }; + + struct ArrayOfHasM { + HasM array[10]; + }; + + struct B { ArrayOfHasM a; }; + A<B> x; + A<HasM> x2; // expected-note{{in instantiation of}} +} |