public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
@ 2003-06-07 16:40 ` pinskia@physics.uc.edu
  2003-07-14 15:02 ` pinskia at physics dot uc dot edu
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-07 16:40 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia@physics.uc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|0000-00-00 00:00:00         |2003-06-07 16:40:56
               date|                            |


------- Additional Comments From pinskia@physics.uc.edu  2003-06-07 16:40 -------
Still happens on the mainline (20030607).


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
  2003-06-07 16:40 ` [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args pinskia@physics.uc.edu
@ 2003-07-14 15:02 ` pinskia at physics dot uc dot edu
  2003-11-13 16:16 ` bangerth at dealii dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-14 15:02 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-06-07 16:40:56         |2003-07-14 15:02:48
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-14 15:02 -------
the mainline (20030714) still ICEs on this code.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
  2003-06-07 16:40 ` [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args pinskia@physics.uc.edu
  2003-07-14 15:02 ` pinskia at physics dot uc dot edu
@ 2003-11-13 16:16 ` bangerth at dealii dot org
  2003-11-19 10:02 ` giovannibajo at libero dot it
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2003-11-13 16:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-11-13 16:16 -------
Most likely closely related to PR 13040.

W.

-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (2 preceding siblings ...)
  2003-11-13 16:16 ` bangerth at dealii dot org
@ 2003-11-19 10:02 ` giovannibajo at libero dot it
  2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2003-11-19 10:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2003-11-19 10:02 -------
Will post a patch soon.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |giovannibajo at libero dot
                   |dot org                     |it
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (3 preceding siblings ...)
  2003-11-19 10:02 ` giovannibajo at libero dot it
@ 2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
  2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-20  7:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-20 07:05 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2003-11/msg01556.html>, tested by me and 
no regressions.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (4 preceding siblings ...)
  2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
@ 2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
  2003-12-02  5:51 ` jason at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-20  7:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-20 07:05 -------
*** Bug 13040 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dave at boost-consulting dot
                   |                            |com


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (5 preceding siblings ...)
  2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
@ 2003-12-02  5:51 ` jason at gcc dot gnu dot org
  2003-12-02 15:46 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: jason at gcc dot gnu dot org @ 2003-12-02  5:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jason at gcc dot gnu dot org  2003-12-02 05:51 -------
This testcase is ill-formed:

  5.3.1  Unary operators                                 [expr.unary.op]

2 The result of the unary & operator is a pointer to its  operand.   The
  operand  shall  be an lvalue or a qualified-id....  
                                                   For  a  qualified-id,
  if  the  member is a static member of type "T", the type of the result
  is plain "pointer to T."  If the member is a nonstatic member of class
  C  of  type T, the type of the result is "pointer to member of class C
  of type T."  [Example:

     struct A { int i; };
     struct B : A { };
     ... &B::i ...                 // has type int A::*

   --end example]

  14.3.2  Template non-type arguments                 [temp.arg.nontype]
  
  --  For  a  non-type  template-parameter  of  type  pointer  to member
      function,  no  conversions  apply.    If   the   template-argument
      represents  a  set  of  overloaded  member functions, the matching
      member function is selected from the set (_over.over_).

For better or worse, in this case worse, &Strawberry::I has type pointer to
member function of Fruit, not of Strawberry, and no conversion is done to make
it a pointer to member function of Strawberry.  To make it work, you need to add
an explicit downcast:

  dish.Get<(int const& (Strawberry::*fun)() const)&Strawberry::I>();

Dave, your testcase in 13040 is similarly ill-formed.

I'm not arguing that these rules make sense, but that is in fact what they say.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (6 preceding siblings ...)
  2003-12-02  5:51 ` jason at gcc dot gnu dot org
@ 2003-12-02 15:46 ` cvs-commit at gcc dot gnu dot org
  2003-12-02 15:50 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-02 15:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-02 15:46 -------
Subject: Bug 10126

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2003-12-02 15:46:52

Modified files:
	gcc/cp         : ChangeLog pt.c 

Log message:
	PR c++/10126
	* pt.c (convert_nontype_argument): Handle default conversions
	while converting a pointer to member function.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3776&r2=1.3777
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.798&r2=1.799



-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (7 preceding siblings ...)
  2003-12-02 15:46 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-02 15:50 ` cvs-commit at gcc dot gnu dot org
  2003-12-02 15:53 ` giovannibajo at libero dot it
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-02 15:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-02 15:50 -------
Subject: Bug 10126

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	giovannibajo@gcc.gnu.org	2003-12-02 15:50:45

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

Log message:
	PR c++/10126
	* g++.dg/template/ptrmem8.C: New test.

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



-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (8 preceding siblings ...)
  2003-12-02 15:50 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-02 15:53 ` giovannibajo at libero dot it
  2003-12-09 17:58 ` dhazeghi at yahoo dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 13+ messages in thread
From: giovannibajo at libero dot it @ 2003-12-02 15:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2003-12-02 15:53 -------
Jason's approval:
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg00168.html

Fixed for GCC 3.4. Thanks for your report!


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (9 preceding siblings ...)
  2003-12-02 15:53 ` giovannibajo at libero dot it
@ 2003-12-09 17:58 ` dhazeghi at yahoo dot com
  2003-12-11 21:56 ` marco dot franzen at bigfoot dot com
  2003-12-12  8:50 ` bangerth at dealii dot org
  12 siblings, 0 replies; 13+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-12-09 17:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (10 preceding siblings ...)
  2003-12-09 17:58 ` dhazeghi at yahoo dot com
@ 2003-12-11 21:56 ` marco dot franzen at bigfoot dot com
  2003-12-12  8:50 ` bangerth at dealii dot org
  12 siblings, 0 replies; 13+ messages in thread
From: marco dot franzen at bigfoot dot com @ 2003-12-11 21:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From marco dot franzen at bigfoot dot com  2003-12-11 21:55 -------
Subject: Re:  ICE in convert_nontype_argument on using overload resolution in template args

I have bootstrapped gcc-3.4-20031203, and the crash is indeed fixed.
Thanks a lot to everyone!

Jason, you write in c9
       http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10126#c9

> For better or worse, in this case worse, &Strawberry::I has type
> pointer to member function of Fruit, not of Strawberry, and no
> conversion is done to make it a pointer to member function of
> Strawberry.  To make it work, you need to add an explicit downcast:
> 
>   dish.Get<(int const& (Strawberry::*fun)() const)&Strawberry::I>();

I have no standard at hand myself (and maybe should shut up; sorry),
but Stroustrup writes in TC++PL, 3rd ed, 13.2.3 "Template Parameters",
p232, 2nd par:

	A pointer used as a template argument must be of the form &of,
	where of is the name of an object or a function, or of the
	form f, where f is the name of a function.  A pointer to
	member must be of the form &X::of, where of is the name of an
	member.

A cast expression would obviously not be of that form.  I take it the
standard relaxed Stroustrup's requirement so that your suggestion
would be indeed valid?

Cheers,
Marco


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args
       [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
                   ` (11 preceding siblings ...)
  2003-12-11 21:56 ` marco dot franzen at bigfoot dot com
@ 2003-12-12  8:50 ` bangerth at dealii dot org
  12 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2003-12-12  8:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2003-12-12 08:50 -------
I believe the standard has about the same wording and that a cast 
is not allowed inside the template arg specification. In that 
case, there would be no way to actually achieve what you want. 
We have another PR about this exact same problem. 
 
W. 

-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-12-12  8:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030318001600.10126.marco.franzen@bigfoot.com>
2003-06-07 16:40 ` [Bug c++/10126] ICE in convert_nontype_argument on using overload resolution in template args pinskia@physics.uc.edu
2003-07-14 15:02 ` pinskia at physics dot uc dot edu
2003-11-13 16:16 ` bangerth at dealii dot org
2003-11-19 10:02 ` giovannibajo at libero dot it
2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
2003-11-20  7:05 ` pinskia at gcc dot gnu dot org
2003-12-02  5:51 ` jason at gcc dot gnu dot org
2003-12-02 15:46 ` cvs-commit at gcc dot gnu dot org
2003-12-02 15:50 ` cvs-commit at gcc dot gnu dot org
2003-12-02 15:53 ` giovannibajo at libero dot it
2003-12-09 17:58 ` dhazeghi at yahoo dot com
2003-12-11 21:56 ` marco dot franzen at bigfoot dot com
2003-12-12  8:50 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).