From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96509 invoked by alias); 20 Feb 2018 21:49:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 96495 invoked by uid 89); 20 Feb 2018 21:49:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Feb 2018 21:49:43 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 325507C6A0 for ; Tue, 20 Feb 2018 21:49:30 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-85.brq.redhat.com [10.40.204.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2EB9AF004 for ; Tue, 20 Feb 2018 21:49:29 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w1KH20AS008395; Tue, 20 Feb 2018 18:02:01 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w1KH20gh007683; Tue, 20 Feb 2018 18:02:00 +0100 Date: Tue, 20 Feb 2018 21:49:00 -0000 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Cc: Jason Merrill Subject: [committed] Add testcase for PR c++/84488 Message-ID: <20180220170200.GG5867@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg01200.txt.bz2 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 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(r); +} Jakub