[Bug c++/110822] New: ICE on constexpr initialized with non-constant expression also accepts-invalid
stevenxia990430 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 26 19:27:38 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110822
Bug ID: 110822
Summary: ICE on constexpr initialized with non-constant
expression also accepts-invalid
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: stevenxia990430 at gmail dot com
Target Milestone: ---
The following invalid program reports an internal compiler error: verify_gimple
failed on gcc-trunk with -O1, -O2 or -O3 optimization
To quickly reproduce: https://gcc.godbolt.org/z/s5aP44sKb
```
#include <iostream>
using namespace std::string_literals;
constexpr std::string text = "Some text here"s;
int main()
{
std::cout << "The text is: " << text << '\n';
}
```
Note that compiling without optimization is successful, but is rejected on
clang-trunk
See this link: https://gcc.godbolt.org/z/G8vYhbe9E
More information about the Gcc-bugs
mailing list