[LLVMbugs] [Bug 13457] New: [Windows] Explicit __cdecl function pointers are not compatible with implicit ones
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Jul 25 06:20:20 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13457
Bug #: 13457
Summary: [Windows] Explicit __cdecl function pointers are not
compatible with implicit ones
Product: clang
Version: unspecified
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: timurrrr at google.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
See also http://llvm.org/bugs/show_bug.cgi?id=13344#c5
As of r160667,
$ cat cdecl_pointer.cpp
typedef void (__cdecl * PTR)();
void foo() {}
void bar(PTR h) {}
int main() {
bar(&foo);
}
$ clang -c cdecl_pointer.cpp && echo "OK"
OK
$ clang -c -Xclang -cxx-abi -Xclang microsoft cdecl_pointer.cpp && echo "OK" ||
echo "FAIL"
cdecl_pointer.cpp:8:3: error: no matching function for call to 'bar'
bar(&foo);
^~~
cdecl_pointer.cpp:5:6: note: candidate function not viable: no known conversion
from 'void (*)()' to 'PTR' (aka 'void (*)() __attribute__((cdecl))') for 1st
argument
void bar(PTR h) {}
^
1 error generated.
FAIL
--
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.
More information about the llvm-bugs
mailing list