On Mon, Feb 4, 2019 at 11:00 AM Paolo Carlini <paolo.carl...@oracle.com> wrote:
> On 04/02/19 15:47, Jason Merrill wrote:
> > On 2/1/19 3:52 PM, Paolo Carlini wrote:
> >> Hi,
> >>
> >> I think that this ICE on invalid (and valid, for c++17+) can be in
> >> fact avoided by accepting in make_typename_type a TYPE_PACK_EXPANSION
> >> as context, thus by not triggering the "‘T ...’ is not a class"
> >> error. Not sure if a better fix would be something more general.
> >> Note, anyway, that we are asserting TYPE_P (context) thus
> >> TYPE_PACK_EXPANSIONs definitely get through beyond MAYBE_CLASS_TYPE_P.
> > The testcase should test that the using actually works, i.e. imports a
> > type from a base class.
>
> Uhm, if I change the testcase to something like:
>
> struct B { typedef int type; };
>
> template<typename ...T> struct C : T... {
>    using typename T::type ...;
>    void f() { type value; }
> };
>
> template class C<B>;
>
> we get a "sorry, unimplemented: use of ‘type_pack_expansion’ in
> template" for value

I suspected that would happen.

> which, arguably, is better than the current ICE,
> but I'm not sure if we are close to completing the implementation of
> this / we even want to attempt that at this Stage?!?

Well, I'd look at how we implement the equivalent for e.g. a variable:

struct A { static int i; };
template <class ...T> struct B: T... {
  using T::i ...;
};
auto x = B<A>::i; // works

and try to use that code path for the typename case as well.

Jason

Reply via email to