[llvm-bugs] [Bug 49517] New: initializer_list storage considered a temporary when accessed through NTTP

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 10 10:14:04 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49517

            Bug ID: 49517
           Summary: initializer_list storage considered a temporary when
                    accessed through NTTP
           Product: clang
           Version: trunk
          Hardware: PC
               URL: https://godbolt.org/z/aWGr3P
                OS: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: johelegp at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    johelegp at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210310/4e0f85c3/attachment.html>


More information about the llvm-bugs mailing list