diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-09 22:16:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-09 22:16:16 +0000 |
commit | cf63b845dfd6b9e94a690f5110e9099185fe85e4 (patch) | |
tree | a9a9ec5488327964144dba2eb61eb17baa785b89 /clang/lib | |
parent | fa328947302724f3e3b6af4836c0a153c60aa5a8 (diff) | |
download | bcm5719-llvm-cf63b845dfd6b9e94a690f5110e9099185fe85e4.tar.gz bcm5719-llvm-cf63b845dfd6b9e94a690f5110e9099185fe85e4.zip |
MSVC seems to use (void) in __FUNCSIG__ for a zero-parameter function even in C++. Follow suit.
llvm-svn: 291489
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 << ")"; |