public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28557]  New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator
@ 2006-07-31 21:31 reichelt at gcc dot gnu dot org
  2006-07-31 21:45 ` [Bug c++/28557] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-07-31 21:31 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet is rejected since GCC 4.0.3.
On mainline it even triggers an ICE:

=========================================================
struct A
{
    template<typename T> operator T() { return T(); }
};

template<int> void foo()
{
    A().operator int();
}

void bar()
{
    foo<0>();
}
=========================================================

bug.cc: In function 'void foo() [with int <anonymous> = 0]':
bug.cc:13:   instantiated from here
bug.cc:8: error: invalid use of template type parameter
bug.cc: In member function 'A::operator T() [with T = T]':
bug.cc:8:   instantiated from 'void foo() [with int <anonymous> = 0]'
bug.cc:13:   instantiated from here
bug.cc:3: internal compiler error: in dependent_type_p, at cp/pt.c:12523
Please submit a full bug report, [etc.]

The code compiles fine, if I turn foo into a regular function.


-- 
           Summary: [4.0/4.1/4.2 regression] Trouble with templated type
                    conversion operator
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, rejects-valid, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/28557] [4.0/4.1/4.2 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
@ 2006-07-31 21:45 ` pinskia at gcc dot gnu dot org
  2006-07-31 23:43 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-31 21:45 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.4


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


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

* [Bug c++/28557] [4.0/4.1/4.2 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
  2006-07-31 21:45 ` [Bug c++/28557] " pinskia at gcc dot gnu dot org
@ 2006-07-31 23:43 ` mmitchel at gcc dot gnu dot org
  2006-08-02 20:34 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-07-31 23:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/28557] [4.0/4.1/4.2 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
  2006-07-31 21:45 ` [Bug c++/28557] " pinskia at gcc dot gnu dot org
  2006-07-31 23:43 ` mmitchel at gcc dot gnu dot org
@ 2006-08-02 20:34 ` mmitchel at gcc dot gnu dot org
  2006-08-02 20:36 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-02 20:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mmitchel at gcc dot gnu dot org  2006-08-02 20:34 -------
Subject: Bug 28557

Author: mmitchel
Date: Wed Aug  2 20:33:48 2006
New Revision: 115885

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115885
Log:
        PR c++/28557
        * pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
        PR c++/28557
        * g++.dg/template/conv9.C: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/conv9.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/pt.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/28557] [4.0/4.1/4.2 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-08-02 20:34 ` mmitchel at gcc dot gnu dot org
@ 2006-08-02 20:36 ` mmitchel at gcc dot gnu dot org
  2006-08-02 20:37 ` [Bug c++/28557] [4.0 " mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-02 20:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2006-08-02 20:35 -------
Subject: Bug 28557

Author: mmitchel
Date: Wed Aug  2 20:35:41 2006
New Revision: 115886

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115886
Log:
        PR c++/28557
        * pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
        PR c++/28557
        * g++.dg/template/conv9.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/conv9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/28557] [4.0 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-08-02 20:36 ` mmitchel at gcc dot gnu dot org
@ 2006-08-02 20:37 ` mmitchel at gcc dot gnu dot org
  2006-08-24  1:54 ` bangerth at dealii dot org
  2007-02-03 18:41 ` gdr at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-02 20:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2006-08-02 20:37 -------
Fixed in 4.1.2.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.0/4.1/4.2 regression]    |[4.0 regression] Trouble
                   |Trouble with templated type |with templated type
                   |conversion operator         |conversion operator


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


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

* [Bug c++/28557] [4.0 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-08-02 20:37 ` [Bug c++/28557] [4.0 " mmitchel at gcc dot gnu dot org
@ 2006-08-24  1:54 ` bangerth at dealii dot org
  2007-02-03 18:41 ` gdr at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2006-08-24  1:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-08-24 01:53:57
               date|                            |


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


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

* [Bug c++/28557] [4.0 regression] Trouble with templated type conversion operator
  2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-08-24  1:54 ` bangerth at dealii dot org
@ 2007-02-03 18:41 ` gdr at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 18:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gdr at gcc dot gnu dot org  2007-02-03 18:41 -------
Fixed in GCC-4.1.2.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.2


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


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

end of thread, other threads:[~2007-02-03 18:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31 21:31 [Bug c++/28557] New: [4.0/4.1/4.2 regression] Trouble with templated type conversion operator reichelt at gcc dot gnu dot org
2006-07-31 21:45 ` [Bug c++/28557] " pinskia at gcc dot gnu dot org
2006-07-31 23:43 ` mmitchel at gcc dot gnu dot org
2006-08-02 20:34 ` mmitchel at gcc dot gnu dot org
2006-08-02 20:36 ` mmitchel at gcc dot gnu dot org
2006-08-02 20:37 ` [Bug c++/28557] [4.0 " mmitchel at gcc dot gnu dot org
2006-08-24  1:54 ` bangerth at dealii dot org
2007-02-03 18:41 ` gdr at gcc dot gnu 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).