diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-25 09:35:33 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-25 09:35:33 +0000 |
commit | c45c03c9dd5be775803cd14784f3bc49db363917 (patch) | |
tree | 62e7d329b9a47205ebff1a61452fa26ad0439b7e /clang/lib | |
parent | b18a46806b60b7abf67184f8ca8eb5e41809856d (diff) | |
download | bcm5719-llvm-c45c03c9dd5be775803cd14784f3bc49db363917.tar.gz bcm5719-llvm-c45c03c9dd5be775803cd14784f3bc49db363917.zip |
Ignore dependent bases in ADL. Fixes PR5271.
llvm-svn: 85054
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index abed5d4d170..93752e130c9 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -1239,6 +1239,14 @@ addAssociatedClassesAndNamespaces(CXXRecordDecl *Class, 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. |