From d6111d3c6d214e5049b731ed4b13c1847034211a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 25 May 2013 01:03:03 +0000 Subject: [PATCH] Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID (V2). llvm-svn: 182698 --- clang/lib/Basic/SourceManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index dfd2a1baf4e6..0de5129a358f 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -2043,7 +2043,7 @@ bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS, // is a serialized one referring to a file that was removed after we loaded // the PCH. if (LOffs.first.isInvalid() || ROffs.first.isInvalid()) - return LOffs.first.isInvalid(); + return LOffs.first.isInvalid() && !ROffs.first.isInvalid(); // If the source locations are in the same file, just compare offsets. if (LOffs.first == ROffs.first)