public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: Jason Merrill <jason@redhat.com>
Subject: [committed] Add testcase for PR c++/84488
Date: Tue, 20 Feb 2018 21:49:00 -0000	[thread overview]
Message-ID: <20180220170200.GG5867@tucnak> (raw)

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

                 reply	other threads:[~2018-02-20 21:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180220170200.GG5867@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).