diff options
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5bb39cbf147..6916710036c 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8252,6 +8252,12 @@ void Sema::CheckMain(FunctionDecl* FD, const DeclSpec& DS) { bool HasExtraParameters = (nparams > 3); + if (FTP->isVariadic()) { + Diag(FD->getLocation(), diag::ext_variadic_main); + // FIXME: if we had information about the location of the ellipsis, we + // could add a FixIt hint to remove it as a parameter. + } + // Darwin passes an undocumented fourth argument of type char**. If // other platforms start sprouting these, the logic below will start // getting shifty. |