Bug 38276 - [c++0x] ICE on template specialization involving variadic templates
Summary: [c++0x] ICE on template specialization involving variadic templates
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code, monitored
: 36413 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-26 13:38 UTC by Dragan Milenkovic
Modified: 2009-01-07 20:57 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2009-01-07 00:04:20


Attachments
test case (193 bytes, text/plain)
2008-11-26 13:42 UTC, Dragan Milenkovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dragan Milenkovic 2008-11-26 13:38:35 UTC
This might be related to #35828, but I don't have time to check their sample code. But don't flame me, I have already spent some productive time and managed to strip 2000+ lines of code into only 13.

g++ -std=c++0x bug.cc

GNU C++ (GCC) version 4.4.0 20081124 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.4.0 20081124 (experimental), GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: e8678982a640502ce11e7866db86e867
bug.cc: In instantiation of ‘problem<Bar<Foo<int>, Foo<> >, Bar<Foo<int>, Foo<> > >’:
bug.cc:20:   instantiated from here
bug.cc:14: internal compiler error: in finish_member_declaration, at cp/semantics.c:2335
Comment 1 Dragan Milenkovic 2008-11-26 13:42:21 UTC
Created attachment 16776 [details]
test case
Comment 2 Andrew Pinski 2008-12-24 01:45:21 UTC
Confirmed.
Comment 3 Andrew Pinski 2008-12-28 01:44:00 UTC
*** Bug 36413 has been marked as a duplicate of this bug. ***
Comment 4 Volker Reichelt 2008-12-28 21:55:47 UTC
Even shorter testcase:

=====================================================================
template<typename...> struct A;

template<typename, typename> struct B;

template<typename... T, typename... U> struct B<A<T...>, A<U...> >
{
  static int i;
};

B<A<>, A<int> > b1;

B<A<int>, A<> > b2;
=====================================================================
Comment 5 Jason Merrill 2009-01-07 20:43:31 UTC
Subject: Bug 38276

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

Comment 6 Jason Merrill 2009-01-07 20:57:38 UTC
Fixed.