Description of problem: Internal compiler error while compiling libdecnumber (decimal floating point library). Version-Release number of selected component (if applicable): gcc-c++-4.5.1-4 and 4.6.x on F14 How to reproduce: Test-case: //Begin t.C #include <iostream> namespace std { namespace decimal { template <class _Fmt> struct _FmtTraits; class decimal32; template <class _T> struct _Is_decimal_fp_aux { static const bool value = false; }; template <> struct _Is_decimal_fp_aux<decimal32> { static const bool value = true; }; template <class _Tr> class _DecBase { }; class decimal32 : public _DecBase<_FmtTraits<decimal32> > { }; } } //end t.C Steps to Reproduce: 1. g++ -c t.C Actual results: t.C:8:83: internal compiler error: Segmentation fault Please submit a full bug report,with preprocessed source if appropriate. See <http://bugzilla.redhat.com/bugzilla> for instructions. Expected results: Clean compile. Additional info: If I remove <iostream> it compiles. If I remove the nested namespace decimal it compiles.
This is invalid testcase, std::decimal::decimal{32,64,128} must have a field (the corresponding typedef float __decfloat32 __attribute__((mode(SD))); (or DD or TD). If this is the latest libdecnumber, then it needs to be fixed. That said, gcc shouldn't ICE on invalid sources, so I've filed an upstream bug.
(In reply to comment #1) > This is invalid testcase, std::decimal::decimal{32,64,128} must have a field > (the corresponding typedef float __decfloat32 __attribute__((mode(SD))); (or DD > or TD). > If this is the latest libdecnumber, then it needs to be fixed. > > That said, gcc shouldn't ICE on invalid sources, so I've filed an upstream bug. I believe that is backwards. The testcase is valid and the compiler should be fixed. Your argument is that the name std::decimal::decimal32 is reserved by the implementation and only the may provide the definition of std::decimal::decimal32. std::string is not reserved by the implementation and one is certainly free to use stlports std::string if they choose. The "typedef float __decfloat32 __attribute__((mode(SD)));" inside of the class std::decimal::decimal32 is an implementation detail specific to the implementatio n of decimal32 that is provided by g++ but is certainly not a requirement for an alternative decimal32 implementation.
That view conflicts with the C++ ABI requirement: http://www.codesourcery.com/archives/cxx-abi-dev/msg02174.html