[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.

llvm-svn: 233325
This commit is contained in:
Chandler Carruth 2015-03-26 22:22:22 +00:00
parent b051389f04
commit 36e25f4771
1 changed files with 1 additions and 1 deletions

View File

@ -1628,7 +1628,7 @@ void ASTDeclReader::VisitCXXConstructorDecl(CXXConstructorDecl *D) {
if (auto *CD = ReadDeclAs<CXXConstructorDecl>(Record, Idx))
if (D->isCanonicalDecl())
D->setInheritedConstructor(CD);
D->setInheritedConstructor(CD->getCanonicalDecl());
D->IsExplicitSpecified = Record[Idx++];
}