This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway
- From: "crowl at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2007 23:46:49 -0000
- Subject: [Bug c++/34094] [4.2/4.3 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 #12 from crowl at google dot com 2007-12-18 23:46 -------
I think the last fix is incomplete:
namespace {
struct simple { static const int size = 4; };
template< typename T >
struct generic { static const int size = 4; };
}
struct instantiate {
simple simple_var;
generic< int > generic_var;
};
member.cc:4: error: static data member '<unnamed>::generic<int>::size' used,
but not defined
Note that the simple class is correct, but the template instance is not.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34094