Function types without prototypes can arise when mangling a function type
within an overloadable function in C. We mangle these as the absence of
any parameter types (not even an empty parameter list).
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/AST/ItaniumMangle.cpp | ||
---|---|---|
2060–2062 | This seems like a suboptimal mangling; a no-prototype function type is not compatible with a varargs function type, and in particular may have a different calling convention across a C/C++ ABI boundary. How about instead mangling this as the absence of any parameter types? (That is, drop the z, and mangle your testcase below as just _Z1fPFvzE.) libc++abi already demangles that as desired (but libstdc++ considers it an invalid mangled name). |
lib/AST/ItaniumMangle.cpp | ||
---|---|---|
2060–2062 | Do you mean _Z1fPFvE? Sounds reasonable to me. I guess on the MS side we can use @ instead of Z to create the distinction there. |
lib/AST/ItaniumMangle.cpp | ||
---|---|---|
2060–2062 | Er, yes, thanks :) |
This seems like a suboptimal mangling; a no-prototype function type is not compatible with a varargs function type, and in particular may have a different calling convention across a C/C++ ABI boundary. How about instead mangling this as the absence of any parameter types? (That is, drop the z, and mangle your testcase below as just _Z1fPFvzE.) libc++abi already demangles that as desired (but libstdc++ considers it an invalid mangled name).