Skip to content

Failure to match alias template against template template parameter #65843

Open
@ecatmur

Description

@ecatmur
template<template<class T> class> struct A {};
template<class T> struct Q {};
template<class T> using R = Q<T>;
int f(A<R>);
int g(A<Q> a) { return f(a); }

GCC accepts (since 4.9.0), Clang rejects with:

<source>:5:24: error: no matching function for call to 'f'
int g(A<Q> a) { return f(a); }
                       ^
<source>:4:5: note: candidate function not viable: no known conversion from 'A<template Q>' to 'A<template R>' for 1st argument
int f(A<R>);
    ^

-frelaxed-template-template-args doesn't seem to help in any recent major.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions