User account creation filtered due to spam.

Bug 48656 - [4.6 regression] [C++0x] cannot call member function without object
Summary: [4.6 regression] [C++0x] cannot call member function without object
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.1
Assignee: Dodji Seketeli
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-04-17 21:09 UTC by Harald van Dijk
Modified: 2011-04-28 20:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.1
Known to fail: 4.6.0, 4.7.0
Last reconfirmed: 2011-04-28 03:09:18


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk 2011-04-17 21:09:41 UTC
Very similar to bug 47174:

struct A {
 int f();
 int f(int);
};
template <typename> struct B : A
{
};
template <typename T> struct C : B<T>
{
 void g() {
   A::f();
 }
};

This still fails with GCC 4.6.0 and -std=c++0x:
a.ii: In member function ‘void C<T>::g()’:
a.ii:11:11: error: cannot call member function ‘int A::f()’ without object
Comment 1 Harald van Dijk 2011-04-17 21:14:07 UTC
Er... That's bug 47172, not bug 47174.
Comment 2 Paolo Carlini 2011-04-17 21:25:48 UTC
Dodji, can you have a look? Thanks.
Comment 3 Jason Merrill 2011-04-28 03:09:18 UTC
Dodji, please take a look at this bug, it's a regression.
Comment 4 Dodji Seketeli 2011-04-28 18:08:48 UTC
Author: dodji
Date: Thu Apr 28 18:08:43 2011
New Revision: 173123

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173123
Log:
Fix PR c++/48656

gcc/cp/

	* semantics.c (finish_call_expr): Don't forget BASELINK nodes when
	considering call expressions involving a member function.

gcc/testsuite/

	* gcc/testsuite/g++.dg/template/inherit7.C: New test case.

Added:
    trunk/gcc/testsuite/g++.dg/template/inherit7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Dodji Seketeli 2011-04-28 18:10:28 UTC
Fixed in trunk (4.7).  My boostrap on 4.6 is still on going ...
Comment 6 Dodji Seketeli 2011-04-28 19:46:37 UTC
Author: dodji
Date: Thu Apr 28 19:46:34 2011
New Revision: 173131

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173131
Log:
Fix PR c++/48656

gcc/cp/

	* semantics.c (finish_call_expr): Don't forget BASELINK nodes when
	considering call expressions involving a member function.

gcc/testsuite/

	* gcc/testsuite/g++.dg/template/inherit7.C: New test case.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/template/inherit7.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/semantics.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 7 Dodji Seketeli 2011-04-28 20:06:45 UTC
Fixed in 4.6