[Bug c++/36261] Static const member data not found when used in a template

2008-05-18 Thread Bernd dot Donner at gmx dot net
--- Comment #6 from Bernd dot Donner at gmx dot net 2008-05-19 00:18 --- Sorry, this is my fault your comments are correct. -- Bernd dot Donner at gmx dot net changed: What|Removed |Added ---

[Bug c++/36261] Static const member data not found when used in a template

2008-05-18 Thread paolo dot carlini at oracle dot com
--- Comment #5 from paolo dot carlini at oracle dot com 2008-05-19 00:16 --- And you are certainly wrong that the Standard allows to omit the definition, in this case. This is 9.4.2/4 oc C++03, note the last sentence: If a static data member is of const integral or const enumeration ty

[Bug c++/36261] Static const member data not found when used in a template

2008-05-18 Thread paolo dot carlini at oracle dot com
--- Comment #4 from paolo dot carlini at oracle dot com 2008-05-19 00:10 --- *** This bug has been marked as a duplicate of 30745 *** -- paolo dot carlini at oracle dot com changed: What|Removed |Added ---

[Bug c++/36261] Static const member data not found when used in a template

2008-05-18 Thread Bernd dot Donner at gmx dot net
--- Comment #3 from Bernd dot Donner at gmx dot net 2008-05-19 00:00 --- (In reply to comment #2) > In other terms, just add, after the declaration of struct A: > > const int A::N; > According to the C++ standard "static const" member variables can be declarend _and_ defined immediat

[Bug c++/36261] Static const member data not found when used in a template

2008-05-18 Thread paolo dot carlini at oracle dot com
--- Comment #2 from paolo dot carlini at oracle dot com 2008-05-18 22:58 --- In other terms, just add, after the declaration of struct A: const int A::N; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36261

[Bug c++/36261] Static const member data not found when used in a template

2008-05-18 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-05-18 22:52 --- std::min(1, A::N) std::min takes a reference to a const type which means you need the defintion of A::N including the definition. -- pinskia at gcc dot gnu dot org changed: What|Removed