Revert the right cached files even when there are macros involved.

Fix the semantic of the test.
This commit is contained in:
Vassil Vassilev 2013-10-02 14:40:12 +02:00 committed by sftnight
parent a0df2fac1d
commit a1395d0401
2 changed files with 6 additions and 6 deletions

View File

@ -194,7 +194,7 @@ namespace cling {
void DeclReverter::PreVisitDecl(Decl *D) {
const SourceLocation Loc = D->getLocStart();
const SourceManager& SM = m_Sema->getSourceManager();
FileID FID = SM.getFileID(Loc);
FileID FID = SM.getFileID(SM.getSpellingLoc(Loc));
if (!FID.isInvalid() && !m_FilesToUncache.count(FID))
m_FilesToUncache.insert(FID);
}

View File

@ -3,15 +3,15 @@
#define BEGIN_NAMESPACE namespace test_namespace {
#define END_NAMESPACE }
.storeState "testMacroExpansion"
.rawInput 1
.rawInput 1
BEGIN_NAMESPACE int j; END_NAMESPACE
BEGIN_NAMESPACE int j; END_NAMESPACE // expected-error {{redefinition of 'j'}} expected-note {{previous definition is here}}
.rawInput 0
.storeState "testMacroExpansion"
BEGIN_NAMESPACE int j; END_NAMESPACE // expected-error {{redefinition of 'j'}} expected-note {{previous definition is here}}
.compareState "testMacroExpansion"
// CHECK-NOT: File with AST differencies stored in: testMacroExpansionAST.diff
.rawInput 0
// CHECK-NOT: Differences
// Make FileCheck happy with having at least one positive rule:
int a = 5
// CHECK: (int) 5