From 67af2071cc5101c4560c745d3b999a82beb5e4e6 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 26 Mar 2015 22:22:22 +0000 Subject: [PATCH] [Modules] Fix tiny bug where we failed to get the canonical decl when deserializing an inherited constructor. This is the exact same logic we use when deserializing method overrides for the same reason: the canonical decl may end up pinned to a different decl when we are improting modules, we need to re-pin to the canonical one during reading. My test case for this will come in a subsequent commit. I was trying to test a more tricky bug fix and the test case happened to tickle this bug as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233325 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTReaderDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 184e6d7772..3499c8ea48 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -1628,7 +1628,7 @@ void ASTDeclReader::VisitCXXConstructorDecl(CXXConstructorDecl *D) { if (auto *CD = ReadDeclAs(Record, Idx)) if (D->isCanonicalDecl()) - D->setInheritedConstructor(CD); + D->setInheritedConstructor(CD->getCanonicalDecl()); D->IsExplicitSpecified = Record[Idx++]; } -- 2.40.0