summaryrefslogtreecommitdiffstats
path: root/lib/AST/Mangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Mangle.cpp')
-rw-r--r--lib/AST/Mangle.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/Mangle.cpp b/lib/AST/Mangle.cpp
index 3a0b909..c3f3b11 100644
--- a/lib/AST/Mangle.cpp
+++ b/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
}
OpenPOWER on IntegriCloud