No #include <new> in C mode; add basic C mode test (ROOT-7090).
This commit is contained in:
parent
69234ce153
commit
e582b93a16
@ -235,11 +235,14 @@ namespace cling {
|
||||
if (External)
|
||||
External->StartTranslationUnit(m_Consumer);
|
||||
|
||||
// <new> is needed by the ValuePrinter so it's a good thing to include it.
|
||||
// We need to include it to determine the version number of the standard
|
||||
// library implementation.
|
||||
ParseInternal("#include <new>");
|
||||
CheckABICompatibility(m_CI.get());
|
||||
if (m_CI->getLangOpts().CPlusPlus) {
|
||||
// <new> is needed by the ValuePrinter so it's a good thing to include it.
|
||||
// We need to include it to determine the version number of the standard
|
||||
// library implementation.
|
||||
ParseInternal("#include <new>");
|
||||
// That's really C++ ABI compatibility. C has other problems ;-)
|
||||
CheckABICompatibility(m_CI.get());
|
||||
}
|
||||
|
||||
// DO NOT commit the transactions here: static initialization in these
|
||||
// transactions requires gCling through local_cxa_atexit(), but that has not
|
||||
|
16
test/Driver/C.c
Normal file
16
test/Driver/C.c
Normal file
@ -0,0 +1,16 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// CLING - the C++ LLVM-based InterpreterG :)
|
||||
//
|
||||
// This file is dual-licensed: you can choose to license it under the University
|
||||
// of Illinois Open Source License or the GNU Lesser General Public License. See
|
||||
// LICENSE.TXT for details.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// RUN: cat %s | %cling -x c | FileCheck %s
|
||||
|
||||
// Validate cling C mode.
|
||||
|
||||
int printf(const char*,...);
|
||||
printf("CHECK 123\n"); // CHECK: CHECK 123
|
||||
|
||||
// fix value printing!
|
Loading…
x
Reference in New Issue
Block a user