[PATCH] D154290: [Clang] Implement P2741R3 - user-generated static_assert messages

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 11 18:34:53 PDT 2023


shafik added inline comments.


================
Comment at: clang/test/SemaCXX/static-assert-cxx26.cpp:167
+static_assert(false, MessageInvalidSize{});  // expected-error {{static assertion failed}} \
+                                             // expected-error {{the message in a static_assert declaration must be a string literal or an object with data() and size() member functions}}
+static_assert(false, MessageInvalidData{});  // expected-error {{static assertion failed}} \
----------------
I feel like this diagnostic could be more detailed. Looking at the implementation you could at least point out which one is invalid if not both and you could probably add more details on top of that but I think at least pointing out which is invalid would be helpful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154290



More information about the cfe-commits mailing list