diff options
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 3 | ||||
-rw-r--r-- | test/SemaCXX/using-decl-1.cpp | 8 |
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); } +} |