https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59498
--- Comment #8 from Louis Dionne <ldionne.2 at gmail dot com> ---
I made further experiments to try and workaround this (I need it badly!) and
I found some things that might be of interest to you. The following test case
compiles on GCC 4.9.1 but not on Clang 3.5.0 (trunk):
template <template <typename ...> class f>
struct make {
template <typename ...x>
static constexpr auto apply(x...)
-> decltype(f<x...>{}) // <- compiles on both when this is
commented
{
return f<x...>{};
}
};
template <typename> struct f { }; // <- fails on GCC when this is variadic
template <typename x> using alias = f<x>;
int main() {
make<alias>::apply(1);
}
Now, if I change the definition of f to:
template <typename...> struct f { };
then it fails to compile on both compilers. Finally, if I remove the
decltype(f<x...>{}) part of the apply function above, then it compiles
on both compilers regardless of f's definition.