diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-08-20 00:39:40 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-08-20 00:39:40 +0000 |
commit | 0eaf10bc943d00f953fbd6870f0f431f891b6a11 (patch) | |
tree | b11aa801a3d18ada26d4be755741ba485f832bd1 /clang/test/SemaTemplate/instantiate-using-decl.cpp | |
parent | ef7280c7f408b0b01c1950d40769ef857028bd92 (diff) | |
download | bcm5719-llvm-0eaf10bc943d00f953fbd6870f0f431f891b6a11.tar.gz bcm5719-llvm-0eaf10bc943d00f953fbd6870f0f431f891b6a11.zip |
Fix name lookup with dependent using decls.
We previously mishandled UnresolvedUsingValueDecls in
NamedDecl::declarationReplaces, which caused us to forget decls
when there are multiple dependent using decls for the same name.
Fixes PR16936.
llvm-svn: 188737
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-using-decl.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-using-decl.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-using-decl.cpp b/clang/test/SemaTemplate/instantiate-using-decl.cpp index 1bfcb7a8650..a6a4ea0e0f6 100644 --- a/clang/test/SemaTemplate/instantiate-using-decl.cpp +++ b/clang/test/SemaTemplate/instantiate-using-decl.cpp @@ -80,3 +80,27 @@ namespace test3 { b.f1(); } } + +namespace PR16936 { + // Make sure both using decls are properly considered for + // overload resolution. + template<class> struct A { + void access(int); + }; + template<class> struct B { + void access(); + }; + template<class CELL> struct X : public A<CELL>, public B<CELL> { + using A<CELL>::access; + using B<CELL>::access; + + void f() { + access(0); + } + }; + + void f() { + X<int> x; + x.f(); + } +} |