[cfe-commits] r74262 - in /cfe/trunk: lib/Sema/SemaLookup.cpp test/SemaCXX/using-decl-1.cpp
Anders Carlsson
andersca at mac.com
Thu Jun 25 20:54:14 PDT 2009
Author: andersca
Date: Thu Jun 25 22:54:13 2009
New Revision: 74262
URL: http://llvm.org/viewvc/llvm-project?rev=74262&view=rev
Log:
Fix another assert related to using decls.
Added:
cfe/trunk/test/SemaCXX/using-decl-1.cpp
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=74262&r1=74261&r2=74262&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Thu Jun 25 22:54:13 2009
@@ -212,6 +212,9 @@
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;
Added: cfe/trunk/test/SemaCXX/using-decl-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/using-decl-1.cpp?rev=74262&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/using-decl-1.cpp (added)
+++ cfe/trunk/test/SemaCXX/using-decl-1.cpp Thu Jun 25 22:54:13 2009
@@ -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); }
+}
More information about the cfe-commits
mailing list