From cf63b845dfd6b9e94a690f5110e9099185fe85e4 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 9 Jan 2017 22:16:16 +0000 Subject: MSVC seems to use (void) in __FUNCSIG__ for a zero-parameter function even in C++. Follow suit. llvm-svn: 291489 --- clang/lib/AST/Expr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/AST/Expr.cpp') diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index edb218871ab..14f31d0c6b8 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -582,12 +582,13 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { if (i) POut << ", "; POut << Decl->getParamDecl(i)->getType().stream(Policy); } - if (!Context.getLangOpts().CPlusPlus && !Decl->getNumParams()) - POut << "void"; if (FT->isVariadic()) { if (FD->getNumParams()) POut << ", "; POut << "..."; + } else if ((IT == FuncSig || !Context.getLangOpts().CPlusPlus) && + !Decl->getNumParams()) { + POut << "void"; } } POut << ")"; -- cgit v1.2.3