aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-06-26 03:54:13 +0000
committerAnders Carlsson <andersca@mac.com>2009-06-26 03:54:13 +0000
commitbc13ab2bc75bd997a2a40e371f50a4c456d8ee69 (patch)
treee858f39a6f5201b4f4f2b406225b13baff566121
parent5c7f786e3269ee2b512ecf13ccf556c47be83a76 (diff)
Fix another assert related to using decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74262 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaLookup.cpp3
-rw-r--r--test/SemaCXX/using-decl-1.cpp8
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 4d25f5b480..0d5c54530a 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -212,6 +212,9 @@ MergeLookupResults(ASTContext &Context, LookupResultsTy &Results) {
case LResult::Found: {
NamedDecl *ND = I->getAsDecl();
+ if (UsingDecl *UD = dyn_cast<UsingDecl>(ND))
+ ND = UD->getTargetDecl();
+
if (TagDecl *TD = dyn_cast<TagDecl>(ND)) {
TagFound = Context.getCanonicalDecl(TD);
TagNames += FoundDecls.insert(TagFound)? 1 : 0;
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp
new file mode 100644
index 0000000000..2459f251de
--- /dev/null
+++ b/test/SemaCXX/using-decl-1.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+extern "C" { void f(bool); }
+
+namespace std {
+ using ::f;
+ inline void f() { return f(true); }
+}