public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Add testcase for PR c++/84488
@ 2018-02-20 21:49 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2018-02-20 21:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

Hi!

This testcase got fixed in r257155 aka PR83942, but unlike
the PR83942 testcase which regressed during 8.x stage1 this one used
to fail before too, so I think it is worth adding another testcase for it.

Tested on x86_64-linux, committed to trunk as obvious.

2018-02-20  Jakub Jelinek  <jakub@redhat.com>

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

--- gcc/testsuite/g++.dg/warn/Wunused-var-30.C.jj	2018-02-20 17:53:26.539480455 +0100
+++ gcc/testsuite/g++.dg/warn/Wunused-var-30.C	2018-02-20 17:53:18.419481675 +0100
@@ -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);
+}

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-20 21:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 21:49 [committed] Add testcase for PR c++/84488 Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).