Tab Autocomplete "Error importing declNameConflict"

Tab autocomplete for methods (eg: std::vector.push_back) works until our code is loaded into the interpreter (about 10,000 lines). The problem appears more consistently with objects returned by functions:

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ #include <vector>
[cling]$ std::vector<double> vec;
[cling]$ 
[cling]$ std::vector<double> vector_return() {
[cling]$ ?       return {0, 1, 2, 3};
[cling]$ ?   }
[cling]$
[cling]$  // Autocomplete works here
[cling]$ vec.push_b
[#void#]push_back(<#const double &__x#>)
[#void#]__cxx1998::vector<double>::push_back(<#const value_type &__x#>)
[#void#]__cxx1998::vector<double>::push_back(<#value_type &&__x#>)
[cling]$ 
[cling]$ auto vec_returned = vector_return();
[cling]$
[cling]$  // Autocomplete works here
[cling]$ vec_returned.push_b
[#void#]push_back(<#const double &__x#>)
[#void#]__cxx1998::vector<double>::push_back(<#const value_type &__x#>)
[#void#]__cxx1998::vector<double>::push_back(<#value_type &&__x#>)
[cling]$
[cling]$ .L <large_codebase>.cpp
[cling]$
[cling]$  // Autocomplete works, but with error, not as many results returned
[cling]$ vec.push_bError importing declNameConflict 
[#void#]push_back(<#const double &__x#>)
[#void#]__cxx1998::vector<double>::push_back(<#const value_type &__x#>)
[cling]$ 
[cling]$  // Autocomplete doesn't work at all
[cling]$ vec_returned.push_bError importing declNameConflict

I’m asking in the hope that this is an easy fix, but I understand the project is in flux at the moment.

Thanks for all your hard work! Amazing tool.

I’ve compiled cling as it currently exists in git, using the forked LLVM project version:

mkdir cling
cd cling
git clone -b cling-llvm13 https://github.com/root-project/llvm-project.git src
git clone https://github.com/root-project/cling.git
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TOOLS=Off -DLLVM_EXTERNAL_PROJECTS=cling -DLLVM_EXTERNAL_CLING_SOURCE_DIR=../cling -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD="host;NVPTX" ../src/llvm
cmake --build .
sudo cmake --build . --target install

Happy to provide whatever further debugging information might be useful. Although my computer ran out of memory when I tried to compile LLVM in Debug.

Welcome to the ROOT forum

It looks like a Cling issue, may be @vvassilev can help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.