This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7346: templated conversion operator to dependent type


>Number:         7346
>Category:       c++
>Synopsis:       templated conversion operator to dependent type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 17 16:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     david.abrahams@rcn.com
>Release:        3.1
>Organization:
>Environment:
Cygwin
>Description:
Should compile, instead gives:

foo.cpp:10: no `X<T>::operator int() const' member function declared in class `
   X<T>'
foo.cpp:10: template definition of non-template `X<T>::operator int() const'
>How-To-Repeat:
template <class T>
struct X
{
    typedef int result_type;
    operator result_type() const;
};

template <class T>
X<T>::operator typename X<T>::result_type() const
{
    return 0;
}

int x = X<char>();

>Fix:

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]