public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
@ 2011-06-01  8:24 gintensubaru at gmail dot com
  2011-06-15 17:31 ` [Bug c++/49251] " jason at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gintensubaru at gmail dot com @ 2011-06-01  8:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

           Summary: [C++0x][parameter pack expanding] unused parameter
                    warning with unpacking empty tuples
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gintensubaru@gmail.com


#include <tuple>

template< std::size_t... Indices >
struct indices {};

template< class... Args >
void sink( Args&&... ) {}

template< class Tuple, std::size_t... Indices >
void unpack_test( Tuple && t, indices<Indices...> ) {
  sink( std::get<Indices>(t)... );
}

int main() {
  unpack_test( std::tuple<>(), indices<>() );
}


------------------------


This code, which is unpacking tuples, raises unused parameter warning:

$ g++ -std=c++0x -Wunused-parameter bug.cc

bug.cc: In instantiation of 'void unpack_test(Tuple&&, indices<Indices ...>)
[with Tuple = std::tuple<>, unsigned int ...Indices = {}]':
bug.cc:15:44:   instantiated from here
bug.cc:10:6: warning: unused parameter 't' [-Wunused-parameter]


I've confirmed this behavior on following versions:

4.5.0
4.5.3
4.6.0
4.6-20110527
4.7-20110528


It can be avoided by using the parameter explicitly, like `(void)t;',
but it's not always used.
( For example, it cannot be used for constexpr functions. )


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

* [Bug c++/49251] [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
  2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
@ 2011-06-15 17:31 ` jason at gcc dot gnu.org
  2011-06-15 18:07 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-15 17:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.06.15 17:31:05
                 CC|                            |jason at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1


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

* [Bug c++/49251] [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
  2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
  2011-06-15 17:31 ` [Bug c++/49251] " jason at gcc dot gnu.org
@ 2011-06-15 18:07 ` jason at gcc dot gnu.org
  2011-06-16 22:14 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-15 18:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lene13 at gmail dot com

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-15 18:06:43 UTC ---
*** Bug 49339 has been marked as a duplicate of this bug. ***


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

* [Bug c++/49251] [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
  2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
  2011-06-15 17:31 ` [Bug c++/49251] " jason at gcc dot gnu.org
  2011-06-15 18:07 ` jason at gcc dot gnu.org
@ 2011-06-16 22:14 ` jason at gcc dot gnu.org
  2011-06-17  1:08 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-16 22:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-16 22:09:00 UTC ---
Author: jason
Date: Thu Jun 16 22:08:57 2011
New Revision: 175119

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175119
Log:
    PR c++/49251
    * semantics.c (finish_id_expression): Mark even dependent
    variables as used.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic113.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/49251] [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
  2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
                   ` (2 preceding siblings ...)
  2011-06-16 22:14 ` jason at gcc dot gnu.org
@ 2011-06-17  1:08 ` jason at gcc dot gnu.org
  2011-06-17  1:11 ` jason at gcc dot gnu.org
  2011-08-29 12:52 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-17  1:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-17 01:06:46 UTC ---
Author: jason
Date: Fri Jun 17 01:06:42 2011
New Revision: 175130

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175130
Log:
    PR c++/49251
    * semantics.c (finish_id_expression): Mark even dependent
    variables as used.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/variadic113.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/semantics.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/49251] [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
  2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
                   ` (3 preceding siblings ...)
  2011-06-17  1:08 ` jason at gcc dot gnu.org
@ 2011-06-17  1:11 ` jason at gcc dot gnu.org
  2011-08-29 12:52 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-17  1:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.1

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-17 01:10:56 UTC ---
Fixed for 4.6.1.


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

* [Bug c++/49251] [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples
  2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
                   ` (4 preceding siblings ...)
  2011-06-17  1:11 ` jason at gcc dot gnu.org
@ 2011-08-29 12:52 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2011-08-29 12:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49251

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-29 12:39:36 UTC ---
*** Bug 50224 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2011-08-29 12:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01  8:24 [Bug c++/49251] New: [C++0x][parameter pack expanding] unused parameter warning with unpacking empty tuples gintensubaru at gmail dot com
2011-06-15 17:31 ` [Bug c++/49251] " jason at gcc dot gnu.org
2011-06-15 18:07 ` jason at gcc dot gnu.org
2011-06-16 22:14 ` jason at gcc dot gnu.org
2011-06-17  1:08 ` jason at gcc dot gnu.org
2011-06-17  1:11 ` jason at gcc dot gnu.org
2011-08-29 12:52 ` redi at gcc dot gnu.org

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