For the following program:
int main()
{
new char[4] {"text"}; // #1
new char[5] {"text"}; // #2
new char[] {"text"}; // #3
}
clang gives an error for #1 which says:
error: initializer-string for char array is too long
and accepts #2 and #3.
gcc gives the following error for all statements:
error: invalid conversion from 'const char*' to 'char' [-fpermissive]
and in addition for #3 it gives the error:
error: expected primary-expression before ']' token
So what does the language say about whether this code is well-formed?
I want to know the current rules, but I'd also be interested to know if this has this changed in previous versions of the language.