forked from OSchip/llvm-project
[clang-format] Don't format qualifiers in PPDirective
Fixes #54513 Differential Revision: https://reviews.llvm.org/D122548
This commit is contained in:
parent
d394f9f897
commit
eee536dd31
|
@ -407,6 +407,8 @@ LeftRightQualifierAlignmentFixer::analyze(
|
|||
assert(QualifierToken != tok::identifier && "Unrecognised Qualifier");
|
||||
|
||||
for (AnnotatedLine *Line : AnnotatedLines) {
|
||||
if (Line->InPPDirective)
|
||||
continue;
|
||||
FormatToken *First = Line->First;
|
||||
assert(First);
|
||||
if (First->Finalized)
|
||||
|
|
|
@ -815,6 +815,7 @@ TEST_F(QualifierFixerTest, NoOpQualifierReplacements) {
|
|||
ReplacementCount = 0;
|
||||
EXPECT_EQ(ReplacementCount, 0);
|
||||
verifyFormat("static const uint32 foo[] = {0, 31};", Style);
|
||||
verifyFormat("#define MACRO static const", Style);
|
||||
EXPECT_EQ(ReplacementCount, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue