[cfe-commits] r79923 - in /cfe/trunk: lib/AST/DeclCXX.cpp test/SemaTemplate/dependent-base-member-init.cpp
Fariborz Jahanian
fjahanian at apple.com
Mon Aug 24 10:19:23 PDT 2009
Author: fjahanian
Date: Mon Aug 24 12:19:23 2009
New Revision: 79923
URL: http://llvm.org/viewvc/llvm-project?rev=79923&view=rev
Log:
Fixes pr4763.
Modified:
cfe/trunk/lib/AST/DeclCXX.cpp
cfe/trunk/test/SemaTemplate/dependent-base-member-init.cpp
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=79923&r1=79922&r2=79923&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Mon Aug 24 12:19:23 2009
@@ -604,6 +604,8 @@
for (CXXRecordDecl::base_class_iterator VBase =
ClassDecl->vbases_begin(),
E = ClassDecl->vbases_end(); VBase != E; ++VBase) {
+ if (VBase->getType()->isDependentType())
+ continue;
if (CXXBaseOrMemberInitializer *Value =
AllBaseFields.lookup(VBase->getType()->getAs<RecordType>()))
AllToInit.push_back(Value);
@@ -611,8 +613,7 @@
CXXRecordDecl *VBaseDecl =
cast<CXXRecordDecl>(VBase->getType()->getAs<RecordType>()->getDecl());
assert(VBaseDecl && "setBaseOrMemberInitializers - VBaseDecl null");
- if (!VBaseDecl->getDefaultConstructor(C) &&
- !VBase->getType()->isDependentType())
+ if (!VBaseDecl->getDefaultConstructor(C))
Bases.push_back(VBase);
CXXBaseOrMemberInitializer *Member =
new (C) CXXBaseOrMemberInitializer(VBase->getType(), 0, 0,
@@ -628,6 +629,9 @@
// Virtuals are in the virtual base list and already constructed.
if (Base->isVirtual())
continue;
+ // Skip dependent types.
+ if (Base->getType()->isDependentType())
+ continue;
if (CXXBaseOrMemberInitializer *Value =
AllBaseFields.lookup(Base->getType()->getAs<RecordType>()))
AllToInit.push_back(Value);
@@ -635,8 +639,7 @@
CXXRecordDecl *BaseDecl =
cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
assert(BaseDecl && "setBaseOrMemberInitializers - BaseDecl null");
- if (!BaseDecl->getDefaultConstructor(C) &&
- !Base->getType()->isDependentType())
+ if (!BaseDecl->getDefaultConstructor(C))
Bases.push_back(Base);
CXXBaseOrMemberInitializer *Member =
new (C) CXXBaseOrMemberInitializer(Base->getType(), 0, 0,
Modified: cfe/trunk/test/SemaTemplate/dependent-base-member-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/dependent-base-member-init.cpp?rev=79923&r1=79922&r2=79923&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/dependent-base-member-init.cpp (original)
+++ cfe/trunk/test/SemaTemplate/dependent-base-member-init.cpp Mon Aug 24 12:19:23 2009
@@ -23,3 +23,10 @@
insert_iterator(_Container& __x) : container(&__x) {}
};
+// PR4763
+template<typename T> struct s0 {};
+template<typename T> struct s0_traits {};
+template<typename T> struct s1 : s0<typename s0_traits<T>::t0> {
+ s1() {}
+};
+
More information about the cfe-commits
mailing list