admin管理员组

文章数量:1356815

Error image

The error code

#include <concepts>
#include <iostream>

using namespace std;

template <std::integral T>
void print(T i)
{
    std::cout << "Integral: " << i << '\n';
}

int main()
{
  print (1);
}

I use Vundle to install vim plugin, here is some related setting.

Plugin 'ycm-core/YouCompleteMe'
let g:ycm_clangd_binary_path = '/usr/bin/clangd'
let g:ycm_global_ycm_extra_conf = '/home/hlajungo/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'

Error image

The error code

#include <concepts>
#include <iostream>

using namespace std;

template <std::integral T>
void print(T i)
{
    std::cout << "Integral: " << i << '\n';
}

int main()
{
  print (1);
}

I use Vundle to install vim plugin, here is some related setting.

Plugin 'ycm-core/YouCompleteMe'
let g:ycm_clangd_binary_path = '/usr/bin/clangd'
let g:ycm_global_ycm_extra_conf = '/home/hlajungo/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'
Share Improve this question edited Mar 29 at 19:17 趴蒽翔 asked Mar 27 at 19:48 趴蒽翔趴蒽翔 273 bronze badges 3
  • Use the plugin's support channels. – romainl Commented Mar 27 at 22:00
  • stackoverflow/help/minimal-reproducible-example – svlasov Commented Mar 28 at 12:44
  • I remove the prim example, and add the minimal example, and in some further more searching in youcompleteme github, the problem solving is simple. – 趴蒽翔 Commented Mar 29 at 18:58
Add a comment  | 

1 Answer 1

Reset to default 1

Setting a file at ~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py

import os
import ycm_core

flags = [ '-std=c++20' ]

def Settings ( **kwargs ):
    return { 'flags': flags }

And the problem solved.

本文标签: linuxHow to prevent YCM from showing red errors in C 20 templatesStack Overflow