[Bug c++/44548] Link error when defining templated static const variable

2010-06-16 Thread dpovey at gmail dot com
--- Comment #7 from dpovey at gmail dot com 2010-06-16 17:57 --- The key thing here is that the value was initialized inside the class. So there is no way to syntactically disambiguate a definition and a declaration of the value outside the class (because normally C++ uses the initial

[Bug c++/44548] Link error when defining templated static const variable

2010-06-16 Thread redi at gcc dot gnu dot org
--- Comment #6 from redi at gcc dot gnu dot org 2010-06-16 12:31 --- (In reply to comment #3) > > but it is an explicit specialization of the *definition* of the variable > > No it is a specialization of the declaration. It is a declaration of a specialization :) > There are only spec

[Bug c++/44548] Link error when defining templated static const variable

2010-06-16 Thread redi at gcc dot gnu dot org
--- Comment #5 from redi at gcc dot gnu dot org 2010-06-16 12:11 --- (In reply to comment #4) > So what the above code actually means? Is it valid? Yes, it's valid. It declares an explicit specialization, which inhibits the implicit instantiation of the default specialization. In orde

[Bug c++/44548] Link error when defining templated static const variable

2010-06-16 Thread manu at gcc dot gnu dot org
--- Comment #4 from manu at gcc dot gnu dot org 2010-06-16 11:58 --- (In reply to comment #3) > > but it is an explicit specialization of the *definition* of the variable > > No it is a specialization of the declaration. There are only specialization > of > declarations; never definit

[Bug c++/44548] Link error when defining templated static const variable

2010-06-15 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2010-06-15 22:24 --- > but it is an explicit specialization of the *definition* of the variable No it is a specialization of the declaration. There are only specialization of declarations; never definitions. Re-read the link you gave

[Bug c++/44548] Link error when defining templated static const variable

2010-06-15 Thread dpovey at gmail dot com
--- Comment #2 from dpovey at gmail dot com 2010-06-15 22:19 --- I don't agree with you that this is not a bug, although I do agree that I could have coded it differently. Look at http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref

[Bug c++/44548] Link error when defining templated static const variable

2010-06-15 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2010-06-15 19:00 --- No you just specialized the declaration. You want: template const T MyTraits::kValue; // define it. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added -