[PATCH] D146376: Update static_assert message for redundant cases

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 30 04:48:51 PDT 2023


aaron.ballman added inline comments.


================
Comment at: clang/test/SemaCXX/static-assert.cpp:262
+
+  static_assert(invert(true) || invert(true), ""); // expected-error {{failed}}
+
----------------
+1 -- please spell out more of the diagnostic wording (I see you're following a pattern elsewhere in the file, but we should have enough diagnostic wording to know what the diagnostic is.)

It's hard for me to tell from this review because the patch was not uploaded with context (next time, please use `-U9999` when making the patch diff so that this context exists), but is there test coverage showing what happens when the operators are chained together? e.g.,
```
static_assert(inverted(true) || invert(true) || false, "");
static_assert((true && invert(true)) || false, "");
static_assert(true && inverted(false) && inverted(true), "");
```


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