[PATCH] D155175: [Clang] Fix consteval propagation for aggregates and defaulted constructors

Corentin Jabot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 07:15:45 PDT 2023


cor3ntin marked 5 inline comments as done.
cor3ntin added inline comments.


================
Comment at: clang/test/SemaCXX/cxx2b-consteval-propagate.cpp:245-246
+void test() {
+    [[maybe_unused]] SS s; // expected-error {{call to immediate function 'DefaultedUse::SS::SS' is not a constant expression}} \
+                           //  expected-note {{in call to 'SS()'}}
+}
----------------
aaron.ballman wrote:
> I don't have a suggestion yet on how to improve this, but this diagnostic did catch me by surprise because nothing about the declaration of `SS s;` makes me think "this should be a valid constant expression", so the error felt misplaced.
I've improved, i hope that works for you!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155175



More information about the llvm-commits mailing list