Bug 33509 - [4.3 Regression] tsubst_pack_expansion assumed to return TREE_VEC
Summary: [4.3 Regression] tsubst_pack_expansion assumed to return TREE_VEC
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: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2007-09-20 19:11 UTC by Jakub Jelinek
Modified: 2007-12-04 20:52 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-11-23 05:50:01


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2007-09-20 19:11:29 UTC
See http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01600.html

template<int M, int N> struct pair
{
  int i, j;
  pair() : i(M), j(N) {}
};

template<int... M> struct S
{
  template<int... N> static int foo() throw (pair <M, N>...)
  {
    return 1;
  }
};

int bar ()
{
  return S<0, 1, 2>::foo<0, 1> ();
}

ICEs in tsubst_exception_specification, tsubst_pack_expansion can return
here either TREE_VEC (handled), error_mark_node (not handled and should be)
or TYPE_PACK_EXPANSION (also needs handling).

Additionally, tsubst_pack_expansion return value needs checking for
error_mark_node rather than assuming it returns TREE_VEC in regenerate_decl_from_template and tsubst_initializer_list.
Comment 1 Andrew Pinski 2007-11-23 05:50:01 UTC
The regression here is an error recovery issue.

Confirmed.
Comment 2 Andrew Pinski 2007-12-02 21:03:00 UTC
 Mark, this is really only an error recovery regression. Can you relook at the
current priority?

Thanks,
Andrew Pinski
Comment 3 dgregor 2007-12-04 20:49:22 UTC
Subject: Bug 33509

Author: dgregor
Date: Tue Dec  4 20:49:08 2007
New Revision: 130605

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130605
Log:
2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>

       PR c++/33509
       * pt.c (tsubst_exception_specification): Handle substitutions into
       member templates, where tsubst_pack_expansion returns a
       TYPE_PACK_EXPANSION.

2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>

       PR c++/33509
       * g++.dg/cpp0x/variadic-throw.C: New.

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

Comment 4 dgregor 2007-12-04 20:52:40 UTC
Fixed on mainline