http://llvm.org/bugs/show_bug.cgi?id=10784
Summary: accepts invalid templated operator() call
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Clang accepts invalid then crashes in codegen on this testcase:
struct Empty {};
struct Class {
const char *method() const;
};
struct FunctionLike {
template<typename T> void operator()(const T&) const {}
};
void TestBody() {
Class cls;
FunctionLike fl;
fl(cls.method);
}
I'm not going to paste in the crash itself because it's in codegen and isn't
relevant. Sema should diagnose this. See GCC for example:
001.c: In function ‘void TestBody()’:
001.c:14: error: no match for call to ‘(FunctionLike) (<unresolved overloaded
function type>)’
001.c:8: note: candidates are: void FunctionLike::operator()(const T&) const
[with T = const char* (Class::*)()const]
--
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