[cfe-commits] r146680 - in /cfe/trunk: lib/Sema/SemaLookup.cpp test/Modules/decldef.mm

Douglas Gregor dgregor at apple.com
Thu Dec 15 12:36:27 PST 2011


Author: dgregor
Date: Thu Dec 15 14:36:27 2011
New Revision: 146680

URL: http://llvm.org/viewvc/llvm-project?rev=146680&view=rev
Log:
When name lookup finds a module-private Objective-C class declaration,
check whether any previous declarations of the class were visible.

Modified:
    cfe/trunk/lib/Sema/SemaLookup.cpp
    cfe/trunk/test/Modules/decldef.mm

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=146680&r1=146679&r2=146680&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Thu Dec 15 14:36:27 2011
@@ -1063,6 +1063,8 @@
     return FD->getPreviousDeclaration();
   if (RedeclarableTemplateDecl *RTD = dyn_cast<RedeclarableTemplateDecl>(D))
     return RTD->getPreviousDeclaration();
+  if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D))
+    return ID->getPreviousDeclaration();
   
   return 0;
 }

Modified: cfe/trunk/test/Modules/decldef.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/decldef.mm?rev=146680&r1=146679&r2=146680&view=diff
==============================================================================
--- cfe/trunk/test/Modules/decldef.mm (original)
+++ cfe/trunk/test/Modules/decldef.mm Thu Dec 15 14:36:27 2011
@@ -7,9 +7,7 @@
 
 __import_module__ decldef.Decl;
 
-// FIXME: No link between @interface (which we can't see) and @class
-// (which we can).
-// A *a2;
+A *a2;
 B *b;
 
 void testB() {





More information about the cfe-commits mailing list