Vscode-cpptools: invalid operands to binary expression ('std::ostream' (aka 'int') and 'const char [2]')ccls(2)

Created on 6 May 2020  ·  10Comments  ·  Source: microsoft/vscode-cpptools

Type: LanguageService

Describe the bug

  • OS and Version: i use vscode remote development on my personal pc which is a win10, when the cloud dev machine(the project runtime environment) has a centos system.
    -- my pc: win10
    -- dev machine: Linux VM_110_148_centos
  • VS Code Version: 1.44.2
  • C/C++ Extension Version: 0.27.1
  • Other extensions you installed (and if the issue persists after disabling them):
  • Does this issue involve using SSH remote to run the extension on a remote machine?:
    yes, it does.
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
    just like the operations in this docs https://code.visualstudio.com/docs/cpp/config-linux, i learn to
    mkdir a helloworld, and write a testhello.cpp. Whereas, there is always has a code-check warning below the symbol <<(the last <<, actually), when i hover my cursor on this symbol, it displays

std::__1::ostream &std::__1::operator<<<...>(std::__1::ostream &__os, const char *__str) +18 overloads invalid operands to binary expression ('std::ostream' (aka 'int') and 'const char [2]')ccls(2)

then i click alt+f8, it show me

base specifier must name a classccls(2)
stl_vector.h(164, 20): in instantiation of member class 'std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_Vector_impl' requested here
stl_vector.h(210, 30): in instantiation of template class 'std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >' requested here
testhello.cpp(9, 20): in instantiation of template class 'std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >' requested here

Steps to reproduce

  1. use the ssh func to connect the remote dec machine
  2. create this helloworld project
  3. paste these code in the following blank
    企业微信截图_15887513767616
  1. it show me these code-check warning

but the strange thing is, this project still can be compiled and builded without any error.(it just a single cpp file, no multiple.)

Expected behavior



Logs

Insert logs here.

Screenshots

Additional context

external

Most helpful comment

@joseph102outlaw102 Those errors are not from our C/C++ extension. They appear to be from some ccls(2) extension?

Also, we don't know why @Answer-123 is posting strange messages.

All 10 comments

Awesome😍😍

∴you’re Chinese right?

∴you’re Chinese right?

yes, i am

∴you’re Chinese right?

yes, i am

Are you interested in Cpp

∴you’re Chinese right?

所以说怎么把VScode设成中文的?

@joseph102outlaw102 Those errors are not from our C/C++ extension. They appear to be from some ccls(2) extension?

Also, we don't know why @Answer-123 is posting strange messages.

@joseph102outlaw102 Those errors are not from our C/C++ extension. They appear to be from some ccls(2) extension?

Also, we don't know why @Answer-123 is posting strange messages.

Use Dev-cpp and this error won’t be happening

@joseph102outlaw102 Those errors are not from our C/C++ extension. They appear to be from some ccls(2) extension?
Also, we don't know why @Answer-123 is posting strange messages.

you're right, i've solved this problem now, thank you very much.

@joseph102outlaw102 Those errors are not from our C/C++ extension. They appear to be from some ccls(2) extension?
Also, we don't know why @Answer-123 is posting strange messages.

Use Dev-cpp and this error won’t be happening

what's dev-cpp? is it a mode in vscode?

@joseph102outlaw102 Those errors are not from our C/C++ extension. They appear to be from some ccls(2) extension?

Also, we don't know why @Answer-123 is posting strange messages.

Use Dev-cpp and this error won’t be happening

what's dev-cpp? is it a mode in vscode?

No, but it’s a better compiler.It uses GCC

Was this page helpful?
0 / 5 - 0 ratings