vscode-cpptools
vscode-cpptools copied to clipboard
IntelliSense not handling constexpr float types properly (starting from extension 1.17.2)
Environment
- OS and Version: Ubuntu 20.04 @ WSL2
- VS Code Version: 1.81.1
- C/C++ Extension Version: >= 1.17.2
- If using SSH remote, specify OS of remote machine: WSL2 @ Windows 11
Bug Summary and Steps to Reproduce
Bug Summary: IntelliSense reports errors (at least on constexpr literals) that the compiler doesn't.
Steps to reproduce:
- Clone the minimum viable example.
- Build it using the CMake extension (works probably as well when manually running CMake).
- Open example.cpp.
- If not happened automatically, run the "C/C++: Run Code Analysis on Active File" command.
- You'll see the 4 IntelliSense errors that aren't reported by the compiler:
Expected behavior:
- No Intellisense errors shall be displayed.
Notes:
- Interestingly the errors affect both float and double literals, and the 0 literal doesn't show the error.
- Reverting to any version < 1.17.2 (e.g. 1.16.3) solves the problem.
- Issue opened upon suggestion by @Colengms in #11351, in this comment.
Configuration and Logs
* No `c_cpp_properties.json` used
* No `C/C++: Log Diagnostics` command found
* Output from debug info with Debug log level: see file pasted in "Additional context"
Other Extensions
No response
Additional context
Note: This was moved from https://github.com/microsoft/vscode-cpptools/issues/11351#issuecomment-1697499243 , and the internal bug number is 1839628 (EDG).
Note that v1.18.5 still presents the issue.
This issue is about to celebrate its first birthday but is unfortunately still present in v1.21.6. Kindly requesting to reconsider for prioritization.
@rsarrazin2 I've pinged the team.
The issue is still present in current release 1.22.11 and pre-release 1.23.2. I kindly remind that it used to work with revisions < 1.17.2 so that it should be possible to find the cause of the regression. Thank you.
Still present in 1.23.6. Searching issues for "expression must have a constant value" yields several hits (e.g. #12810, #12983) so it seems to be a real issue.