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++/44577] static local variables in class template methods are not optimized-away if not used



------- Comment #4 from redi at gcc dot gnu dot org  2010-06-18 13:25 -------
If class_template<int>::class_template is instantiated in another translation
unit then it needs to refer to the same 's' ... but since the constructor calls
a static function, an instantiation in another TU would violate the ODR, which
would be undefined (no diagnostic required) so by that argument the compiler
could assume no other instantiations and therefore no valid way for another TU
to refer to 's'


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44577


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