https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96719

            Bug ID: 96719
           Summary: non-standard handling of alias templates used as
                    template template arguments
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk
  Target Milestone: ---

template<typename T, typename U = T> struct A { using type = U; };
template<typename V, typename W = float> using B = A<V, W>;
template<template<typename...> class Z> struct Q {
  using type = typename Z<int>::type;
};

Here, Q<B>::type should be float, but GCC believes it's int.

I think this is due to GCC implementing the (non-standard at this time) rule in
CWG1286. This is also reflected in incorrect manglings:

void f(Q<B>) {}

... is mangled as if it were written as `f(Q<A>)`, and other rejects-valids,
such as for:

void f(Q<A>) {}
void f(Q<B>) {}

Reply via email to