This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34094] [4.2 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Nov 2007 20:46:02 -0000
- Subject: [Bug c++/34094] [4.2 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
- References: <bug-34094-11271@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from pinskia at gcc dot gnu dot org 2007-11-25 20:46 -------
Here is a testcase which shows this is not a complete fix, it does not fix the
case where the static const was initialized inside the class.
namespace {
struct c
{
static const bool t = 0;
};
}
const bool &f()
{
return c::t;
}
int main(void)
{
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34094