Bug 15875 - [3.4/4.0 Regression] rejects pointer to member in template
[3.4/4.0 Regression] rejects pointer to member in template
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
4.0.0
: P2 critical
: 3.4.1
Assigned To: Not yet assigned to anyone
: rejects-valid
: 15949 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-08 14:16 UTC by Andrew Pinski
Modified: 2004-10-30 21:11 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.0
Known to fail: 3.4.1 4.0.0
Last reconfirmed: 2004-06-08 15:36:33


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2004-06-08 14:16:14 UTC
struct foo
  {
  int f1(int) const;
  };
template<typename T>  
  void func()
    {
    typedef int (foo::*fptr)(int) const;
    fptr ptr = &foo::f1;
    }
Comment 1 Andrew Pinski 2004-06-08 14:17:25 UTC
Mark I think this might have been caused by one of your recent patches.
Comment 2 Wolfgang Bangerth 2004-06-08 15:36:29 UTC
This was introduced before 2004-06-02, since that is my last build. I 
think it is significant enough that we have to fix it before 3.4.1. 
 
W. 
Comment 3 Mark Mitchell 2004-06-09 18:20:27 UTC
No, this is not becuase of my patch -- it is because of the patch for PR 13092.

Jason, would you please revert that patch, since it is causing this problem? 
Then, please close this PR and reopen that one?

Thanks!
Comment 4 Giovanni Bajo 2004-06-10 10:49:50 UTC
Isn't it worth a little investigation on this bug before? We're trading a 
regression with another regression, and the patch in PR 13092 looks like a step 
forward anyway.
Comment 5 Mark Mitchell 2004-06-10 13:40:16 UTC
Subject: Re:  [3.4/3.5 Regression] rejects pointer to member
 in template

giovannibajo at libero dot it wrote:

> ------- Additional Comments From giovannibajo at libero dot it  2004-06-10 10:49 -------
> Isn't it worth a little investigation on this bug before? We're trading a 
> regression with another regression, and the patch in PR 13092 looks like a step 
> forward anyway.

If someone can easily fix the 13092 patch, that's fine, of course.

However, if we have to choose, it will be better to have regressions in 
3.4.1 that are already in 3.4.0 that new regressions.  A primary goal of 
the point releases is stability.

Comment 6 CVS Commits 2004-06-10 18:29:01 UTC
Subject: Bug 15875

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jason@gcc.gnu.org	2004-06-10 18:28:54

Modified files:
	gcc/cp         : ChangeLog cxx-pretty-print.c error.c init.c 
	                 pt.c 
Removed files:
	gcc/testsuite/g++.dg/template: non-dependent10.C 
	                               non-dependent7.C non-dependent8.C 
	                               non-dependent9.C 

Log message:
	PR c++/15875
	Revert:
	2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
	* init.c (build_offset_ref): Build SCOPE_REF with non-null
	TREE_TYPE for non-dependent names.
	* pt.c (type_dependent_expression_p): Handle SCOPE_REF with
	unknown_type_node as its TREE_TYPE.
	* cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
	* error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
	(dump_expr) <SCOPE_REF case>: Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4090&r2=1.4091
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cxx-pretty-print.c.diff?cvsroot=gcc&r1=1.20&r2=1.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.251&r2=1.252
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.372&r2=1.373
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.861&r2=1.862
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent10.C.diff?cvsroot=gcc&r1=1.1&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent7.C.diff?cvsroot=gcc&r1=1.1&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent8.C.diff?cvsroot=gcc&r1=1.1&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/non-dependent9.C.diff?cvsroot=gcc&r1=1.1&r2=NONE

Comment 7 CVS Commits 2004-06-10 18:31:05 UTC
Subject: Bug 15875

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	jason@gcc.gnu.org	2004-06-10 18:31:01

Modified files:
	gcc/cp         : ChangeLog cxx-pretty-print.c error.c init.c 
	                 pt.c 

Log message:
	PR c++/15875
	Revert:
	2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
	* init.c (build_offset_ref): Build SCOPE_REF with non-null
	TREE_TYPE for non-dependent names.
	* pt.c (type_dependent_expression_p): Handle SCOPE_REF with
	unknown_type_node as its TREE_TYPE.
	* cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
	* error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
	(dump_expr) <SCOPE_REF case>: Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.120&r2=1.3892.2.121
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cxx-pretty-print.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.13.4.1&r2=1.13.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.241.4.4&r2=1.241.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.356.2.11&r2=1.356.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.30&r2=1.816.2.31

Comment 8 Andrew Pinski 2004-06-10 18:55:16 UTC
Fixed.
Comment 9 Andrew Pinski 2004-06-11 21:18:11 UTC
*** Bug 15949 has been marked as a duplicate of this bug. ***
Comment 10 CVS Commits 2005-05-02 15:38:45 UTC
Subject: Bug 15875

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2005-05-02 15:38:38

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: ptrmem14.C 

Log message:
	PR c++/15875
	* g++.dg/template/ptrmem14.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5425&r2=1.5426
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem14.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 11 CVS Commits 2005-05-02 15:40:31 UTC
Subject: Bug 15875

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	mmitchel@gcc.gnu.org	2005-05-02 15:40:25

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: ptrmem14.C 

Log message:
	PR c++/15875
	* g++.dg/template/ptrmem14.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.152&r2=1.5084.2.153
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem14.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1

Comment 12 CVS Commits 2005-05-02 18:39:02 UTC
Subject: Bug 15875

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2005-05-02 18:38:54

Modified files:
	gcc/cp         : ChangeLog typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: ptrmem14.C 

Log message:
	Revert:
	2005-05-01  Mark Mitchell  <mark@codesourcery.com>
	* typeck.c (unary_complex_lvalue): In a template, always refuse
	simplifications.
	
	PR c++/15875
	* g++.dg/template/ptrmem14.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.215&r2=1.3892.2.216
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.519.2.26&r2=1.519.2.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.388&r2=1.3389.2.389
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem14.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1