public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "fanael4 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61465] New: Bogus parameter set but not used warning in constructor initialization list Date: Tue, 10 Jun 2014 18:16:00 -0000 [thread overview] Message-ID: <bug-61465-4@http.gcc.gnu.org/bugzilla/> (raw) 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.
next reply other threads:[~2014-06-10 18:16 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-06-10 18:16 fanael4 at gmail dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-61465-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).