This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59416] New: A nested template reusing the template arguments of the enclosing type in a template template argument not working
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Dec 2013 12:05:29 +0000
- Subject: [Bug c++/59416] New: A nested template reusing the template arguments of the enclosing type in a template template argument not working
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59416
Bug ID: 59416
Summary: A nested template reusing the template arguments of
the enclosing type in a template template argument not
working
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ville.voutilainen at gmail dot com
Test:
template<int,int> struct Obj;
template<typename... Ts> struct A {
template<template<Ts...> class> struct B { };
};
int main()
{
A<int,int>::B<Obj> x{ };
}
edoceo3.cpp:8:20: error: type/value mismatch at argument 1 in template
parameter list for âtemplate<class ... Ts> template<template<template<Ts
...<anonymous> > class<template-parameter-2-1> > template<class ... Ts>
template<Ts ...<anonymous> > class<template-parameter-2-1> > struct A<Ts>::Bâ
A<int,int>::B<Obj> x{ };
^
edoceo3.cpp:8:20: error: expected a template of type âtemplate<class ... Ts>
template<Ts ...<anonymous> > class<template-parameter-2-1>â, got âtemplate<int
<anonymous>, int <anonymous> > struct Objâ
edoceo3.cpp:8:23: error: invalid type in declaration before â{â token
A<int,int>::B<Obj> x{ };
clang compiles this code. It certainly looks valid to me, since in the
attempted instantiation, A's template arguments are 'int,int', and then
the template argument for A::B should be 'template <int, int> class',
and Obj is such a template.