https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99524

            Bug ID: 99524
           Summary: initializer_list storage considered a temporary when
                    accessed through NTTP
           Product: gcc
           Version: 11.0
               URL: https://godbolt.org/z/aWGr3P
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
                CC: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/aWGr3P.
```C++
#include<initializer_list>
constexpr std::initializer_list<bool>il{true};
template<const bool*B>constexpr bool front=B[0];
static_assert(front<il.begin()>);
```
https://timsong-cpp.github.io/cppwp/n4861/dcl.init.list#5 explains its storage.
https://timsong-cpp.github.io/cppwp/n4861/dcl.init.list#6 explains its
lifetime.

Reply via email to