summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-26 22:43:07 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-26 22:43:07 +0000
commitc14922f14adc92b675204a5b68538b3f196bbe6a (patch)
treed01611e2ad32ac57753a6f0e6206a24b720db55e /clang/lib/Sema/SemaDeclCXX.cpp
parent9abbebedc848cf04bf861cac9a8c6946d6731978 (diff)
downloadbcm5719-llvm-c14922f14adc92b675204a5b68538b3f196bbe6a.tar.gz
bcm5719-llvm-c14922f14adc92b675204a5b68538b3f196bbe6a.zip
When adding initializers to a constructor, be sure that we are looking
through the bases and fields of the definition of the class in which the constructor is declared, rather than some other declaration of that class. llvm-svn: 99661
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 1f6630e3436..1b4710e3d08 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -1433,7 +1433,11 @@ Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
bool AnyErrors) {
// We need to build the initializer AST according to order of construction
// and not what user specified in the Initializers list.
- CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(Constructor->getDeclContext());
+ CXXRecordDecl *ClassDecl
+ = cast<CXXRecordDecl>(Constructor->getDeclContext())->getDefinition();
+ if (!ClassDecl)
+ return true;
+
llvm::SmallVector<CXXBaseOrMemberInitializer*, 32> AllToInit;
llvm::DenseMap<const void *, CXXBaseOrMemberInitializer*> AllBaseFields;
bool HasDependentBaseInit = false;
OpenPOWER on IntegriCloud