Commit f210b3b3 by Jakub Jelinek Committed by Jakub Jelinek

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
parent ecb0dd18
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
......
// 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment