Bug 38646 - [4.3/4.4 regression] ICE with invalid specialization of variadic template
Summary: [4.3/4.4 regression] ICE with invalid specialization of variadic template
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P4 minor
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-checking, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2008-12-27 23:12 UTC by Volker Reichelt
Modified: 2011-06-23 18:02 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail:
Last reconfirmed: 2009-11-15 21:38:45


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-12-27 23:12:52 UTC
The following invalid code snippet triggers an ICE since GCC 4.3.0:

=============================================
template<int...> struct A;

template<int... N> struct A<N..., N...>
{
  template<typename> struct B;

  template<typename T> struct B<T*> {};
};
=============================================

bug.cc:3: error: parameter pack argument 'N ...' must be at the end of the template argument list
bug.cc:7: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in template_class_depth, at cp/pt.c:314
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2008-12-27 23:36:15 UTC
Confirmed, only ICEs with checking turned on.
Comment 2 Richard Biener 2009-01-24 10:21:07 UTC
GCC 4.3.3 is being released, adjusting target milestone.
Comment 3 Paolo Carlini 2009-01-26 18:20:47 UTC
I'm having a look into this one...
Comment 4 Richard Biener 2009-08-04 12:29:42 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 5 Paolo Carlini 2009-08-04 16:35:51 UTC
This one doesn't reproduce anymore in mainline.
Comment 6 Paolo Carlini 2009-08-04 16:50:19 UTC
Never mind, tried with a non-checking GCC...
Comment 7 Simon Martin 2009-11-15 21:38:45 UTC
Patch submitted here:
  http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00747.html
Comment 8 Simon Martin 2009-11-20 21:37:36 UTC
Subject: Bug 38646

Author: simartin
Date: Fri Nov 20 21:37:23 2009
New Revision: 154378

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154378
Log:
gcc/cp/

2009-11-20  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/38646
	* pt.c (process_partial_specialization): Do not turn wrongly located
	parameter pack arguments into error_mark_node.
	Split too long lines into two.

gcc/testsuite/

2009-11-20  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/38646
	* g++.dg/cpp0x/pr38646.C: New test.

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

Comment 9 Simon Martin 2009-11-20 21:46:04 UTC
Fixed in 4.5
Comment 10 Richard Biener 2010-05-22 18:13:02 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 11 Paolo Carlini 2011-06-09 16:14:50 UTC
Likewise, close as fixed in 4.5+?
Comment 12 Paolo Carlini 2011-06-23 18:02:21 UTC
Fixed in 4.5.0.