"nodiscard attribute cannot be applied to types" build failure(s)
clang 13.0.0
clang generates an error, g++ generates a simple warning.
int a [[]];
int & [[nodiscard]] b = a;
$ clang++ -std=c++11 -c foo.cpp
foo.cpp:2:9: error: 'nodiscard' attribute cannot be applied to types
int & [[nodiscard]] b = a;
^
1 error generated.
$ g++ -std=c++11 -c foo.cpp
foo.cpp:2:20: warning: attribute ignored [-Wattributes]
int & [[nodiscard]] b = a;
^
foo.cpp:2:20: note: an attribute that appertains to a type-specifier is ignored
This is impacting mostly Qt based packages.
Reported
upstream
No error detect for version 13.0.0
0 errors