diff options
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 9d10f1de8a..9038a25082 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -4153,8 +4153,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation, !CopyConstructor->isUsed()) && "DefineImplicitCopyConstructor - call it for implicit copy ctor"); - CXXRecordDecl *ClassDecl - = cast<CXXRecordDecl>(CopyConstructor->getDeclContext()); + CXXRecordDecl *ClassDecl = CopyConstructor->getParent(); assert(ClassDecl && "DefineImplicitCopyConstructor - invalid constructor"); DeclContext *PreviousContext = CurContext; |