I decided to remove the previous installation and do everything from the command line (assuming previous Vundle installation as recommended in YouCompleteMe docs).
# typical installation directory for vundle and pathogen
cd ~/.vim/bundle
# clone the repository for YouCompleteMe
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
# and all submodules
git submodule update --init --recursive
# install
python3 install.py --clang-completer
Next I created a simple ycm_extra_conf.py (without the .dot) containing:
def FlagsForFile ( filename, **kwargs ):
return {
'flags': ['-x', '-Wall', '-Wextra', '-Werror', '-std=c++2a']
}
I added the c++2a flag, but c++17 should also work.
Then point to this file in your ~/.vimrc file.
let g:ycm_global_ycm_extra_conf = '$HOME/.vim/bundle/YouCompleteMe/ycm_extra_conf.py'
Note: you may have to add to your ~/.vimrc
Plugin 'Valloric/YouCompleteMe'
in your vimrc file.
And run (from vim)
:PluginInstall
I didn't do these steps as I had installed YouCompleteMe previously.
This seems to have fixed the problem for me. Hope this can be useful for someone.