[cfe-commits] r93398 - /cfe/trunk/lib/Sema/SemaCodeComplete.cpp

Douglas Gregor dgregor at apple.com
Wed Jan 13 17:17:14 PST 2010


Author: dgregor
Date: Wed Jan 13 19:17:14 2010
New Revision: 93398

URL: http://llvm.org/viewvc/llvm-project?rev=93398&view=rev
Log:
When providing completions for a member access expression in C++,
provided nested-name-specifier results for base classes (only), rather
than everything that could possibly be a nested-name-specifier.

Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=93398&r1=93397&r2=93398&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Wed Jan 13 19:17:14 2010
@@ -664,6 +664,9 @@
   if (UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(ND))
     ND = Using->getTargetDecl();
 
+  if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(ND))
+    return Record->isInjectedClassName();
+    
   return isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND) ||
     isa<ObjCPropertyDecl>(ND);
 }
@@ -2148,14 +2151,6 @@
         if (IsDependent)
           Results.MaybeAddResult(Result("template"));
       }
-
-      // We could have the start of a nested-name-specifier. Add those
-      // results as well.
-      // FIXME: We should really walk base classes to produce
-      // nested-name-specifiers so that we produce more-precise results.
-      Results.setFilter(&ResultBuilder::IsNestedNameSpecifier);
-      CollectLookupResults(S, Context.getTranslationUnitDecl(), 
-                           CurContext, Results);
     }
   } else if (!IsArrow && BaseType->getAsObjCInterfacePointerType()) {
     // Objective-C property reference.





More information about the cfe-commits mailing list