We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's assume the following code :
struct A { struct B { int c; } b; int a; }; void foo() { A a{0, 1}; }
The Fix-it for modernize-use-designated-initializers will generate the following code :
struct A { struct B { int c; } b; int a; }; void foo() { A a{.b.c=0, .a=1}; }
For which the compiler will emit this warning: warning nested designators are a C99 extension [-Wc99-designator]
warning nested designators are a C99 extension [-Wc99-designator]
The correct fix would be : A a{.b={.c=0}, .a=1};
A a{.b={.c=0}, .a=1};
godbolt: https://godbolt.org/z/Tjjrjz4e3
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Let's assume the following code :
The Fix-it for modernize-use-designated-initializers will generate the following code :
For which the compiler will emit this warning:
warning nested designators are a C99 extension [-Wc99-designator]
The correct fix would be :
A a{.b={.c=0}, .a=1};
godbolt: https://godbolt.org/z/Tjjrjz4e3
The text was updated successfully, but these errors were encountered: