https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62274
Bug ID: 62274
Summary: [C++11] Variadic templates expansion into non-variadic
class template
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: juchem at gmail dot com
The code below won't compile for gcc 4.9.0, 4.8.1 and 4.7.3. Tested in Debian
sid (aug/2014), http://gcc.godbolt.org/ and http://ideone.com.
#include <type_traits>
using namespace std;
struct bar { typedef double foo; };
template <typename T>
using get_foo = typename T::foo;
template <template <typename...> class T>
struct baz {
template <typename... UArgs>
using type = T<UArgs...>;
};
int main() {
return !std::is_same<double, baz<get_foo>::type<bar>>::value;
}
error output:
prog.cpp: In substitution of ‘template<class T> using get_foo = typename T::foo
[with T = UArgs ...]’:
prog.cpp:13:26: required from ‘struct baz<get_foo>’
prog.cpp:17:49: required from here
prog.cpp:8:32: error: ‘UArgs ...’ is not a class, struct, or union type
using get_foo = typename T::foo;
^
prog.cpp: In function ‘int main()’:
prog.cpp:17:59: error: template argument 2 is invalid
static_assert(std::is_same<double, baz<get_foo>::type<bar>>::value,
"mismatch");