public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11948] New: ICE on illegal code: initialising a static data member
@ 2003-08-16 14:48 o dot kullmann at swansea dot ac dot uk
  2003-08-16 14:57 ` [Bug c++/11948] [3.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: o dot kullmann at swansea dot ac dot uk @ 2003-08-16 14:48 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ICE on illegal code: initialising a static data member
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: o dot kullmann at swansea dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org

#include <limits> 
  template <class T> struct X { 
    static const int max = std::numeric_limits<int>::max(); 
    X() : m(max) {} 
    int m; 
  }; 
  template <class T> const int X<T>::max; 
int main() { X<int> x; } 
 
compiled with g++ version 3.3.1 (without options) yields 
internal compiler error: Segmentation fault 
 
This error doesn't occur with version 3.3 or 3.2.1, since these versions 
do not detect the invalid non-constant initialisation within the class. 
 
The code 
 
#include <limits> 
  template <class T> struct X { 
    static const int max = std::numeric_limits<int>::max(); 
  }; 
  template <class T> const int X<T>::max; 
int main() { X<int> x; } 
 
compiles with g++ version 3.3.1 although it is invalid.


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

end of thread, other threads:[~2003-12-21 22:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-16 14:48 [Bug c++/11948] New: ICE on illegal code: initialising a static data member o dot kullmann at swansea dot ac dot uk
2003-08-16 14:57 ` [Bug c++/11948] [3.3 Regression] " pinskia at gcc dot gnu dot org
2003-08-16 14:58 ` pinskia at gcc dot gnu dot org
2003-08-23  3:05 ` pinskia at gcc dot gnu dot org
2003-10-16  9:28 ` mmitchel at gcc dot gnu dot org
2003-12-21 22:17 ` pinskia at gcc dot gnu dot org

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).