diff options
Diffstat (limited to 'src/cppunit')
| -rw-r--r-- | src/cppunit/TypeInfoHelper.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cppunit/TypeInfoHelper.cpp b/src/cppunit/TypeInfoHelper.cpp index c521e84..43709c3 100644 --- a/src/cppunit/TypeInfoHelper.cpp +++ b/src/cppunit/TypeInfoHelper.cpp @@ -14,6 +14,14 @@ TypeInfoHelper::getClassName( const std::type_info &info ) static std::string classPrefix( "class " ); std::string name( info.name() ); + // Work around gcc 3.0 bug: strip number before type name. + int firstNotDigitIndex = 0; + while ( firstNotDigitIndex < name.length() && + name[firstNotDigitIndex] >= '0' && + name[firstNotDigitIndex] <= '9' ) + ++firstNotDigitIndex; + name = name.substr( firstNotDigitIndex ); + if ( name.substr( 0, classPrefix.length() ) == classPrefix ) return name.substr( classPrefix.length() ); return name; |
