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

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).