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:
parent
ecb0dd1890
commit
f210b3b372
@ -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
|
||||
|
11
gcc/testsuite/g++.dg/warn/Wunused-var-30.C
Normal file
11
gcc/testsuite/g++.dg/warn/Wunused-var-30.C
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user