r233325 - [Modules] Fix tiny bug where we failed to get the canonical decl when
Chandler Carruth
chandlerc at gmail.com
Thu Mar 26 15:22:22 PDT 2015
Author: chandlerc
Date: Thu Mar 26 17:22:22 2015
New Revision: 233325
URL: http://llvm.org/viewvc/llvm-project?rev=233325&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=233325&r1=233324&r2=233325&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Thu Mar 26 17:22:22 2015
@@ -1628,7 +1628,7 @@ void ASTDeclReader::VisitCXXConstructorD
if (auto *CD = ReadDeclAs<CXXConstructorDecl>(Record, Idx))
if (D->isCanonicalDecl())
- D->setInheritedConstructor(CD);
+ D->setInheritedConstructor(CD->getCanonicalDecl());
D->IsExplicitSpecified = Record[Idx++];
}
More information about the cfe-commits
mailing list