public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "lcwu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/44128] New: C++ frontend not warn on type shadowing with -Wshadow Date: Thu, 13 May 2010 23:03:00 -0000 [thread overview] Message-ID: <bug-44128-16309@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1145 bytes --] This bug is a follow-up to bug c++/44122. Given the following program: $ cat t.c typedef long Py_ssize_t; void bar() { typedef int Py_ssize_t; Py_ssize_t pos; } When compiled with the C compiler with -Wshadow flag, a shadow warning is emitted. $ gcc -c t.c -Wshadow t.c: In function bar: t.c:5:14: warning: declaration of Py_ssize_t shadows a global declaration [-Wshadow] t.c:1:14: warning: shadowed declaration is here [-Wshadow] However, when using the C++ compiler with the same flag, no warning is emitted. $ g++ -c t.c -Wshadow I think C++ frontend should warn on this case as the C frontend. -- Summary: C++ frontend not warn on type shadowing with -Wshadow Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lcwu at gcc dot gnu dot org GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44128
next reply other threads:[~2010-05-13 23:03 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-05-13 23:03 lcwu at gcc dot gnu dot org [this message] 2010-07-24 21:29 ` [Bug c++/44128] " pinskia at gcc dot gnu dot 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-44128-16309@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).