-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
It seems that constexpr initalization is generated the wrong way.
var : std::array<char, 5> == "abcd";
is lowered to
std::array<char,5> constexpr var = "abcd";
which results into the error:
main.cpp2:8:34: error: no viable conversion from 'const char[5]' to 'const std::array<char, 5>'
The correct lowering in this case would be:
std::array<char, 5> constexpr var {"abcd"};
this version, without the constexpr, is used for var : std::array<char, 5> = "abcd";.
Reproducer:
https://cpp2.godbolt.org/z/KbPvxPdoq
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working