[PATCH] D138851: [Clang] Permit static constexpr variables in constexpr functions

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 12 09:43:05 PST 2023


shafik added inline comments.


================
Comment at: clang/test/SemaCXX/constant-expression-cxx2b.cpp:246
+
+constexpr double evaluate_static_constexpr() {
+  struct Constexpr{
----------------
Can we also add the test from the proposal as well for completeness sake:

```
constexpr char test() {
   static const int x = 5;
   static constexpr char c[] = "Hello World";
   return *(c+x);
}
static_assert(' ' == test());
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138851



More information about the cfe-commits mailing list