This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47172] New: [C++0x] cannot call member function without object
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 4 Jan 2011 21:42:39 +0000
- Subject: [Bug c++/47172] New: [C++0x] cannot call member function without object
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: marc.glisse@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