This is an archive of the discontinued LLVM Phabricator instance.

[Diagnostic] make Wmisleading-indendation not warn about labels
ClosedPublic

Authored by Tyker on Jan 4 2020, 8:41 AM.

Diff Detail

Event Timeline

Tyker created this revision.Jan 4 2020, 8:41 AM
aaron.ballman added inline comments.Jan 4 2020, 10:08 AM
clang/lib/Parse/ParseStmt.cpp
1278–1279

Can this be triggered by other forms of syntax than labels? e.g.,

for ( auto
a :
whatever) {}

struct S {
int
a:
1
};

// or, with contract attributes
[[
pre :
true]]
Tyker marked an inline comment as done.Jan 4 2020, 10:27 AM
Tyker added inline comments.
clang/lib/Parse/ParseStmt.cpp
1278–1279

none of them are valid beginning of statements so they won't occur here. and worse case this will only disable the warning.

aaron.ballman accepted this revision.Jan 6 2020, 10:27 AM

LGTM!

clang/lib/Parse/ParseStmt.cpp
1278–1279

Fantastic, thank you for confirming!

This revision is now accepted and ready to land.Jan 6 2020, 10:27 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2020, 2:26 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript