Correctly mangle variadic functions that don't have any other parameters.

llvm-svn: 105311
This commit is contained in:
Anders Carlsson 2010-06-02 04:40:13 +00:00
parent d563923cf1
commit 728fe444f1
2 changed files with 14 additions and 1 deletions

View File

@ -1143,7 +1143,8 @@ void CXXNameMangler::mangleBareFunctionType(const FunctionType *T,
if (MangleReturnType)
mangleType(Proto->getResultType());
if (Proto->getNumArgs() == 0) {
if (Proto->getNumArgs() == 0 && !Proto->isVariadic()) {
// <builtin-type> ::= v # void
Out << 'v';
return;
}

View File

@ -477,3 +477,15 @@ namespace test10 {
// CHECK: define weak_odr void @_ZN6test101fILc3EEEvNS_1SIXquLb0ELc97ET_EEE(
template void f<(char) 3>(struct S<3>);
}
namespace test11 {
// CHECK: @_ZN6test111fEz
void f(...) { }
struct A {
void f(...);
};
// CHECK: @_ZN6test111A1fEz
void A::f(...) { }
}