From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11765 invoked by alias); 28 Apr 2013 00:37:41 -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 11734 invoked by uid 48); 28 Apr 2013 00:37:38 -0000 From: "lucdanton at free dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56958] Spurious set but not used variable warning in empty pack expansion Date: Sun, 28 Apr 2013 00:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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/msg02248.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56958 --- Comment #3 from lucdanton at free dot fr 2013-04-28 00:37:37 UTC --- I do make use of the variable in the pack; that the pack may be empty for some instantiations may or may not be something to look out for, but I don't think that it should be done by the unused variable warning. Perhaps I misunderstand the role of warning -- to me the 'used' in 'unused variable' means that it's conceptually used, not that it's e.g. ODR-used or any technical sense of the term. Should the following code warn? Who does that benefit? int spurious = 0 if(1) return 0; // never reached -- is spurious used or not? return spurious + 3; Since GCC doesn't warn for this I thought it shouldn't in the case of the pack expansion.