[llvm-bugs] [Bug 49709] New: clang parser crash for instantiating char array
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Mar 24 04:03:47 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=49709
Bug ID: 49709
Summary: clang parser crash for instantiating char array
Product: clang
Version: 11.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: janezz55 at gmail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Created attachment 24688
--> https://bugs.llvm.org/attachment.cgi?id=24688&action=edit
.cpp file demonstrating bug
This will cause a crash in clang-11.1.0, but not in gcc-10.2.0:
constexpr auto a(auto&& s) noexcept
{
return s[0];
}
template <char ...c>
constexpr auto operator "" _lol() noexcept
{
return a((char[]){c...});
}
int main()
{
return "123"_lol;
}
Compile with:
clang++ -std=c++20 t.cpp -o t
--
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/20210324/46f6e120/attachment-0001.html>
More information about the llvm-bugs
mailing list