https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61754
Ed Smith-Rowland <3dw4rd at verizon dot net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |3dw4rd at verizon dot net --- Comment #2 from Ed Smith-Rowland <3dw4rd at verizon dot net> --- On the ## line is the use of the deprecated *type* that is causing the error. ---------------------------------------- struct __attribute__((deprecated)) Old1 {}; Old1 old1 __attribute__((deprecated)); struct [[deprecated("deprecated type Old2")]] Old2 {}; Old2 old2 [[deprecated("deprecated global old2")]]; // ## int main() { //old1; //Old1 newold1 [[gnu::unused]]; //old2; //Old2 newold2 [[gnu::unused]]; } ---------------------------------------- Gives: /home/ed/bin/bin/g++ -std=c++14 -Wall -Wextra -pedantic -o test_pr61754 test_pr61754.cpp test_pr61754.cpp:7:50: warning: ‘Old2’ is deprecated (declared at test_pr61754.cpp:5): deprecated type Old2 [-Wdeprecated-declarations] Old2 old2 [[deprecated("deprecated global old2")]]; // ## ^ The [[deprecated]] is parsed and immediately calls the [[gnu::deprecated]] code. Which in turn should do __attribute__((deprecated)). This might (should) be easy to isolate.