The following code compiled successfully with clang, but gcc does not work:
struct fn { template <typename ... Args> static constexpr bool call (Args ... ) { return true; } }; template <typename ... T> static constexpr bool f = false; template <typename ... Ts, bool F = fn::call(f<Ts> ...)> void hoge () {} int main () {}
gcc 5.1.0 (-Wall -Wextra -std = C ++ 14 -pedantic) says
prog.cc:10:52: error: expansion pattern 'f<Ts>' contains no argument packs template <typename ... Ts, bool F = fn::call(f<Ts> ...)>
clang 3.6.0 and 3.5.0 gives no errors.
Am I and clang breaking C ++ rules or is this a gcc bug?
source share