Skip to content

Commit 498015c

Browse files
devajithvsRoot Persona
authored andcommitted
Avoid resolving from system headers in SymbolResolverCallback
This will fix the failing tests - Extensions/Lookup/Simple.C - Extensions/Lookup/SimpleDynamicExprs.C That were failing with the following error: ``` In file included from ...include/cling/Interpreter/RuntimePrintValue.h:20: In file included from /usr/include/c++/13/filesystem:49: 1: /usr/include/c++/13/bits/fs_path.h:1433:30: error: called object type 'TestProxy *' is not a function or function pointer 1: { return __path_iter_distance(__first, __last); } 1: ~~~~~~~~~~~~~~~~~~~~^ ```
1 parent 0455201 commit 498015c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Interpreter/InterpreterCallbacks.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,13 @@ namespace test {
427427
return false;
428428

429429
// Only for demo resolve all unknown objects to cling::test::Tester
430+
// but skip unresolved names coming from system headers,
431+
// like __path_iter_distance from <filesystem>
432+
clang::Sema& SemaR = m_Interpreter->getSema();
433+
clang::SourceManager& SM = SemaR.getSourceManager();
434+
if (SM.isInSystemHeader(R.getNameLoc()))
435+
return false;
430436
if (!m_TesterDecl) {
431-
clang::Sema& SemaR = m_Interpreter->getSema();
432437
clang::NamespaceDecl* NSD = utils::Lookup::Namespace(&SemaR, "cling");
433438
NSD = utils::Lookup::Namespace(&SemaR, "test", NSD);
434439
m_TesterDecl = utils::Lookup::Named(&SemaR, "Tester", NSD);

0 commit comments

Comments
 (0)