[cfe-commits] r85054 - /cfe/trunk/lib/Sema/SemaLookup.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Sun Oct 25 02:35:34 PDT 2009


Author: cornedbee
Date: Sun Oct 25 04:35:33 2009
New Revision: 85054

URL: http://llvm.org/viewvc/llvm-project?rev=85054&view=rev
Log:
Ignore dependent bases in ADL. Fixes PR5271.

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=85054&r1=85053&r2=85054&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Sun Oct 25 04:35:33 2009
@@ -1239,6 +1239,14 @@
                                          BaseEnd = Class->bases_end();
          Base != BaseEnd; ++Base) {
       const RecordType *BaseType = Base->getType()->getAs<RecordType>();
+      // In dependent contexts, we do ADL twice, and the first time around,
+      // the base type might be a dependent TemplateSpecializationType, or a
+      // TemplateTypeParmType. If that happens, simply ignore it.
+      // FIXME: If we want to support export, we probably need to add the
+      // namespace of the template in a TemplateSpecializationType, or even
+      // the classes and namespaces of known non-dependent arguments.
+      if (!BaseType)
+        continue;
       CXXRecordDecl *BaseDecl = cast<CXXRecordDecl>(BaseType->getDecl());
       if (AssociatedClasses.insert(BaseDecl)) {
         // Find the associated namespace for this base class.





More information about the cfe-commits mailing list