[PATCH] D144285: [Clang] Implement CWG2518 - static_assert(false)

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 12:02:55 PST 2023


cor3ntin added inline comments.


================
Comment at: clang/test/CXX/drs/dr25xx.cpp:5-14
+#error one
+// expected-error at -1 {{one}}
+#if 0
+#error skip
+#warning skip // expected-error {{skip}}
+#endif
+#error two
----------------
aaron.ballman wrote:
> What do these tests have to do with this DR?
This dr is wild https://wiki.edg.com/pub/Wg21issaquah2023/StrawPolls/p2796r0.html
CWG merged the static_assert PR in the DR asserting that error should produce a diagnostics - note that there will probably be some follow ups
https://lists.isocpp.org/core/2023/02/13915.php

Here I'm testing a warning is emitted even if the build was already failed.


================
Comment at: clang/test/CXX/drs/dr25xx.cpp:9
+#error skip
+#warning skip // expected-error {{skip}}
+#endif
----------------
aaron.ballman wrote:
> Why do we expect an error on this line in a `#if 0` block??
Oups, we don't 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144285



More information about the cfe-commits mailing list