public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61465] New: Bogus parameter set but not used warning in constructor initialization list
@ 2014-06-10 18:16 fanael4 at gmail dot com
  2014-09-18  9:55 ` [Bug c++/61465] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fanael4 at gmail dot com @ 2014-06-10 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61465
           Summary: Bogus parameter set but not used warning in
                    constructor initialization list
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fanael4 at gmail dot com

When compiling the following code with C++11 and -Wunused-but-set-parameter on

struct Foo {
  Foo(void* x) : y{static_cast<char*>(x)} {}
  char* y;
};

GCC (tested on 4.7.0 and 4.9.1) incorrectly complains:

x.cpp:2:13: warning: parameter 'x' set but not used
[-Wunused-but-set-parameter]

Which is clear nonsense, as the parameter is used. If the initialization list
is changed to use parentheses, or the static_cast is removed and y's type is
changed, the warning goes away.


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

end of thread, other threads:[~2014-09-22 18:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-10 18:16 [Bug c++/61465] New: Bogus parameter set but not used warning in constructor initialization list fanael4 at gmail dot com
2014-09-18  9:55 ` [Bug c++/61465] " paolo.carlini at oracle dot com
2014-09-18 10:12 ` jakub at gcc dot gnu.org
2014-09-18 10:19 ` jakub at gcc dot gnu.org
2014-09-18 18:05 ` jason at gcc dot gnu.org
2014-09-20  0:55 ` jason at gcc dot gnu.org
2014-09-22 18:47 ` jason 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).