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
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
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
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
+
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
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
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
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
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
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
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
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
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
13 matches
Mail list logo