public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lucdanton at free dot fr" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-56958-4@http.gcc.gnu.org/bugzilla/> (raw)


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<typename... T>
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.


             reply	other threads:[~2013-04-14 19:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-14 19:59 lucdanton at free dot fr [this message]
2013-04-26 13:57 ` [Bug c++/56958] Spurious set but not " paolo.carlini at oracle dot com
2013-04-26 14:23 ` [Bug c++/56958] Spurious set but not used " jakub at gcc dot gnu.org
2013-04-26 14:30 ` paolo.carlini at oracle dot com
2013-04-28  0:37 ` lucdanton at free dot fr
2015-08-27 21:14 ` ldionne.2 at gmail dot com
2022-02-01 16:33 ` foom at fuhm dot net
2022-11-04 17:23 ` serpent7776 at gmail dot com

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=bug-56958-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).