Bug 35784 - [C++0x] Bogus inaccessibility error on variadic partial template specialization.
Summary: [C++0x] Bogus inaccessibility error on variadic partial template specialization.
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: rejects-valid
Depends on:
Blocks:
 
Reported: 2008-04-01 01:49 UTC by Eelis
Modified: 2009-01-07 20:56 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-01-07 00:06:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eelis 2008-04-01 01:49:51 UTC
Consider:

  template <typename...> struct p;

  template <typename, typename> struct d;

  template <typename... A, typename... B>
  struct d<p<A...>, p<B...> > { typedef int t; };

  typedef d<p<>, p<int, float> >::t q;
  typedef d<q, d<p<int>, p<float> >::t> r; // *

  typedef d<d<p<>, p<int, float> >::t, d<p<>, p<> >::t> s;
    // error: ‘typedef int d<p<int>, p<float> >::t’ is inaccessible within this context

The error makes no sense. In fact, it disappears if the unrelated line marked with an asterisk is removed.
Comment 1 Andrew Pinski 2008-12-29 03:38:16 UTC
Confirmed.
Comment 2 Jason Merrill 2009-01-07 20:43:31 UTC
Subject: Bug 35784

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 3 Jason Merrill 2009-01-07 20:56:56 UTC
Fixed.