From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22921 invoked by alias); 14 Apr 2013 19:59:54 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22901 invoked by uid 48); 14 Apr 2013 19:59:51 -0000 From: "lucdanton at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56958] New: Spurious unused variable warning in empty pack expansion Date: Sun, 14 Apr 2013 19:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lucdanton at free dot fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg01411.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56958 Bug #: 56958 Summary: Spurious unused variable warning in empty pack expansion Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: lucdanton@free.fr Created attachment 29872 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29872 Minimal testcase Using: g++-snapshot (Debian 20130330-1) 4.9.0 20130330 (experimental) [trunk revision 197260] $ cat main.cpp template int foo(T... t) { int spurious = 0; return false ? foo(t + spurious...) : 0; } int main() { return foo(); } $ g++-snapshot -Wall -std=c++11 main.cpp main.cpp: In instantiation of 'int foo(T ...) [with T = {}]': main.cpp:10:16: required from here main.cpp:4:9: warning: variable 'spurious' set but not used [-Wunused-but-set-variable] int spurious = 0; ^ No such warning is produced when passing arguments to foo.