Bug 33965 - internal compiler error: tree check: expected class 'type', have 'constant' (integer_cst) in cp_type_quals, at cp/typeck.c:6955 (vararg templates)
Summary: internal compiler error: tree check: expected class 'type', have 'constant' (...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: dgregor
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2007-10-31 21:36 UTC by Eric Niebler
Modified: 2007-12-18 22:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-11-05 17:03:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Niebler 2007-10-31 21:36:13 UTC
In the following SFINAE scenario involving vararg templates an non-type template parameters, the compiler ICEs instead of ignoring the specialization.

Latest SVN g++ with patches from Doug Gregor for vararg templates.

template<typename T>
struct foo
{
    static bool const value = false;
};

template<template<typename...> class T, typename... Args>
struct foo<T<Args...> >
{
    static bool const value = false;
};

template<int I>
struct int_
{};

int main()
{
    foo<int_<0> > f; // ICE
}
Comment 1 Andrew Pinski 2007-11-19 04:42:23 UTC
I get this now:
t.cc:21: error: cannot expand 'Args ...' into a fixed-length argument list
Comment 2 dgregor 2007-12-18 21:19:58 UTC
Subject: Bug 33965

Author: dgregor
Date: Tue Dec 18 21:19:41 2007
New Revision: 131041

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131041
Log:
2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
            Jakub Jelinek  <jakub@redhat.com>
	
	PR c++/32565
	PR c++/33943
	PR c++/33965
	* pt.c (template_template_parm_bindings_ok_p): New; verifies
	bindings of template template parameters after all template
	arguments have been deduced.
	(coerce_template_parms): Don't complain when COMPLAIN doesn't
	include tf_error.
	(fn_type_unification): Use template_template_parm_bindings_ok_p. 
	(unify): Deal with variadic, bound template template parameters. 
	(get_class_bindings): Use template_template_parm_bindings_ok_p. 	
	
2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
	    Jakub Jelinek  <jakub@redhat.com>
	
	PR c++/32565
	PR c++/33943
	PR c++/33965
	* g++.dg/cpp0x/variadic86.C: New.
	* g++.dg/cpp0x/variadic87.C: New.
	* g++.dg/cpp0x/variadic84.C: New.
	* g++.dg/cpp0x/variadic85.C: New.
	* g++.dg/template/ttp25.C: New.
	
	

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic84.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic85.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic86.C
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic87.C
    trunk/gcc/testsuite/g++.dg/template/ttp25.C
Modified:
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 dgregor 2007-12-18 22:16:19 UTC
Fixed on the trunk