Bug 31993 - [4.3 regression] ICE with template class in variadic template class
Summary: [4.3 regression] ICE with template class in variadic template class
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P1 normal
Target Milestone: 4.3.0
Assignee: dgregor
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-05-18 22:58 UTC by Volker Reichelt
Modified: 2007-10-30 13:45 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-08-06 15:32:15


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-05-18 22:58:06 UTC
The following valid code snippet with variadic templates triggers an ICE
on mainline:

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

template<template<int> class... T> struct A<T<0>...>
{
  template<int> struct B {};
  B<0> b;
};
=============================================

bug.cc:6: internal compiler error: tree check: expected tree that contains 'decl non-common' structure, have 'template_template_parm' in convert_template_argument, at cp/pt.c:4665
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2007-05-22 23:18:30 UTC
Confirmed.
Comment 2 Janis Johnson 2007-10-19 20:07:06 UTC
This isn't a regression.  The error is reported with a compiler from 20070210, the day after support for variadic templates was added.
Comment 3 dgregor 2007-10-30 13:37:00 UTC
Subject: Bug 31993

Author: dgregor
Date: Tue Oct 30 13:36:34 2007
New Revision: 129773

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129773
Log:
2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/31993
	PR c++/32252
	* pt.c (find_parameter_packs_r): Fix typo in comment.
	(convert_template_argument): Look at the pattern of a pack
	expansion to determine what kind of entity we're converting.
	(coerce_template_parameter_pack): When we have coerced a non-type
	template parameter pack, substitute into the type of that pack.
	(tsubst_pack_expansion): When our substitution of a parameter pack
	is a "trivial" substitution of itself, just substitute into the
	pack expansion rather than actually expanding.

2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/31993
	PR c++/32252
	* g++.dg/cpp0x/pr31993.C: New
	* g++.dg/cpp0x/pr32252.C: New

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr31993.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr32252.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/crash36.C

Comment 4 dgregor 2007-10-30 13:45:09 UTC
Fixed.