public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36261]  New: Static const member data not found when used in a template
@ 2008-05-18 22:21 Bernd dot Donner at gmx dot net
  2008-05-18 22:53 ` [Bug c++/36261] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bernd dot Donner at gmx dot net @ 2008-05-18 22:21 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-19  0:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-18 22:21 [Bug c++/36261] New: Static const member data not found when used in a template Bernd dot Donner at gmx dot net
2008-05-18 22:53 ` [Bug c++/36261] " pinskia at gcc dot gnu dot org
2008-05-18 22:59 ` paolo dot carlini at oracle dot com
2008-05-19  0:01 ` Bernd dot Donner at gmx dot net
2008-05-19  0:11 ` paolo dot carlini at oracle dot com
2008-05-19  0:17 ` paolo dot carlini at oracle dot com
2008-05-19  0:19 ` Bernd dot Donner at gmx dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).