Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serialize PragmaAssumeNonNullLoc to support preambles
Previously, if a `#pragma clang assume_nonnull begin` was at the end of a premable with a `#pragma clang assume_nonnull end` at the end of the main file, clang would diagnose an unterminated begin in the preamble and an unbalanced end in the main file. With this change, those errors no longer occur and the case above is now properly handled. I've added a corresponding test to clangd, which makes use of preambles, in order to verify this works as expected. Differential Revision: https://reviews.llvm.org/D122179
- Loading branch information
1 parent
1711020
commit d9739f2
Showing
8 changed files
with
104 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source local %s 2>&1 \ | ||
// RUN: | FileCheck %s --implicit-check-not "error:" | ||
|
||
#pragma clang assume_nonnull begin | ||
void foo(int *x); | ||
#pragma clang assume_nonnull end |