Bug 34050 - [4.3 regression] ICE derived classes and variadic templates
Summary: [4.3 regression] ICE derived classes and variadic templates
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P4 normal
Target Milestone: 4.3.0
Assignee: dgregor
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-on-invalid-code, ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-11-10 17:14 UTC by Volker Reichelt
Modified: 2008-02-15 03:10 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-01-15 16:40:16


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-11-10 17:14:57 UTC
The following code snippet triggers an ICE on mainline:

===========================================
struct A {};

template<typename... T> struct B : T...
{
  B() : T()... {}
};

B<A> b;
===========================================

bug.cc: In constructor 'B<T>::B() [with T = A]':
bug.cc:8:   instantiated from here
bug.cc:5: internal compiler error: tree check: expected tree_list, have void_type in tsubst_initializer_list, at cp/pt.c:14981
Please submit a full bug report, [etc.]

I guess, the code is invalid, but I'm not sure.
Comment 1 Steven Bosscher 2007-11-10 17:23:25 UTC
How can this be a regression? Support variadic templates did not exist in previous releases.
Comment 2 Volker Reichelt 2007-11-10 19:30:27 UTC
> How can this be a regression? Support variadic templates did not exist in
> previous releases.

The C++ frontend shouldn't crash with any input, even with line-noise.
It didn't crash with this input in previous releases, but now it crashes
(even without the "-std=gnu++0x" switch). That's a regression.
Comment 3 Andrew Pinski 2007-11-19 05:53:40 UTC
Confirmed.
Comment 4 Andrew Pinski 2007-12-02 20:54:00 UTC
Mark, this is really only an error recovery regression. Can you relook at the current priority?

Thanks,
Andrew Pinski

t1.cc:4: error: ISO C++ does not include variadic templates
t1.cc: In constructor 'B<T>::B() [with T = A]':
t1.cc:9:   instantiated from here
t1.cc:6: internal compiler error: tree check: expected tree_list, have void_type in tsubst_initializer_list, at cp/pt.c:15017
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 5 dgregor 2008-01-15 16:40:16 UTC
This is an ice-on-valid, so it should probably be a P2.
Comment 6 Andrew Pinski 2008-01-15 19:19:22 UTC
(In reply to comment #5)
> This is an ice-on-valid, so it should probably be a P2.

Well it is both depending on -std= settings.
Comment 7 Mark Mitchell 2008-01-21 02:03:16 UTC
I agree that this should be a P2.  I had misunderstood Andrew's earlier comment to mean that we always got a valid error message before the ICE.
Comment 8 Richard Biener 2008-01-30 16:58:56 UTC
The ice-on-valid is not a regression though (it only happens with -std=c++0x which is new).  P4 again.
Comment 9 andreasmeier80 2008-02-15 01:20:47 UTC
Patch at http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00520.html
Comment 10 Mark Mitchell 2008-02-15 02:59:42 UTC
This patch is OK.
Comment 11 dgregor 2008-02-15 03:10:03 UTC
Subject: Bug 34050

Author: dgregor
Date: Fri Feb 15 03:09:18 2008
New Revision: 132331

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132331
Log:
2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34050
	* pt.c (tsubst_initializer_list): Deal with the use of
	VOID_TYPE_NODE to indicate value-initialization of the bases.


2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34050
	* g++.dg/cpp0x/vt-34050.C: New.

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

Comment 12 dgregor 2008-02-15 03:10:27 UTC
Thanks, Mark! Fixed on mainline.