[PATCH] D146376: Update static_assert message for redundant cases

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 02:57:27 PDT 2023


tbaeder added a comment.

Remember to upload you patches with context.



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16732
+    // Ignore BO_LOr operators at the toplevel.
+    if (Op->getOpcode() == BO_LOr)
+      return;
----------------
You can just drop the comment and move this into the `if` statement above, e..g  `if (...; BO && BO->getOpcode() != BO_Lor)`.


================
Comment at: clang/test/SemaCXX/static-assert.cpp:262
+
+  /// Bools are printed with disjunction.
+  static_assert(invert(true) || invert(true), ""); // expected-error {{failed}} \
----------------
That comment doesn't make a lot of sense?


================
Comment at: clang/test/SemaCXX/static-assert.cpp:263
+  /// Bools are printed with disjunction.
+  static_assert(invert(true) || invert(true), ""); // expected-error {{failed}} \
+
----------------
Remove the backslash


================
Comment at: clang/test/SemaCXX/static-assert.cpp:269
 
+  /// Bools are printed with conjunction.
+  static_assert(true && false, ""); // expected-error {{failed}} \
----------------
Neither this one.


================
Comment at: clang/test/SemaCXX/static-assert.cpp:270
+  /// Bools are printed with conjunction.
+  static_assert(true && false, ""); // expected-error {{failed}} \
+
----------------
Remove the backslash


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146376/new/

https://reviews.llvm.org/D146376



More information about the cfe-commits mailing list