public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56958] New: Spurious unused variable warning in empty pack expansion
@ 2013-04-14 19:59 lucdanton at free dot fr
  2013-04-26 13:57 ` [Bug c++/56958] Spurious set but not " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: lucdanton at free dot fr @ 2013-04-14 19:59 UTC (permalink / raw)
  To: gcc-bugs


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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-04 17:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-14 19:59 [Bug c++/56958] New: Spurious unused variable warning in empty pack expansion lucdanton at free dot fr
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

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).