Reference to an overloaded function could not be resolved error coming in “endl”
Answered
I'm getting this reference to an overloaded function could not be resolved error from an "endl" in C++. Although my code compiles normally and runs normally too. WHy are such errors coming up?

I'm also getting "Expression result unused" warning in the cin statements.
https://codeshare.io/5oDEmY Here is the link to my code.
Please explain why are these errors coming. Should I downgrade CLion because I think this came because of a recent update.
Please sign in to leave a comment.
Hello! Unfortunately, I can't reproduce the issue in CLion 2018.2.1 with the provided code.
Please specify CLion version (Help | About CLion), OS and compiler you use.
Are the options in File | Settings | Languages & Frameworks | C/C++ | Clangd enabled or disabled?
Details of my current version (Warnings and errors working perfectly)
CLion 2018.2
Build #CL-182.3684.76, built on July 20, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Details of the updated version (The one with the unnecessary erros/warnings)
CLion 2018.2.1
Build #CL-182.3911.40, built on August 7, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
The options in Clangd are all enabled.
Unfortunately, I still can't reproduce the issue with the code from https://codeshare.io/5oDEmY in CLion 2018.2.1 on WIndows:
Tried with Cygwin x64 (version 2.10.0, GNU 6.4.0) and MinGW (version w64 5.0, GNU 7.2.0).
What toolchain/compiler do you use? Are the issues reproducible on your side if you create a default "C++ Executable" project in CLion and copy-paste the code from https://codeshare.io/5oDEmY in it?
Meanwhile you can disable the options in File | Settings | Languages & Frameworks | C/C++ | Clangd as a workaround.
Here is a screenshot of the toolchain that I use.
I double checked the code. It's fine. And yes, the issue is there when I make a new project altogether and paste the code from the link I gave. It compiles perfectly but just keeps displaying the weird errors/warnings.
1) In the command line please do
What is the result?
2) Does disabling the options in File | Settings | Languages & Frameworks | C/C++ | Clangd help?
1) I got this as the output
g++.exe (MinGW.org GCC-6.3.0-1) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2) Yeah, it works it removes those errors/warnings. But isn't there any fix for that? Let me know soon.
I've installed the same MinGW distribution with GCC-6.3.0 and still don't see these errors for your code in CLion 2018.2.1. Please see the GIF of the entire process of reproduction:
Please do Tools | CMake | Reset Cache and Reload Project and then File | Invalidate Caches / Restart... .
If it doesn't help, please archive your project and send it to clion-support at jetbrains.com.
>Yeah, it works it removes those errors/warnings. But isn't there any fix for that? Let me know soon.
Just to clarify:
In CLion 2018.2 we've added a clangd-based language engine in addition to CLion's own language engine. In CLion 2018.2.1 we've turned it on by default (i.e. by default enabled settings in File | Settings | Languages & Frameworks | C/C++ | Clangd). This means that on Windows CLion 2018.2 uses its own language engine by default and CLion 2018.2.1 uses clangd-based language engine by default. If clangd-based language engine produces false positive errors on your side, you can simple switch to CLion's own language engine by disabling settings in File | Settings | Languages & Frameworks | C/C++ | Clangd.
I tried the stuff you said but it didn't work.
Funny thing... I tried to reproduce the bug, I made a new project and pasted my code in main.cpp, there are no absurd errors now. So is there some problem with my code or with my project settings?
It's hard to say without reproducing the issue on our side. If you would like to continue the investigation, please archive your project and send it to clion-support at jetbrains.com.