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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The linker is correct to signal an error here, because the explicit
specialization

template<> 
CGEnum<int, Test_Enum>::instances_list 
CGEnum<int, Test_Enum>::msInstances;

is considered a non-defining declaration as of 14.7.3 p13:

"An explicit specialization of a static data member of a template or an
explicit specialization of a static data member template is a definition if the
declaration includes an initializer; otherwise, it is a declaration."

The necessary fix is to provide the initializer, because the corresponding
entity is odr-used in the program:

template<> 
CGEnum<int, Test_Enum>::instances_list 
CGEnum<int, Test_Enum>::msInstances{};

Reply via email to