Alias template produces seemingly bogus "template template argument has different template parameters" error (original) (raw)

Bugzilla Link 37157
Version trunk
OS All
CC @DougGregor

Extended Description

I (and also GCC 7.0-and-later) claim that this program is legal C++.

template<template<class> class X> struct A {};
template<template<class...> class Y> using B = A<Y>;
template<class> struct S;
B<S> b;

Clang, on the other hand, bails out at line 2:

prog.cc:2:50: error: template template argument has different template parameters than its corresponding template template parameter
template<template<class...> class Y> using B = A;
^
prog.cc:2:19: note: template type parameter pack does not match template type parameter in template argument
template<template<class...> class Y> using B = A;
^
prog.cc:1:19: note: previous template type parameter declared here
template struct A {};
^

Clang becomes happy if I change it from 'using B = A' to 'struct B {}', and then sad again if I change it to 'struct B : A {}'.