[Bug c++/12321] New: compile error
emild at collectivestudios dot com
gcc-bugzilla@gcc.gnu.org
Wed Sep 17 23:33:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12321
Summary: compile error
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: emild at collectivestudios dot com
CC: gcc-bugs at gcc dot gnu dot org
The following code snippet fails to compile on gcc version 3.2.3 (mingw special
20030504-1):
<c++>
template <class T>
class a
{
private:
void foo() { }
typedef void (a::*unspecified_bool_type)();
public:
operator unspecified_bool_type() const;
};
template <class T>
inline
a<T>::operator typename a<T>::unspecified_bool_type() const
{
return 0;
}
int main()
{
if( a<int>() )
{
}
return 0;
}
</c++>
Compiler output:
Test.cpp:14: no `a<T>::operator void (a<T>::*)()() const' member function
declared in class `a<T>'
Test.cpp:14: template definition of non-template `a<T>::operator void (a<T>::*)
()() const'
This code compiles on both .NET and Comeau (in strict mode), and I believe it
to be valid C++.
More information about the Gcc-bugs
mailing list