-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Failure to match alias template against template template parameter #65843
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@llvm/issue-subscribers-c-1 |
@llvm/issue-subscribers-clang-frontend |
gcc is the only implementation that accepts it: https://godbolt.org/z/v9Trvovza Can you explain why you expect this to be valid? |
I think this is CWG 1286. It looks like we haven't got a resolution in yet, but the intent seems clear that it should be accepted. |
Stumbled upon the same issue today. For anyone looking for a workaround, this is one of the ways that worked for me (assuming that Q does not have weird specializations, testing only for one, #include <type_traits>
template<template<class T> class> struct A {};
template<class T> struct Q {};
template<class T> using R = Q<T>;
template<template<class> class U>
int f(A<U>)
{
static_assert(std::is_same_v<U<char>,R<char>>);
return 42;
}
int g(A<Q> a) { return f(a); } or a series of |
GCC accepts (since 4.9.0), Clang rejects with:
-frelaxed-template-template-args
doesn't seem to help in any recent major.The text was updated successfully, but these errors were encountered: