diff options
| author | John McCall <rjmccall@apple.com> | 2010-01-15 08:34:02 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-01-15 08:34:02 +0000 |
| commit | 38836f0f39527cd95c6f3c7e7fa82728fe8a4812 (patch) | |
| tree | 19c129265d3980ac68356c622b5651c12d53bb5a /clang/test/SemaTemplate/instantiate-member-expr.cpp | |
| parent | bcbdbfb3459fd41ed69319642336a79b64939f54 (diff) | |
| download | bcm5719-llvm-38836f0f39527cd95c6f3c7e7fa82728fe8a4812.tar.gz bcm5719-llvm-38836f0f39527cd95c6f3c7e7fa82728fe8a4812.zip | |
Don't repeat lookup when instantiating resolved member expressions.
Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit
member accesses, which can arise from unqualified lookups and therefore may
reference decls from enclosing class scopes.
Fixes PR 5838.
llvm-svn: 93510
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-member-expr.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/instantiate-member-expr.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-member-expr.cpp b/clang/test/SemaTemplate/instantiate-member-expr.cpp index db13624d442..324363ce96d 100644 --- a/clang/test/SemaTemplate/instantiate-member-expr.cpp +++ b/clang/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}} +} |

