diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-11 17:19:42 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-06-11 17:19:42 +0000 |
commit | 938f40b5aa98165826536c67237fc3329d7c1d80 (patch) | |
tree | 05bea26a37c2198bd5e11e42de38021651c1ef15 /clang/lib/AST/Mangle.cpp | |
parent | 1c2d29e3c30c852c4a541c24e39897e1de267890 (diff) | |
download | bcm5719-llvm-938f40b5aa98165826536c67237fc3329d7c1d80.tar.gz bcm5719-llvm-938f40b5aa98165826536c67237fc3329d7c1d80.zip |
Implement support for C++11 in-class initialization of non-static data members.
llvm-svn: 132878
Diffstat (limited to 'clang/lib/AST/Mangle.cpp')
-rw-r--r-- | clang/lib/AST/Mangle.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp index 3a0b9094307..c3f3b11cacc 100644 --- a/clang/lib/AST/Mangle.cpp +++ b/clang/lib/AST/Mangle.cpp @@ -48,6 +48,11 @@ static void checkMangleDC(const DeclContext *DC, const BlockDecl *BD) { const DeclContext *ExpectedDC = BD->getDeclContext(); while (isa<BlockDecl>(ExpectedDC) || isa<EnumDecl>(ExpectedDC)) ExpectedDC = ExpectedDC->getParent(); + // In-class initializers for non-static data members are lexically defined + // within the class, but are mangled as if they were specified as constructor + // member initializers. + if (isa<CXXRecordDecl>(ExpectedDC) && DC != ExpectedDC) + DC = DC->getParent(); assert(DC == ExpectedDC && "Given decl context did not match expected!"); #endif } |