I have just read and understood Is it possible to initialise an array in C++ 11 by using new operator, but it does not quite solve my problem.
This code gives me a c
This seems to be clang++ bug 15735. Declare a default constructor (making it accessible and not deleted) and the program compiles, even though the default constructor is not called:
#include
struct A
{
A() { std::cout << "huh?\n"; } // or without definition, linker won't complain
A(int first, int second) { std::cout << "works fine?\n"; }
};
int main()
{
new A[1] {{1, 2}};
}
Live example
g++4.9 also accepts the OP's program without modifications.