https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60212
Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |NEW Last reconfirmed| |2017-08-23 CC| |egallager at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> --- Confirmed that clang warns while g++ doesn't. $ /usr/local/bin/g++ -fwhole-program -O3 -std=c++11 -Wall -Wextra -Wunused -pedantic -o 60212.exe 60212.cc $ /sw/opt/llvm-3.1/bin/clang++ -fwhole-program -O3 -std=c++11 -Wall -Wextra -Wunused -pedantic -o 60212c.exe 60212.cc clang-3: warning: argument unused during compilation: '-fwhole-program' 60212.cc:5:7: warning: unused variable 'x' [-Wunused-variable] S x(a); ^ 1 warning generated. $