the ICE is fixed in gcc-4.2 (hardy) and gcc-4.3 (intrepid).
$ g++ -Wall test00.cpp
test00.cpp:57: error: a cast to a type other than an integral or enumeration
type cannot appear in a constant-expression
test00.cpp:57: error: template argument 3 is invalid
test00.cpp:65: error: a cast to a type other than an integral or enumeration
type cannot appear in a constant-expression
test00.cpp:65: error: template argument 3 is invalid
test00.cpp: In instantiation of 'TSlot<int>':
test00.cpp:61: instantiated from here
test00.cpp:43: error: 'int' is not a class, struct, or union type
test00.cpp:44: error: 'int' is not a class, struct, or union type
test00.cpp:45: error: 'int' is not a class, struct, or union type
test00.cpp:47: error: 'int' is not a class, struct, or union type
test00.cpp:49: error: 'int' is not a class, struct, or union type
test00.cpp:51: error: 'int' is not a class, struct, or union type
test00.cpp:52: error: 'int' is not a class, struct, or union type
test00.cpp: In static member function 'static const TSlot<int>&
Test::SlotName()':
test00.cpp:61: error: no matching function for call to 'TSlot<int>::TSlot(int
Test::*)'
test00.cpp:41: note: candidates are: TSlot<int>::TSlot(const TSlot<int>&)
test00.cpp: In static member function 'static const TSlot<int>&
Test::SlotAge()':
test00.cpp:69: error: no matching function for call to 'TSlot<int>::TSlot(int
Test::*)'
test00.cpp:41: note: candidates are: TSlot<int>::TSlot(const TSlot<int>&)
test00.cpp: In constructor 'Test::Test()':
test00.cpp:73: error: cannot convert 'Test' to 'int' in initialization
test00.cpp:73: error: cannot convert 'Test' to 'int' in initialization
test00.cpp: In function 'int main()':
test00.cpp:83: error: cannot convert 'std::string' to 'int' in assignment
test00.cpp:85: error: invalid type argument of 'unary *'
test00.cpp:85: error: invalid type argument of 'unary *'
test00.cpp:87: error: invalid conversion from 'int' to 'const char*'
test00.cpp:87: error: initializing argument 1 of 'std::basic_string<_CharT,
_Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT =
char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
** Changed in: gcc-4.1 (Ubuntu)
Status: New => Fix Released
--
gcc-4.1 crashes on templated class with a member function as argument with
member function type default value assigned as template parameter default value
https://bugs.launchpad.net/bugs/226718
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs