Closed
Description
struct S
{
int i1;
int i2;
};
void f()
{
S s{0};
}
Running with -std=c++11
produces the following warning:
<source>:9:8: warning: use designated initializer list to initialize 'S' [modernize-use-designated-initializers]
9 | S s{0};
| ^~~
| .i1=
<source>:1:1: note: aggregate type is defined here
1 | struct S
| ^
https://godbolt.org/z/EzerEWsKh
Designated initializers are not available until C++20: https://en.cppreference.com/w/cpp/language/aggregate_initialization.