diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-member-expr.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-member-expr.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-member-expr.cpp b/test/SemaTemplate/instantiate-member-expr.cpp index db13624..324363c 100644 --- a/test/SemaTemplate/instantiate-member-expr.cpp +++ b/test/SemaTemplate/instantiate-member-expr.cpp @@ -25,3 +25,27 @@ class RetainReleaseChecker { }; void f(GRExprEngine& Eng) { Eng.registerCheck(new RetainReleaseChecker); // expected-note {{in instantiation of function template specialization 'GRExprEngine::registerCheck<class RetainReleaseChecker>' requested here}} } + +// PR 5838 +namespace test1 { + template<typename T> struct A { + int a; + }; + + template<typename T> struct B : A<float>, A<T> { + void f() { + a = 0; // should not be ambiguous + } + }; + template struct B<int>; + + struct O { + int a; + template<typename T> struct B : A<T> { + void f() { + a = 0; // expected-error {{type 'struct test1::O' is not a direct or virtual base of ''B<int>''}} + } + }; + }; + template struct O::B<int>; // expected-note {{in instantiation}} +} |