Consider this piece of code:
struct S {
float b;
int a;
};
int main() {
S s{{{}}};
return s.a;
}
Clang 6.0.0 compiles this code, but shows a warning:
<source> warning: too many braces around scalar initializer [-Wmany-braces-around-scalar-init]
GCC 8.2 doesn't compile this code and reports an error:
<source>: In function 'int main()': <source>:9:10: error: braces around scalar initializer for type 'float'
Which one is correct? What does the specification say about this?