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: unassig...@gcc.gnu.org

        ReportedBy: lucdan...@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 via email to