c++/7077: nested typedef conversion operator

david.abrahams@rcn.com david.abrahams@rcn.com
Wed Jun 19 09:19:00 GMT 2002


>Number:         7077
>Category:       c++
>Synopsis:       nested typedef conversion operator
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 19 06:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     david.abrahams@rcn.com
>Release:        3.1
>Organization:
>Environment:
cygwin
>Description:
The following should compile but doesn't.
>How-To-Repeat:
struct X;

template <class T>
struct Y
{
    typedef void (X::*b)() const;
    operator b() const;
};

struct X { void f() const {} };

template <class T>
Y<T>::operator typename Y<T>::b() const
{
    return &X::f;
}

int main()
{
    if (Y<int>())
        return 0;
    else
        return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list