public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60212] New: no warning for unused variables
@ 2014-02-15 12:46 ali.baharev at gmail dot com
0 siblings, 0 replies; only message in thread
From: ali.baharev at gmail dot com @ 2014-02-15 12:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60212
Bug ID: 60212
Summary: no warning for unused variables
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ali.baharev at gmail dot com
Created attachment 32144
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32144&action=edit
source file needed to reproduce the bug report
After reading the documentation, I would expect a warning that x is unused, and
both clang and msvc gives a warning too.
g++ -fwhole-program -O3 -std=c++11 -Wall -Wextra -Wunused warn.cpp
struct S { int array[1024]; };
int main() {
const S a{{0}};
S x(a);
}
In my opinion, it is NOT a duplicate of:
No unused warning for variables of non-trivial types
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55203
I see no reason for tagging S with attribute warn_unused; the compiler should
be able to verify unused S variables even without it.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-15 12:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 12:46 [Bug c++/60212] New: no warning for unused variables ali.baharev at gmail 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).