This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51507] New: [C++0x] Function parameter pack doesn't use in template-argument-list
- From: "digital-ghost_tsundere at hotmail dot co.jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Dec 2011 02:28:48 +0000
- Subject: [Bug c++/51507] New: [C++0x] Function parameter pack doesn't use in template-argument-list
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51507
Bug #: 51507
Summary: [C++0x] Function parameter pack doesn't use in
template-argument-list
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: digital-ghost_tsundere@hotmail.co.jp
Following code cannot compile with gcc:
template<typename ...>
struct foo { typedef void type; };
template<typename ...Ts>
auto g(Ts ...ts)->
typename foo<decltype(ts)...>::type
{}
int main() {
g(42);
}
Error:
test1.cpp: In function 'int main()':
test1.cpp:8:9: error: expansion pattern 'int' contains no argument packs
test1.cpp:8:9: error: no matching function for call to 'g(int)'
test1.cpp:8:9: note: candidate is:
test1.cpp:4:6: note: template<class ... Ts> typename foo<decltype
(ts)...>::type g(Ts ...)
I think decltype(fs()) is a valid template-argument pattern for foo.