Fix an off-by-one error when computing the precompiled preamble for
code completion. We were allowing the preamble to include the line
that we're code-completing on. Again, testcase is forthcoming.
llvm-svn: 112064
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 16aa6e3..fe460bb 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1797,7 +1797,8 @@
if (const FileStatus *MainStatus = MainPath.getFileStatus())
if (CompleteFileStatus->getUniqueID() == MainStatus->getUniqueID())
OverrideMainBuffer
- = getMainBufferWithPrecompiledPreamble(CCInvocation, false, Line);
+ = getMainBufferWithPrecompiledPreamble(CCInvocation, false,
+ Line - 1);
}
// If the main file has been overridden due to the use of a preamble,