public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38795] [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates
  2009-01-10 16:54 [Bug c++/38795] New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates reichelt at gcc dot gnu dot org
@ 2009-01-10 16:54 ` reichelt at gcc dot gnu dot org
  2009-01-13  9:03 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-01-10 16:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.3


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


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

* [Bug c++/38795]  New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates
@ 2009-01-10 16:54 reichelt at gcc dot gnu dot org
  2009-01-10 16:54 ` [Bug c++/38795] " reichelt at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-01-10 16:54 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet is triggers an ICE since GCC 4.3.0:

========================================
template<typename... T> int foo(int i)
{
  return *reinterpret_cast<T*>(i);
}

void bar(int i)
{
  foo<int>(i);
}
========================================

bug.cc: In function 'int foo(int) [with T = int]':
bug.cc:8:   instantiated from here
bug.cc:3: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_type_parm in lookup_conversions,
at cp/search.c:2459
Please submit a full bug report, [etc.]

It's a regression because the code crashes even without -std=gnu++0x.


-- 
           Summary: [4.3/4.4 regression] ICE with reinterpret_cast and
                    variadic templates
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, 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=38795


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

* [Bug c++/38795] [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates
  2009-01-10 16:54 [Bug c++/38795] New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates reichelt at gcc dot gnu dot org
  2009-01-10 16:54 ` [Bug c++/38795] " reichelt at gcc dot gnu dot org
@ 2009-01-13  9:03 ` jakub at gcc dot gnu dot org
  2009-01-13 18:12 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-13  9:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-01-13 09:03 -------
Seems cp_walk_subtrees doesn't handle REINTERPRET_CAST_EXPR, so
check_for_bare_parameter_packs doesn't detect them.  Just handling this the
same
as CAST_EXPR seems to fix this testcase.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-01-13 09:03:19
               date|                            |


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


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

* [Bug c++/38795] [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates
  2009-01-10 16:54 [Bug c++/38795] New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates reichelt at gcc dot gnu dot org
  2009-01-10 16:54 ` [Bug c++/38795] " reichelt at gcc dot gnu dot org
  2009-01-13  9:03 ` jakub at gcc dot gnu dot org
@ 2009-01-13 18:12 ` jakub at gcc dot gnu dot org
  2009-01-13 18:12 ` [Bug c++/38795] [4.3 " jakub at gcc dot gnu dot org
  2009-01-15 16:13 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-13 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2009-01-13 18:12 -------
Subject: Bug 38795

Author: jakub
Date: Tue Jan 13 18:11:50 2009
New Revision: 143351

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143351
Log:
        PR c++/38795
        * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
        STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
        as CAST_EXPR.

        * g++.dg/cpp0x/pr38795.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr38795.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/38795] [4.3 regression] ICE with reinterpret_cast and variadic templates
  2009-01-10 16:54 [Bug c++/38795] New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-01-13 18:12 ` jakub at gcc dot gnu dot org
@ 2009-01-13 18:12 ` jakub at gcc dot gnu dot org
  2009-01-15 16:13 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-13 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2009-01-13 18:12 -------
Fixed on the trunk so far.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3/4.4 regression] ICE    |[4.3 regression] ICE with
                   |with reinterpret_cast and   |reinterpret_cast and
                   |variadic templates          |variadic templates


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


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

* [Bug c++/38795] [4.3 regression] ICE with reinterpret_cast and variadic templates
  2009-01-10 16:54 [Bug c++/38795] New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-01-13 18:12 ` [Bug c++/38795] [4.3 " jakub at gcc dot gnu dot org
@ 2009-01-15 16:13 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-15 16:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-01-15 16:12 -------
Fixed for GCC 4.4.  Works for me on the branch with checking disabled.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
           Keywords|                            |ice-checking
      Known to fail|                            |4.3.2
      Known to work|                            |4.4.0
         Resolution|                            |FIXED
   Target Milestone|4.3.3                       |4.4.0


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


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

end of thread, other threads:[~2009-01-15 16:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-10 16:54 [Bug c++/38795] New: [4.3/4.4 regression] ICE with reinterpret_cast and variadic templates reichelt at gcc dot gnu dot org
2009-01-10 16:54 ` [Bug c++/38795] " reichelt at gcc dot gnu dot org
2009-01-13  9:03 ` jakub at gcc dot gnu dot org
2009-01-13 18:12 ` jakub at gcc dot gnu dot org
2009-01-13 18:12 ` [Bug c++/38795] [4.3 " jakub at gcc dot gnu dot org
2009-01-15 16:13 ` rguenth 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).