public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63875] New: Bogus unused-but-set-parameter warning when expanding a variadic template argument pack
@ 2014-11-14 17:04 tejohnson at google dot com
  2014-11-23 15:14 ` [Bug c++/63875] " paolo.carlini at oracle dot com
  2015-02-02 16:25 ` tejohnson at google dot com
  0 siblings, 2 replies; 3+ messages in thread
From: tejohnson at google dot com @ 2014-11-14 17:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63875

            Bug ID: 63875
           Summary: Bogus unused-but-set-parameter warning when expanding
                    a variadic template argument pack
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tejohnson at google dot com

The following test case warns about a variable that is set but unused. The
parameter is unused when the argument pack has nothing in it, but it is never
set.

% cat b.cc
template <class... Ts>
void Sink(Ts...) {}

struct S {
  int Get(int) { return 0; }
};

template <int... Is>
void F(S s) {
  Sink(s.Get(Is)...);
}

int main() {
  F<>({});
}

$ g++ -c -O b.cc -std=c++11 -Wall -Wunused-but-set-parameter
b.cc: In instantiation of 'void F(S) [with int ...Is = {}]':
b.cc:14:9:   required from here
b.cc:9:10: warning: parameter 's' set but not used [-Wunused-but-set-parameter]
 void F(S s) {


Google ref b/10709546.
          ^


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

* [Bug c++/63875] Bogus unused-but-set-parameter warning when expanding a variadic template argument pack
  2014-11-14 17:04 [Bug c++/63875] New: Bogus unused-but-set-parameter warning when expanding a variadic template argument pack tejohnson at google dot com
@ 2014-11-23 15:14 ` paolo.carlini at oracle dot com
  2015-02-02 16:25 ` tejohnson at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-23 15:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63875

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|tejohnson at google dot com        |jakub at gcc dot gnu.org

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Let's add Jakub.


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

* [Bug c++/63875] Bogus unused-but-set-parameter warning when expanding a variadic template argument pack
  2014-11-14 17:04 [Bug c++/63875] New: Bogus unused-but-set-parameter warning when expanding a variadic template argument pack tejohnson at google dot com
  2014-11-23 15:14 ` [Bug c++/63875] " paolo.carlini at oracle dot com
@ 2015-02-02 16:25 ` tejohnson at google dot com
  1 sibling, 0 replies; 3+ messages in thread
From: tejohnson at google dot com @ 2015-02-02 16:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63875

--- Comment #2 from Teresa Johnson <tejohnson at google dot com> ---
Ping. This is still an issue on trunk (as of today at r220345).


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

end of thread, other threads:[~2015-02-02 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 17:04 [Bug c++/63875] New: Bogus unused-but-set-parameter warning when expanding a variadic template argument pack tejohnson at google dot com
2014-11-23 15:14 ` [Bug c++/63875] " paolo.carlini at oracle dot com
2015-02-02 16:25 ` tejohnson at google 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).