Zero sized array warning for array of length 1

Viewed 263

I have this code:

template<char... c>
struct StaticStringConst
{
    const char cstr[] = {c...,0};
};

Compiling under g++ 5.1.0 I get the following error:

warning: ISO C++ forbids zero-size array 'cstr' [-Wpedantic]

It seems to me that my array is actually never zero...so what is going on here?

0 Answers
Related