[PATCH] D124038: [clang] Prevent folding of non-const compound expr

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 02:15:07 PDT 2022


serge-sans-paille added inline comments.


================
Comment at: clang/test/SemaCXX/constant-expression-cxx11.cpp:1609
   struct X { int a[2]; };
   constexpr int *n = (X){1, 2}.a; // expected-warning {{C99}} expected-warning {{temporary}}
   // expected-error at -1 {{constant expression}}
----------------
@efriedma this is the test you asked for. it's already implemented, and my patch doesn't change its behavior, which matches the GCC behavior.


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

https://reviews.llvm.org/D124038



More information about the cfe-commits mailing list