diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-15 01:44:47 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-15 01:44:47 +0000 |
commit | d0d2ee0e4bbe915d649e983c12d37bcfcf58823c (patch) | |
tree | e84d564718d0297f1e487a709313b739337bd066 /clang/test | |
parent | cefa7addc88b8f34501fd23250dca5772ef9f594 (diff) | |
download | bcm5719-llvm-d0d2ee0e4bbe915d649e983c12d37bcfcf58823c.tar.gz bcm5719-llvm-d0d2ee0e4bbe915d649e983c12d37bcfcf58823c.zip |
When performing qualified name lookup into the current instantiation,
do not look into base classes if there are any dependent base
classes. Instead, note in the lookup result that we couldn't look into
any dependent bases. Use that new result kind to detect when this case
occurs, so that we can fall back to treating the type/value/etc. as a
member of an unknown specialization.
Fixes an issue where we were resolving lookup at template definition
time and then missing an ambiguity at template instantiation time.
llvm-svn: 93497
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaTemplate/dependent-base-classes.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-base-classes.cpp b/clang/test/SemaTemplate/dependent-base-classes.cpp index b9666dba61c..79b28c2239f 100644 --- a/clang/test/SemaTemplate/dependent-base-classes.cpp +++ b/clang/test/SemaTemplate/dependent-base-classes.cpp @@ -63,3 +63,22 @@ namespace PR6031 { } }; } + +namespace Ambig { + template<typename T> + struct Base1 { + typedef int type; // expected-note{{member found by ambiguous name lookup}} + }; + + struct Base2 { + typedef float type; // expected-note{{member found by ambiguous name lookup}} + }; + + template<typename T> + struct Derived : Base1<T>, Base2 { + typedef typename Derived::type type; // expected-error{{member 'type' found in multiple base classes of different types}} + type *foo(float *fp) { return fp; } + }; + + Derived<int> di; // expected-note{{instantiation of}} +} |