summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-08-28 17:57:07 +0000
committerAnders Carlsson <andersca@mac.com>2009-08-28 17:57:07 +0000
commit01ff6d70944dc2b06ec4c2a6340a7bbe839a26d8 (patch)
tree1696c802e29dd7c73f68fc6b093b3743c4f8a863
parent18f4107eb7e66784f70d5914453444bd9bc48bc7 (diff)
downloadbcm5719-llvm-01ff6d70944dc2b06ec4c2a6340a7bbe839a26d8.tar.gz
bcm5719-llvm-01ff6d70944dc2b06ec4c2a6340a7bbe839a26d8.zip
Check for UnresolvedUsingDecl when determining if a declaration is a redeclaration or not.
llvm-svn: 80383
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
-rw-r--r--clang/test/SemaCXX/using-decl-templates.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 15e8bc3ab8c..85b5963a39d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2899,7 +2899,7 @@ void Sema::CheckFunctionDeclaration(FunctionDecl *NewFD, NamedDecl *&PrevDecl,
if (PrevDecl &&
(!AllowOverloadingOfFunction(PrevDecl, Context) ||
!IsOverload(NewFD, PrevDecl, MatchedDecl)) &&
- !isa<UsingDecl>(PrevDecl)) {
+ !isa<UsingDecl>(PrevDecl) && !isa<UnresolvedUsingDecl>(PrevDecl)) {
Redeclaration = true;
Decl *OldDecl = PrevDecl;
diff --git a/clang/test/SemaCXX/using-decl-templates.cpp b/clang/test/SemaCXX/using-decl-templates.cpp
index 13ee1b2dd3e..b7cc69ae521 100644
--- a/clang/test/SemaCXX/using-decl-templates.cpp
+++ b/clang/test/SemaCXX/using-decl-templates.cpp
@@ -14,3 +14,9 @@ template<typename T> struct B : A<T> {
};
B<int> a; // expected-note{{in instantiation of template class 'struct B<int>' requested here}}
+
+template<typename T> struct C : A<T> {
+ using A<T>::f;
+
+ void f() { };
+};
OpenPOWER on IntegriCloud