diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index 50965d7156..00e71679c5 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -433,9 +433,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/test/Driver/Gnu.C b/test/Driver/Gnu.C index 47c0c084a2..fc2f73b463 100644 --- a/test/Driver/Gnu.C +++ b/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 -// REQUIRES: not_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 VSudio C++ headers in C++11 #ifdef __cplusplus extern "C" int printf(const char*, ...);