diff --git a/interpreter/cling/lib/Interpreter/Interpreter.cpp b/interpreter/cling/lib/Interpreter/Interpreter.cpp index 6af9010850654..221cc4e207f06 100644 --- a/interpreter/cling/lib/Interpreter/Interpreter.cpp +++ b/interpreter/cling/lib/Interpreter/Interpreter.cpp @@ -507,9 +507,12 @@ namespace cling { #else const char* Spec = "__clrcall"; #endif + const bool ParamNames = LangOpts.C99; Strm << Linkage << " " << Spec << " int (*__dllonexit(" - << "int (" << Spec << " *f)(void**, void**), void**, void**))" - "(void**, void**)"; + << "int (" << Spec << " *f)(void**, void**)," + << "void**" << (ParamNames ? " a" : "") << "," + << "void**" << (ParamNames ? " b" : "") + << "))(void**, void**)"; if (EmitDefinitions) Strm << " { __cxa_atexit((void(*)(void*))f, 0, __dso_handle);" " return f; }\n"; diff --git a/interpreter/cling/test/Driver/Gnu.C b/interpreter/cling/test/Driver/Gnu.C index 28ff19a15c15f..62f20b9700f8a 100644 --- a/interpreter/cling/test/Driver/Gnu.C +++ b/interpreter/cling/test/Driver/Gnu.C @@ -7,10 +7,11 @@ //------------------------------------------------------------------------------ // RUN: cat %s | %cling -std=gnu99 -x c -Xclang -verify 2>&1 | FileCheck %s -// RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++14 -Xclang -verify 2>&1 | FileCheck %s // RUN: cat %s | %cling -D__STRICT_ANSI__ -std=gnu++1z -Xclang -verify 2>&1 | FileCheck %s -// UNSUPPORTED: system-windows + +// RUN: cat %s | %cling --noruntime -D__STRICT_ANSI__ -std=gnu++11 -Xclang -verify 2>&1 | FileCheck %s +// --noruntime is for Windows which cannot include VStudio C++ headers in C++11 #ifdef __cplusplus extern "C" int printf(const char*, ...);