re PR c++/84488 (Incorrect "set but not used" warning for static_cast<Enum>(double))

PR c++/84488
	* g++.dg/warn/Wunused-var-30.C: New test.

From-SVN: r257850
This commit is contained in:
Jakub Jelinek 2018-02-20 18:00:23 +01:00 committed by Jakub Jelinek
parent ecb0dd1890
commit f210b3b372
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2018-02-20 Jakub Jelinek <jakub@redhat.com>
PR c++/84488
* g++.dg/warn/Wunused-var-30.C: New test.
2018-02-20 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/84419

View File

@ -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<E>(r);
}