This small program cannot be compiled. It failes with an "undefined reference to `A::N'" error. Replacing the main function line with: std::cout << "Number: " << std::min(1, (int)A::N) << "\n"; results in a successful compilation.
This is the small program to reproduce the bug: #include <iostream> #include <algorithm> struct A { static const int N = 2; }; int main () { std::cout << "Number: " << std::min(1, A::N) << "\n"; } -- Summary: Static const member data not found when used in a template Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Bernd dot Donner at gmx dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36261