https://llvm.org/bugs/show_bug.cgi?id=24098
Bug ID: 24098
Summary: Wrong number of template arguments with empty
parameter pack
Product: clang
Version: trunk
Hardware: Macintosh
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
The following code fails to compile on Clang trunk:
template <typename> struct f;
template <typename ...Dummy, typename = f<int, Dummy...>>
void foo() { }
The error is:
prog.cc:3:53: error: wrong number of template arguments (2, should be 1)
template <typename ...Dummy, typename = f<int, Dummy...>>
^
prog.cc:1:28: note: provided for 'template<class> struct f'
template <typename> struct f;
^
Strangely, the following compiles (swapped `Dummy...` and `int`):
template <typename> struct f;
template <typename ...Dummy, typename = f<Dummy..., int>>
void foo() { }
Live example: http://melpon.org/wandbox/permlink/yrtJAhiue1iDVLR3
Note that GCC rejects both examples. Naively, I think both should compile,
but I haven't checked the standard. In all cases, either Clang has a bug,
GCC has a bug or both have a bug.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs