The following code triggers an ICE in gcc 4.1.0 and 4.1.1 ======================================= struct MyClass { MyClass( const MyClass& ); MyClass& operator=( const MyClass& ); void volatile_member_func() volatile; static void static_func() {}; };
void MyClass::volatile_member_func() volatile { static_func(); } ======================================= this code compiles correctly under 3.3 compiler command line and output: % g++ ICE.cpp ICE.cpp: In member function void MyClass::volatile_member_func() volatile: ICE.cpp:12: internal compiler error: in cp_expr_size, at cp/cp-objcp-common.c:101 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. compiler version: % g++ -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/usr/local/gcc4.1.1 Thread model: posix gcc version 4.1.1 system info: % uname -a Linux aces04 2.6.16.21-0.15-smp #1 SMP Tue Jul 25 15:28:49 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux -- Summary: ICE in volatile member function when calling static member Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Ed dot Ralston at jhuapl dot edu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29168