public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "simon_baldwin at yahoo dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/34094] New: Undefined static data member can acquire a definition anyway Date: Wed, 14 Nov 2007 18:43:00 -0000 [thread overview] Message-ID: <bug-34094-11271@http.gcc.gnu.org/bugzilla/> (raw) The following program should fail to link, since <anonymous>::B::x is declared but not defined. However, the program compiles, links, and runs with gcc 4.2.1 and with a relatively recent 4.3 snapshot. This same program fails to build under gcc 4.1 and earlier, icc 8.1, and Comeau test drive. struct A { A(void *) {} }; namespace { struct B : public A { B() : A(&x) {} static int x; // declared, but never defined }; } int main() { B::x = 0; } -- Summary: Undefined static data member can acquire a definition anyway Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: simon_baldwin at yahoo dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34094
next reply other threads:[~2007-11-14 18:43 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-11-14 18:43 simon_baldwin at yahoo dot com [this message] 2007-11-14 19:21 ` [Bug c++/34094] Undefined static data member in anonymous namespace " pinskia at gcc dot gnu dot org 2007-11-15 4:40 ` bangerth at dealii dot org 2007-11-15 19:56 ` simon_baldwin at yahoo dot com 2007-11-19 5:22 ` [Bug c++/34094] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org 2007-11-20 18:01 ` jakub at gcc dot gnu dot org 2007-11-22 14:06 ` jakub at gcc dot gnu dot org 2007-11-22 14:07 ` [Bug c++/34094] [4.2 " jakub at gcc dot gnu dot org 2007-11-25 20:46 ` pinskia at gcc dot gnu dot org 2007-12-11 8:42 ` jakub at gcc dot gnu dot org 2007-12-11 8:48 ` jakub at gcc dot gnu dot org 2007-12-11 8:49 ` [Bug c++/34094] [4.2/4.3 " jakub at gcc dot gnu dot org 2007-12-12 20:57 ` mmitchel at gcc dot gnu dot org 2007-12-18 23:47 ` crowl at google dot com 2007-12-18 23:52 ` pinskia at gcc dot gnu dot org 2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org 2008-02-10 16:34 ` jason at gcc dot gnu dot org 2008-02-10 18:13 ` jason at gcc dot gnu dot org 2008-02-12 6:39 ` jason at gcc dot gnu dot org 2008-02-12 6:42 ` jason at gcc dot gnu dot org 2008-02-22 17:51 ` pinskia at gcc dot gnu dot org 2008-02-22 18:04 ` jason 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-34094-11271@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).