http://llvm.org/bugs/show_bug.cgi?id=14995
Bug #: 14995
Summary: Too eagerly rejects operator function templates
Product: clang
Version: 3.2
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Clang rejects this code:
#include <iostream>
#include <utility>
struct B {
// ...
};
template<typename ...T>
void operator++(B, T...) {
std::cout << ((sizeof...(T) == 0) ? "prefix" : "postfix") << std::endl;
}
int main() {
B b;
b++;
++b;
}
Saying
main.cpp:9:24: error: parameter of overloaded post-increment operator must have
type 'int' (not 'T...')
However a valid specialization (operator function), where the parameter type is
"int", can be generated for the template. So it appears to be wrong to me that
clang rejects it.
GCC accepts.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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