public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
@ 2011-11-27 23:54 reichelt at gcc dot gnu.org
  2011-11-28  0:10 ` [Bug c++/51328] " reichelt at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-11-27 23:54 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51328
           Summary: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template
                    parameter
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: reichelt@gcc.gnu.org


The following invalid code snippet triggers an ICE since GCC 4.4.0:

================================
template<typename T> struct A
{
  void foo(A<T::~T>);
};
================================

bug.cc:3:19: error: to refer to a type member of a template parameter, use
'typename T::~T' [-fpermissive]
bug.cc:3:19: internal compiler error: in make_typename_type, at cp/decl.c:3224
Please submit a full bug report, [etc.]


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
@ 2011-11-28  0:10 ` reichelt at gcc dot gnu.org
  2011-11-30 19:52 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-11-28  0:10 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
   Target Milestone|---                         |4.4.7


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
  2011-11-28  0:10 ` [Bug c++/51328] " reichelt at gcc dot gnu.org
@ 2011-11-30 19:52 ` pinskia at gcc dot gnu.org
  2011-12-06 14:23 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-30 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-30
     Ever Confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-30 19:38:59 UTC ---
Confirmed.


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
  2011-11-28  0:10 ` [Bug c++/51328] " reichelt at gcc dot gnu.org
  2011-11-30 19:52 ` pinskia at gcc dot gnu.org
@ 2011-12-06 14:23 ` rguenth at gcc dot gnu.org
  2011-12-19 11:40 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-12-06 14:23 ` rguenth at gcc dot gnu.org
@ 2011-12-19 11:40 ` paolo.carlini at oracle dot com
  2011-12-19 14:30 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-19 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-19 11:22:34 UTC ---
Fixing the ICE seems rather easy (an overeager gcc_assert?), but then we
reject:

template<typename T> struct A
{
  void foo(A<typename T::~T>);
};

which EDG accepts, apparently. Jason, is this also a rejects-valid?


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-12-19 11:40 ` paolo.carlini at oracle dot com
@ 2011-12-19 14:30 ` paolo.carlini at oracle dot com
  2011-12-19 16:08 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-19 14:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-19 14:29:44 UTC ---
Well, rejects it a instantiation time.

Thus I guess rejecting it earlier is fine, but we don't want to misled people
by saying that 'typename T::~T' would be ok.


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-12-19 14:30 ` paolo.carlini at oracle dot com
@ 2011-12-19 16:08 ` jason at gcc dot gnu.org
  2011-12-19 17:58 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-12-19 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-12-19 15:58:13 UTC ---
(In reply to comment #3)
> Thus I guess rejecting it earlier is fine, but we don't want to misled people
> by saying that 'typename T::~T' would be ok.

Agreed.  I would expect it to be straightforward to catch this at the point we
currently give the misleading message.


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-12-19 16:08 ` jason at gcc dot gnu.org
@ 2011-12-19 17:58 ` paolo.carlini at oracle dot com
  2011-12-19 22:40 ` paolo at gcc dot gnu.org
  2011-12-19 22:58 ` paolo.carlini at oracle dot com
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-19 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-19 17:22:24 UTC ---
Ok thanks. I can do this.


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-12-19 17:58 ` paolo.carlini at oracle dot com
@ 2011-12-19 22:40 ` paolo at gcc dot gnu.org
  2011-12-19 22:58 ` paolo.carlini at oracle dot com
  8 siblings, 0 replies; 10+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-12-19 22:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-12-19 22:40:16 UTC ---
Author: paolo
Date: Mon Dec 19 22:40:11 2011
New Revision: 182508

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182508
Log:
/cp
2011-12-19  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51328
    * pt.c (convert_template_argument): Early error out and return
    error_mark_node for invalid uses of destructors as types.

/testsuite
2011-12-19  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51328
    * g++.dg/template/crash109.C: New.

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


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

* [Bug c++/51328] [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter
  2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-12-19 22:40 ` paolo at gcc dot gnu.org
@ 2011-12-19 22:58 ` paolo.carlini at oracle dot com
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-19 22:58 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|paolo.carlini at oracle dot |unassigned at gcc dot
                   |com                         |gnu.org
   Target Milestone|4.4.7                       |4.7.0

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-19 22:42:27 UTC ---
Fixed for 4.7.


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

end of thread, other threads:[~2011-12-19 22:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-27 23:54 [Bug c++/51328] New: [4.4/4.5/4.6/4.7 Regression] ICE on invalid template parameter reichelt at gcc dot gnu.org
2011-11-28  0:10 ` [Bug c++/51328] " reichelt at gcc dot gnu.org
2011-11-30 19:52 ` pinskia at gcc dot gnu.org
2011-12-06 14:23 ` rguenth at gcc dot gnu.org
2011-12-19 11:40 ` paolo.carlini at oracle dot com
2011-12-19 14:30 ` paolo.carlini at oracle dot com
2011-12-19 16:08 ` jason at gcc dot gnu.org
2011-12-19 17:58 ` paolo.carlini at oracle dot com
2011-12-19 22:40 ` paolo at gcc dot gnu.org
2011-12-19 22:58 ` paolo.carlini at oracle dot com

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