Update clang::Decl::isUsed.

CheckVariableDeclaration calls mergeVarDecl, which updates isUsed.
And if the previous wasn't used the VD's used flag gets updated to not used too.
This commit is contained in:
Vassil Vassilev 2013-10-02 15:54:06 +02:00 committed by sftnight
parent eade01b61f
commit 8d16dd4791

View File

@ -272,8 +272,13 @@ namespace cling {
);
m_Sema->LookupName(Previous, S);
bool VDWasUsed = VD->isUsed();
m_Sema->CheckVariableDeclaration(VD, Previous);
// CheckVariableDeclaration calls mergeVarDecl, which updates isUsed.
// And if the previous wasn't used the VD's used flag gets updated to
// not used too.
if(VDWasUsed)
VD->setIsUsed(true);
}
if (ND->isInvalidDecl())