Skip to content

Alias template produces seemingly bogus "template template argument has different template parameters" error #36505

Closed
@Quuxplusone

Description

@Quuxplusone
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<template class X> 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 {}'.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions