Bug 36411 - [4.4 regression] ICE with invalid template template parameter
Summary: [4.4 regression] ICE with invalid template template parameter
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P5 normal
Target Milestone: 4.4.0
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2008-06-01 11:13 UTC by Volker Reichelt
Modified: 2009-02-23 22:35 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-12-28 01:44:47


Attachments
A patch (242 bytes, patch)
2009-02-22 23:59 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-06-01 11:13:35 UTC
The following invalid code snippet triggers an ICE on mainline:

==================================================
template<template<void> class> struct A
{
  template<template<int> class T> A<T> foo();
};
==================================================

bug.cc:1: error: 'void' is not a valid type for a template constant parameter
bug.cc:3: internal compiler error: in coerce_template_template_parms, at cp/pt.c:4749
Please submit a full bug report, [etc.]
Comment 1 Volker Reichelt 2008-06-01 12:27:44 UTC
Testing a patch.
Comment 2 H.J. Lu 2009-02-22 23:59:24 UTC
Created attachment 17344 [details]
A patch
Comment 3 H.J. Lu 2009-02-23 17:43:08 UTC
Oops. A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00575.html
Comment 4 hjl@gcc.gnu.org 2009-02-23 22:35:08 UTC
Subject: Bug 36411

Author: hjl
Date: Mon Feb 23 22:34:50 2009
New Revision: 144396

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

2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/36411
	* pt.c (coerce_template_template_parms): Return 0 if parameter
	is error_mark_node.

gcc/testsuite/

2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/36411
	* g++.dg/template/void14.C: New.

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

Comment 5 H.J. Lu 2009-02-23 22:35:57 UTC
Fixed.