[cfe-commits] r79999 - in /cfe/trunk: lib/AST/DeclCXX.cpp test/SemaTemplate/destructor-template.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Aug 25 09:37:49 PDT 2009
Author: fjahanian
Date: Tue Aug 25 11:37:49 2009
New Revision: 79999
URL: http://llvm.org/viewvc/llvm-project?rev=79999&view=rev
Log:
Skip over bases/fields with dependent types.
Fixes pr4771.
Added:
cfe/trunk/test/SemaTemplate/destructor-template.cpp
Modified:
cfe/trunk/lib/AST/DeclCXX.cpp
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=79999&r1=79998&r2=79999&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Tue Aug 25 11:37:49 2009
@@ -529,6 +529,8 @@
for (CXXRecordDecl::base_class_iterator VBase = ClassDecl->vbases_begin(),
E = ClassDecl->vbases_end(); VBase != E; ++VBase) {
+ if (VBase->getType()->isDependentType())
+ continue;
// Skip over virtual bases which have trivial destructors.
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(VBase->getType()->getAs<RecordType>()->getDecl());
@@ -543,6 +545,8 @@
E = ClassDecl->bases_end(); Base != E; ++Base) {
if (Base->isVirtual())
continue;
+ if (Base->getType()->isDependentType())
+ continue;
// Skip over virtual bases which have trivial destructors.
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
Added: cfe/trunk/test/SemaTemplate/destructor-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/destructor-template.cpp?rev=79999&view=auto
==============================================================================
--- cfe/trunk/test/SemaTemplate/destructor-template.cpp (added)
+++ cfe/trunk/test/SemaTemplate/destructor-template.cpp Tue Aug 25 11:37:49 2009
@@ -0,0 +1,12 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<typename A> class s0 {
+
+ template<typename B> class s1 : public s0<A> {
+ ~s1() {}
+ s0<A> ms0;
+ };
+
+};
+
+
More information about the cfe-commits
mailing list