http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47172

           Summary: [C++0x] cannot call member function without object
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: marc.gli...@normalesup.org


The following code fails to compile with -std=c++0x, but compiles with c++98 or
if I change the prototype of f to make it return void. It doesn't look like PR
46731.

struct A
{
    int f() const;
};

template <class T>
struct B : A { };

template <class T>
struct C : B<T>
{
    void g();
};

template <class T>
void C<T>::g()
{
    A::f();
}

bug.cpp:18:11: error: cannot call member function 'int A::f() const' without
object

Reply via email to