[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-06-01 Thread Richard via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb418ef5cb90b: [clang-tidy] Reject invalid enum initializers in C files (authored by LegalizeAdulthood). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-06-01 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood updated this revision to Diff 433648. LegalizeAdulthood added a comment. Update from review comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125622/new/ https://reviews.llvm.org/D125622 Files: clang-tools-extra/clang-tidy/modernize/IntegralLiteralExpressionMat

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-06-01 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood marked 2 inline comments as done. LegalizeAdulthood added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-macro-to-enum.c:3-7 +// C requires enum values to fit into an int. +#define TOO_BIG1 1L +#define TOO_BIG2 1UL +#define TO

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM with a few comments that can be addressed when you commit. Comment at: clang-tools-extra/clang-tidy/modernize/IntegralLiteralExpressionMatcher.cpp:87-89 +

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-27 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood updated this revision to Diff 432676. LegalizeAdulthood added a comment. - Add C++ test case for acceptable `operator,` initializer CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125622/new/ https://reviews.llvm.org/D125622 Files: clang-tools-extra/clang-tidy/moderni

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-27 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood marked 5 inline comments as done. LegalizeAdulthood added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp:324 { - IntegralLiteralExpressionMatcher Matcher(MacroTokens); - return Matcher.match(); + IntegralLiteralExpre

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-27 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood updated this revision to Diff 432675. LegalizeAdulthood marked an inline comment as done. LegalizeAdulthood added a comment. - Update from review comments - Disallow operator, unless inside parentheses CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125622/new/ https://r

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-24 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-macro-to-enum.c:10 +// C forbids comma operator in initializing expressions. +#define BAD_OP 1, 2 + LegalizeAdulthood wrote: > aaron.ballman wrote: > > Can you

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-16 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood marked 2 inline comments as done. LegalizeAdulthood added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-macro-to-enum.c:9 + +// C forbids comma operator in initializing expressions. +#define BAD_OP 1, 2 aaron

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-macro-to-enum.c:9 + +// C forbids comma operator in initializing expressions. +#define BAD_OP 1, 2 LegalizeAdulthood wrote: > aaron.ballman wrote: > > It's also

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-16 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-macro-to-enum.c:9 + +// C forbids comma operator in initializing expressions. +#define BAD_OP 1, 2 aaron.ballman wrote: > It's also forbidden in C++. C++ ju

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Note, I'm in C standards committee meetings all week this week, so I expect I won't be doing many reviews this week and I'll be catching up as best I can starting next week. Comment at: clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp

[PATCH] D125622: [clang-tidy] Reject invalid enum initializers in C files

2022-05-14 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood created this revision. LegalizeAdulthood added reviewers: aaron.ballman, njames93. LegalizeAdulthood added a project: clang-tools-extra. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a project: All. LegalizeAdulthood requested review of this revision. C require