This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12321] New: compile error
- From: "emild at collectivestudios dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2003 22:24:20 -0000
- Subject: [Bug c++/12321] New: compile error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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++.