This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/34094] [4.2/4.3 Regression] Undefined static data member in anonymous namespace can acquire a definition anyway



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]