Bug 2094 - unimplemented: use of `ptrmem_cst' in template type unification
Summary: unimplemented: use of `ptrmem_cst' in template type unification
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: 3.3.3
Assignee: Giovanni Bajo
URL:
Keywords: monitored, patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2001-02-25 23:26 UTC by togawa
Modified: 2003-11-14 08:39 UTC (History)
9 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-11-03 04:13:42


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description togawa 2001-02-25 23:26:01 UTC
Gcc emits the following error message when I compile the code in the 'How-To-Repeat' section.

t.cc:16: sorry, not implemented: use of `ptrmem_cst' in template type 
   unification
t.cc: In function `void f()':
t.cc:16: warning: unused variable `bar<baz, &baz::the_foo_, baz> i'

Release:
gcc version 3.1 20010225 (experimental)

Environment:
i686-pc-linux-gnu, RedHat 6.2

How-To-Repeat:
Compiling the following code with 'gcc -c <filename>' will repeat the problem.

template<typename Element, int Element::*Foo, typename CVElement>
struct bar {

  bar() {}

  template<typename CVE>
  bar(const bar<Element, Foo, CVE>& x) {}
};

struct baz {
  int		the_foo_;
};

void f()
{
  bar<baz, &baz::the_foo_, baz> i = bar<baz, &baz::the_foo_, baz>();
}
Comment 1 Neil Booth 2001-02-25 23:44:15 UTC
State-Changed-From-To: open->closed
State-Changed-Why: I'm closing this PR - the error message indicates that the
    GCC team is aware of the issue; thus an extra bug report is
    unnecessary and just lowers the signal to noise ratio of
    GNATS.
Comment 2 Neil Booth 2001-02-26 07:44:15 UTC
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, togawa@acm.org
Cc:  
Subject: Re: c++/2094
Date: 26 Feb 2001 07:44:15 -0000

 Synopsis: gcc3.1 emits 'sorry, not implemented: use of `ptrmem_cst' in template type unification'
 
 State-Changed-From-To: open->closed
 State-Changed-By: neil
 State-Changed-When: Sun Feb 25 23:44:15 2001
 State-Changed-Why:
     I'm closing this PR - the error message indicates that the
     GCC team is aware of the issue; thus an extra bug report is
     unnecessary and just lowers the signal to noise ratio of
     GNATS.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2094&database=gcc
Comment 3 Neil Booth 2001-02-26 11:16:55 UTC
State-Changed-From-To: closed->open
State-Changed-Why: Re-opened on request of submitter.
Comment 4 Neil Booth 2001-02-26 19:16:55 UTC
From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, togawa@acm.org
Cc:  
Subject: Re: c++/2094
Date: 26 Feb 2001 19:16:55 -0000

 Synopsis: gcc3.1 emits 'sorry, not implemented: use of `ptrmem_cst' in template type unification'
 
 State-Changed-From-To: closed->open
 State-Changed-By: neil
 State-Changed-When: Mon Feb 26 11:16:55 2001
 State-Changed-Why:
     Re-opened on request of submitter.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2094&database=gcc
Comment 5 Kriang Lerdsuwanakij 2001-03-14 03:54:15 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirm as a bug.
Comment 6 Kriang Lerdsuwanakij 2001-03-14 11:54:15 UTC
From: lerdsuwa@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, togawa@acm.org
Cc:  
Subject: Re: c++/2094
Date: 14 Mar 2001 11:54:15 -0000

 Synopsis: gcc3.1 emits 'sorry, not implemented: use of `ptrmem_cst' in template type unification'
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: lerdsuwa
 State-Changed-When: Wed Mar 14 03:54:15 2001
 State-Changed-Why:
     Confirm as a bug.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2094&database=gcc

Comment 7 Wolfgang Bangerth 2002-11-14 14:58:06 UTC
From: Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/2094: gcc3.1 emits 'sorry, not implemented: use of `ptrmem_cst' in template type unification'
Date: Thu, 14 Nov 2002 14:58:06 -0600

 Confirmed with CVS from 2002-11-10. The present error message is somewhat annoying, since it repeats the same 
 text twice:
 tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ -c x.cc
 x.cc:16: sorry, unimplemented: sorry, not implemented: use of `ptrmem_cst' in
    template type unification

Comment 8 Wolfgang Bangerth 2002-11-14 15:15:46 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu>,
   <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/2094: gcc3.1 emits 'sorry, not implemented: use of `ptrmem_cst'
 in template type unification'
Date: Thu, 14 Nov 2002 15:15:46 -0600 (CST)

 > Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu> writes:
 > 
 > |  Confirmed with CVS from 2002-11-10. The present error message is somewhat annoying, since it repeats the same 
 > |  text twice:
 > |  tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ -c x.cc
 > |  x.cc:16: sorry, unimplemented: sorry, not implemented: use of `ptrmem_cst' in
 > 
 > I think I have an idea of where that repeatition is coming from.
 > Expect a patch to correct that annoyance in a moment.
 
 Very good, I took a quick look but got lost in the macro jungle too 
 quickly and did not have my laser macro sword (== plenty of free time) 
 with me, so left it to others :-)
 
 Thanks
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 

Comment 9 Gabriel Dos Reis 2002-11-14 22:08:46 UTC
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/2094: gcc3.1 emits 'sorry, not implemented: use of `ptrmem_cst' in template type unification'
Date: 14 Nov 2002 22:08:46 +0100

 Wolfgang Bangerth <bangerth@apex68.ticam.utexas.edu> writes:
 
 |  Confirmed with CVS from 2002-11-10. The present error message is somewhat annoying, since it repeats the same 
 |  text twice:
 |  tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ -c x.cc
 |  x.cc:16: sorry, unimplemented: sorry, not implemented: use of `ptrmem_cst' in
 
 I think I have an idea of where that repeatition is coming from.
 Expect a patch to correct that annoyance in a moment.
 
 -- Gaby

Comment 10 Wolfgang Bangerth 2003-05-05 19:18:08 UTC
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/2094
Date: Mon, 5 May 2003 19:18:08 -0500 (CDT)

 The duplicate message is gone, but ptrmem_cst is still not implemented.
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 

Comment 11 Wolfgang Bangerth 2003-05-05 19:30:36 UTC
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/2094
Date: Mon, 5 May 2003 19:30:36 -0500 (CDT)

 Here's a small testcase that is somewhat more like our usual ones:
 ---------------------
 struct S {
   int i;
 };
 
 template<int S::*p, typename>
 struct X {
     X ();
     template<typename U> X(const X<p,U> &);
 };
 
 X<&S::i,S> x = X<&S::i,S>();
 ----------------------------
Comment 12 Giovanni Bajo 2003-06-25 17:35:03 UTC
Patch submitted:
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02859.html
Comment 13 GCC Commits 2003-11-14 04:31:17 UTC
Subject: Bug 2094

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	bernie@gcc.gnu.org	2003-11-14 04:31:14

Modified files:
	gcc/cp         : pt.c ChangeLog 

Log message:
	Backport from 3.4-branch.
	
	2003-06-25  Giovanni Bajo  <giovannibajo@libero.it>
	
	PR c++/2094
	* pt.c (unify): Add support for PTRMEM_CST and
	FIELD_DECL unification.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.635.2.37&r2=1.635.2.38
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.220&r2=1.3076.2.221

Comment 14 GCC Commits 2003-11-14 04:34:54 UTC
Subject: Bug 2094

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	bernie@gcc.gnu.org	2003-11-14 04:34:52

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

Log message:
	Backport from 3.4-branch
	
	2003-06-25  Giovanni Bajo  <giovannibajo@libero.it>
	
	PR c++/2094
	* g++.dg/template/ptrmem6.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.317&r2=1.2261.2.318
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem6.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.20.1

Comment 15 Andrew Pinski 2003-11-14 04:47:38 UTC
Bernardo, this was not applied on the mainline at all and it was not approved as far as I could see, 
could you make sure it was approved and then apply it to the mainline as of two weeks ago, this 
was not accepted on the mainline.
Comment 16 GCC Commits 2003-11-14 04:51:30 UTC
Subject: Bug 2094

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bernie@gcc.gnu.org	2003-11-14 04:51:22

Modified files:
	gcc/cp         : ChangeLog pt.c 

Log message:
	PR c++/2094
	* pt.c (unify): Add support for PTRMEM_CST and
	FIELD_DECL unification.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3759&r2=1.3760
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.793&r2=1.794

Comment 17 GCC Commits 2003-11-14 05:13:52 UTC
Subject: Bug 2094

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bernie@gcc.gnu.org	2003-11-14 05:13:45

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

Log message:
	PR c++/2094
	* g++.dg/template/ptrmem7.C: New test.

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

Comment 18 Andrew Pinski 2003-11-14 05:19:20 UTC
Fixed for 3.3.3.
Comment 19 Bernardo Innocenti 2003-11-14 05:52:06 UTC
(In reply to comment #15)
> Bernardo, this was not applied on the mainline at all and it was not approved
as far as I could see, 
> could you make sure it was approved and then apply it to the mainline as of
two weeks ago, this 
> was not accepted on the mainline.

The patch was approved for mainline here:

  http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00667.html

And for 3.3-branch here:

  http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00652.html

I had the patch applied to mainline in my local tree.
Shortly after committing on 3.3, I realized the mainline
version wasn't yet in CVS. Now it's in both branches.
Comment 20 Giovanni Bajo 2003-11-14 08:39:40 UTC
Yes, it's approved for both mainline and 3.3 branch. This bug has now been 
fixed for any future version of GCC starting from 3.3.3.

Thank you Bernardo for taking care of the commit!