Bug 34102 - [4.3 regression] ICE with invalid inheritance of variadic templates
Summary: [4.3 regression] ICE with invalid inheritance of variadic templates
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.3.0
Assignee: dgregor
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-11-15 07:51 UTC by Volker Reichelt
Modified: 2008-01-15 18:09 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-12-20 21:03:21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-11-15 07:51:07 UTC
The following invalid testcase triggers an ICE on mainline:

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

template<typename> struct B : virtual A {};

template<typename...T> struct C : B<T> {};
============================================================

bug.cc:5: error: parameter packs not expanded with `...':
bug.cc:5: note:         'T'
bug.cc: In instantiation of 'B<<expression error> >':
bug.cc:5:   instantiated from here
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

The bug appeared between 2007-11-03 and 2007-11-06.
Comment 1 Andrew Pinski 2007-11-19 03:45:45 UTC
Confirmed.
Comment 2 Andrew Pinski 2007-12-02 21:04:04 UTC
 Mark, this is really only an error recovery regression. Can you relook at the
current priority?

Thanks,
Andrew Pinski
Comment 3 dgregor 2008-01-15 16:59:19 UTC
Patch here: http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00650.html
Comment 4 dgregor 2008-01-15 18:08:50 UTC
Subject: Bug 34102

Author: dgregor
Date: Tue Jan 15 18:08:00 2008
New Revision: 131547

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

	PR c++/34051
	PR c++/34055
	PR c++/34102
	PR c++/34103
	* typeck.c (check_return_expr): If there are bare parameter packs
	in the return value, set it to error_mark_node.
	* tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
	* pt.c (find_parameter_packs_r): Look at the type of
	IDENTIFIER_NODEs (e.g., for user-defined conversions).
	(check_for_bare_parameter_packs): Flip the result: now returns
	TRUE when there were bare parameter packs, FALSE otherwise.
	(push_template_decl_real): Deal with flipped result of
	check_for_bare_parameter_packs.
	* semantics.c (finish_cond): If there are bare parameter packs in
	the conditional, set it to error_mark_node.
	(finish_expr_stmt): If there are bare parameter packs in the
	expression, set it to error_mark_node.
	(finish_for_expr): Ditto.
	(finish_switch_cond): If there are bare parameter packs in
	the conditional, set it to error_mark_node.
	(finish_mem_initializers): If there are bare parameter packs in
	the member initializer, set it to error_mark_node.
	(finish_member_declaration): Check the attributes of the
	declaration for bare parameter packs, and remove the attributes if
	any have bare parameter packs.
	* parser.c (cp_parser_using_declaration): Check the using
	declaration for bare parameter packs.
	(cp_parser_base_clause): If there are bare parameter packs in a
	base specifier, don't add it to the chain.

2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34051
	PR c++/34055
	PR c++/34102
	PR c++/34103
	* g++.dg/cpp0x/vt-34051-2.C: New.
	* g++.dg/cpp0x/vt-34102.C: New.
	* g++.dg/cpp0x/vt-34051.C: New.
	* g++.dg/cpp0x/vt-34055.C: New.
	* g++.dg/cpp0x/vt-34103.C: New.


Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-34051-2.C
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-34051.C
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-34055.C
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-34102.C
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-34103.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 dgregor 2008-01-15 18:09:20 UTC
Fixed in mainline