# Tab Autocomplete "Error importing declNameConflict"

**URL:** <https://root-forum.cern.ch/t/tab-autocomplete-error-importing-declnameconflict/56727>\
**Category:** Cling\
**Created:** [October 15, 2023, 12:05pm UTC](https://root-forum.cern.ch/t/tab-autocomplete-error-importing-declnameconflict/56727 "2023-10-15T12:05:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack.williams](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/c77e96/32.png) [@jack.williams](https://root-forum.cern.ch/u/jack.williams)\
**Post date:** [October 15, 2023, 12:05pm UTC](https://root-forum.cern.ch/t/tab-autocomplete-error-importing-declnameconflict/56727/1 "2023-10-15T12:05:34Z")

</div>

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:

```plaintext
******************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:

```plaintext
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.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 16, 2023, 3:39pm UTC](https://root-forum.cern.ch/t/tab-autocomplete-error-importing-declnameconflict/56727/2 "2023-10-16T15:39:51Z")

</div>

Welcome to the ROOT forum

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

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 30, 2023, 3:40pm UTC](https://root-forum.cern.ch/t/tab-autocomplete-error-importing-declnameconflict/56727/3 "2023-10-30T15:40:26Z")

</div>

Closed on October 30, 2023, 3:40pm UTC

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