Summary: | [4.3/4.4 regression] ICE with variadic templates partial specialization | ||
---|---|---|---|
Product: | gcc | Reporter: | Tristan Wibberley <tristan.wibberley> |
Component: | c++ | Assignee: | Jason Merrill <jason> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dgregor, fang, gcc-bugs, reichelt, tristan.wibberley |
Priority: | P3 | Keywords: | ice-checking, ice-on-valid-code, monitored |
Version: | 4.4.0 | ||
Target Milestone: | 4.3.3 | ||
Host: | x86_64-unknown-linux-gnu | Target: | x86_64-unknown-linux-gnu |
Build: | x86_64-unknown-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2009-01-06 16:13:55 | |
Attachments: | ice when NO_ICE is not defined |
Description
Tristan Wibberley
2008-07-16 00:49:04 UTC
> fail.cc: In instantiation of ‘pairs<pair<int, int>, pair<int, int> >’:
> fail.cc:14: instantiated from here
> fail.cc:10: error: mismatched argument pack lengths while expanding ‘pair<AS,
> BS>’
> fail.cc: In instantiation of ‘pairs<pair<int, int>, pair<int, int>
> >::mismatched_packs’:
> fail.cc:14: instantiated from here
> fail.cc:10: internal compiler error: tree check: expected class ‘type’, have
> ‘exceptional’ (error_mark) in instantiate_class_template, at cp/pt.c:6945
4.3.1 doesn't ICE (I can't get details as somebody was kind enough to try this for me) and instead reports:
t.cpp:10: error: mismatched argument pack lengths while expanding ‘pair<AS, BS>‘
t.cpp:10: error: mismatched argument pack lengths while expanding ‘pair<AS, BS>‘
where the ICE is reported above
with -DNO_ICE this is compiled successfully
Created attachment 16124 [details]
ice when NO_ICE is not defined
This is the same source as in my original report but as an attachment.
Ping since this is a regression and has not yet been triaged. I'm not sure whether the code snippet is really valid or not, but I can confirm the ICE nevertheless. GCC 4.3.x already crashed, you probably need --enable-checking to see the ICE. It's a regression, because the compiler crashes even without the -std=gnu++0x switch. valid or not? If so then it's a rejects-valid, otherwise it is error-recovery. Subject: Re: [4.3/4.4 regression] ICE with variadic
templates partial specialization
On Sat, 2009-01-03 at 15:26 +0000, rguenth at gcc dot gnu dot org wrote:
>
> ------- Comment #5 from rguenth at gcc dot gnu dot org 2009-01-03 15:26 -------
> valid or not? If so then it's a rejects-valid, otherwise it is error-recovery.
I had discussed these c++0x features in ##c++ and I came to the
conclusion that it was valid code. But I'm not an expert in c++0x, I
discovered this problem while experimenting when learning.
It accepts the code without the nested struct, it is only with a nested
struct that the code is rejected. I don't think a nested struct will
make it invalid and the behaviour of ambiguity analysis with a larger
example suggests the code is very carefully and consciously accepted
without that struct - agreeing with my studies and conversations on IRC.
Subject: Bug 36846 Author: jason Date: Wed Jan 7 20:43:01 2009 New Revision: 143166 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143166 Log: PR c++/35297 PR c++/35477 PR c++/35784 PR c++/36846 PR c++/38276 * pt.c (check_default_tmpl_args): Don't complain about out-of-order parameter packs in the enclosing class or parameter packs after default args. (coerce_template_parms): If we have more than one parameter pack, don't flatten argument packs. (template_args_equal): Handle argument packs. (comp_template_args): Don't flatten argument packs. (check_instantiated_arg): Split out from... (check_instantiated_args): Here. Handle arg packs. (convert_template_argument): Just check that nontype argument packs have the right type. Added: trunk/gcc/testsuite/g++.dg/cpp0x/variadic92.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic93.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/variadic65.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic82.C trunk/gcc/testsuite/g++.dg/cpp0x/variadic83.C Fixed. |