clion/clangd shows wrong error with ostream

see screenshot,

ostream has correctly included (no highlights)  and Ctrl+click or Ctrl+b on the include or on the declaration std::ostream &os jumps ostream declaration.

that doesn't work properly in a whole project, all output operations show me this error .

for sure, project compilation does work successful as well

 

16 comments
Comment actions Permalink

the addition to post above - Ctrl+click on operator << does also jump to the declaration of this properly

0
Comment actions Permalink

Hi! What CLion version do you use? What compiler (name and version) do you use in CLion?

0
Comment actions Permalink

CLion 2019.3 EAP
Build #CL-193.3793.19, built on September 25, 2019
CLion EAP User
Expiration date: October 25, 2019
Runtime version: 11.0.4+10-b485.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1987M
Cores: 2
Registry: projectView.hide.dot.idea=false, run.processes.with.pty=TRUE
Non-Bundled Plugins:

 

 

target host compiler GCC531

IDE ran host: WIn10

0
Comment actions Permalink

actually , there is a number of similar errors , e.g.:

 

which can be successfully resolved by navigation 

supposed that compiler from target host is not in use for the syntax highlight and navigation. 

clangd and builtin engine is in the use? 

the question is why one of them can't resolve the symbol but another one can do this

0
Comment actions Permalink

Please provide a screenshot of File | Settings | Build, Execution, Deployment | Toolchains (please capture the screenshot after the compiler detection is completed).

0
Comment actions Permalink

Also do you have all options in File | Settings | Languages & Frameworks | C/C++ | Clangd enabled?

0
Comment actions Permalink

yes, all 5 clangd checkboxes are enabled

0
Comment actions Permalink

Please do `Tools | CMake | Reset Cache and Reload Project` and after that `Tools | Resync with Remote Hosts`. Does it help? 

0
Comment actions Permalink

could you clarify the logic of "resync with remote host"?

does it looks for the includes in the project? (cmakelists)
as you can see this is not a default toolchain for remote system,

and initially, resync function didn't download standard library headers until I've included this into cmakelists

(it's not required for remote build but oddly without that clion doesn't cache those to the local)

set(STD_INCLUDE /opt/rh/devtoolset-4/root/usr/include/c++/5.3.1)


0
Comment actions Permalink

okay, I'll try to do those steps, and return back with a results, due the large project it takes 30+ minutes

0
Comment actions Permalink

I can't reply you quickly , that's terrible a few times per day:

(I'm submitting all of those)

0
Comment actions Permalink

it didn't fix the problem,

1. invalidate caches and restart

2. resync with remote

 

as previously it can navigate throu these operators/methods/classes but have a errors tips with highlighting

0
Comment actions Permalink

 >invalidate caches and restart

Just to avoid misunderstanding, have you done `Tools | CMake | Reset Cache and Reload Project` or `File | Invalidate Caches / Restart ...`? 

0
Comment actions Permalink

did both, reset cmake cache as well as IDE caches reset

0
Comment actions Permalink

so I've switched off clangd checkbox to avoid such errors (there is a lot of those, acually most of std library was), 

now looks it works quicker and no error highlights

0

Please sign in to leave a comment.