diff --git a/interpreter/cling/lib/Interpreter/InterpreterCallbacks.cpp b/interpreter/cling/lib/Interpreter/InterpreterCallbacks.cpp index e17e841a3e9e4..e82aa150f1d40 100644 --- a/interpreter/cling/lib/Interpreter/InterpreterCallbacks.cpp +++ b/interpreter/cling/lib/Interpreter/InterpreterCallbacks.cpp @@ -423,8 +423,13 @@ namespace test { return false; // Only for demo resolve all unknown objects to cling::test::Tester + // but skip unresolved names coming from system headers, + // like __path_iter_distance from + clang::Sema& SemaR = m_Interpreter->getSema(); + clang::SourceManager& SM = SemaR.getSourceManager(); + if (SM.isInSystemHeader(R.getNameLoc())) + return false; if (!m_TesterDecl) { - clang::Sema& SemaR = m_Interpreter->getSema(); clang::NamespaceDecl* NSD = utils::Lookup::Namespace(&SemaR, "cling"); NSD = utils::Lookup::Namespace(&SemaR, "test", NSD); m_TesterDecl = utils::Lookup::Named(&SemaR, "Tester", NSD); diff --git a/interpreter/cling/test/Prompt/ValuePrinter/SourceLocation.C b/interpreter/cling/test/Prompt/ValuePrinter/SourceLocation.C index ba4016449be89..6f948bea949ea 100644 --- a/interpreter/cling/test/Prompt/ValuePrinter/SourceLocation.C +++ b/interpreter/cling/test/Prompt/ValuePrinter/SourceLocation.C @@ -8,22 +8,27 @@ //------------------------------------------------------------------------------ // RUN: cat %s | %cling | FileCheck %s +.rawInput 1 #include #if __cplusplus >= 202002L #include #endif -#ifndef __cpp_lib_source_location -// Hack to prevent failure if __cpp_lib_source_location feature does not exist! -std::cout << "(std::source_location) "; -std::cout << "CHECK_SRCLOC:42:std::source_location getsrcloc()\n"; -#else +#ifdef __cpp_lib_source_location #include std::source_location getsrcloc() { #line 42 "CHECK_SRCLOC" return std::source_location::current(); } -getsrcloc() +#else +// Hack to prevent failure if __cpp_lib_source_location feature does not exist! +void getsrcloc() { + std::cout << "(std::source_location) "; + std::cout << "CHECK_SRCLOC:42:std::source_location getsrcloc()\n"; +} #endif +.rawInput 0 + +getsrcloc() // CHECK: (std::source_location) // CHECK: CHECK_SRCLOC:42:std::source_location getsrcloc() diff --git a/interpreter/cling/test/Prompt/ValuePrinter/Strings.C b/interpreter/cling/test/Prompt/ValuePrinter/Strings.C index 82d57dc8f388c..47256d9f1fce5 100644 --- a/interpreter/cling/test/Prompt/ValuePrinter/Strings.C +++ b/interpreter/cling/test/Prompt/ValuePrinter/Strings.C @@ -115,9 +115,6 @@ cling::printValue(&RawData)[13] "\xed\xaf\xbf\xed\xbf\xbf" // CHECK-NEXT: (const char[7]) "\xed\xaf\xbf\xed\xbf\xbf" -std::string(u8"UTF-8") -// CHECK-NEXT: (std::string) "UTF-8" - std::u16string(u"UTF-16 " u"\x394" u"\x3a6" u"\x3a9") // CHECK-NEXT: (std::u16string) u"UTF-16 ΔΦΩ"