From: Jakub Jelinek Date: Tue, 20 Feb 2018 17:00:23 +0000 (+0100) Subject: re PR c++/84488 (Incorrect "set but not used" warning for static_cast(double)) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f210b3b3723c32bfdaafa149ca5697e83e0a9479;p=gcc.git re PR c++/84488 (Incorrect "set but not used" warning for static_cast(double)) PR c++/84488 * g++.dg/warn/Wunused-var-30.C: New test. From-SVN: r257850 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8eb50db7478..d6cedecf44a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-20 Jakub Jelinek + + PR c++/84488 + * g++.dg/warn/Wunused-var-30.C: New test. + 2018-02-20 Richard Sandiford PR tree-optimization/84419 diff --git a/gcc/testsuite/g++.dg/warn/Wunused-var-30.C b/gcc/testsuite/g++.dg/warn/Wunused-var-30.C new file mode 100644 index 00000000000..e95e120e656 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wunused-var-30.C @@ -0,0 +1,11 @@ +// PR c++/84488 +// { dg-do compile } +// { dg-options "-Wunused-but-set-variable" } + +int +foo () +{ + enum E { A, B, C, D }; + double r = 1.0; // { dg-bogus "set but not used" } + return static_cast(r); +}