I do not understand why the following code compiles?
struct A{ A(int); }; struct B{ A a{1}; };
but this is not so:
struct A{ A(int); }; struct B{ A a(1); };
error: expected ',' or '...' before a numerical constant
Is there a reason the compiler does not take the second form? I know about the most annoying parsing, but I don't think this question is related.
EDIT: As Bo explains in the comments below, I was wrong. Question associated with annoying analysis.
I tried this on gcc-5.1.0 using -std = c ++ 11
source
share