Bug 17553

Summary: ICE on valid C++ virtual template static member in anonymous namespace
Product: Sisyphus Reporter: Ivan A. Melnikov <iv>
Component: gcc4.1-c++Assignee: Dmitry V. Levin <ldv>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: major    
Priority: P2 CC: glebfm
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
Preprocessed source, как просили none

Description Ivan A. Melnikov 2008-10-13 18:48:19 MSD
Created attachment 2994 [details]
Preprocessed source, как просили

Следующая ошибка воспроизводится на gcc4.1-c++-4.1.2-alt3:

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

Это, в частности, мешает компиляции м приложений, использующих Boost.TypeTraits.

Пример некорректной работы:

$ cat test.cpp
namespace
{

template <typename T>
class A
{
  virtual T f1() { return c; }
  static const T c = 0;
};

A<int> v;

}

$ g++ test.cpp 
test.cpp: In instantiation of ‘const int <unnamed>::A<int>::c’:
test.cpp:7:   instantiated from ‘T<unnamed>::A<T>::f1() [with T = int]’
test.cpp:11:   instantiated from here
test.cpp:8: internal compiler error: in make_rtl_for_nonlocal_decl, at cp/decl.c:4970
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.altlinux.org/> for instructions.
Preprocessed source stored into /home/iv/tmp/ccUa5lIO.out file, please attach this to your bugreport.
Comment 1 Dmitry V. Levin 2008-10-18 16:49:00 MSD
Fixed upstream, available in gcc4.3-c++-4.3.2-alt1