[llvm-dev] RFC: Constructing StringRefs at compile time
Malcolm Parsons via llvm-dev
llvm-dev at lists.llvm.org
Mon Jan 9 10:13:12 PST 2017
On 28 November 2016 at 20:51, Zachary Turner via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> If your StringRef is nested in part of another class, and you want an array
> of that class, it still works. For example:
>
> struct Foo {
> StringLiteral X;
> StringLiteral Y;
> int Z;
> };
>
> constexpr Foo Foos[] = { {"A", "B", 1}, {"C", "D", 2} };
gcc <= 5.4 report an error:
error: could not convert '(const char*)"A"' from 'const char*' to
'StringLiteral'
https://godbolt.org/g/ihxrwr
--
Malcolm Parsons
More information about the llvm-dev
mailing list