Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense: False positive error message for std::unique_ptr return type #11979

Open
nanlour opened this issue Feb 18, 2024 · 2 comments
Open
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@nanlour
Copy link

nanlour commented Feb 18, 2024

Environment

  • OS and Version: Ubuntu 22.04.3 LTS
  • VS Code Version:
  • C/C++ Extension Version: v1.19.3 (pre-release)
  • If using SSH remote, specify OS of remote machine: None

Bug Summary and Steps to Reproduce

Bug Summary:
Screenshot from 2024-02-18 20-35-10
The code work fine, but for line 14, I got error message: function "std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp> &) [with _Tp=int, _Dp=std::default_delete]" (declared at line 468 of "/usr/include/c++/11/bits/unique_ptr.h") cannot be referenced -- it is a deleted functionC/C++(1776).

I think when return, the unique pointer are tread as rvalue to construct return type fool, but IntelliSense think it is lvalue.

Expected behavior:
No error message.

Configuration and Logs

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus self-assigned this Feb 20, 2024
@sean-mcmanus sean-mcmanus added bug Language Service Visual Studio Inherited from Visual Studio labels Feb 20, 2024
@sean-mcmanus sean-mcmanus added this to the Tracking milestone Feb 20, 2024
@sean-mcmanus
Copy link
Contributor

@nanlour The bug also repros with VS (shared code), so I've filed a bug at https://developercommunity.visualstudio.com/t/C-IntelliSense-gives-an-incorrect-erro/10594068 .

@bobbrow bobbrow added this to cpptools Jun 17, 2024
@github-project-automation github-project-automation bot moved this to Triage in cpptools Jun 17, 2024
@bobbrow bobbrow removed the status in cpptools Jun 20, 2024
@sean-mcmanus sean-mcmanus modified the milestones: Tracking, 1.23.3 Dec 17, 2024
@sean-mcmanus sean-mcmanus moved this to Todo in cpptools Dec 17, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 8, 2025
@sean-mcmanus sean-mcmanus removed their assignment Jan 8, 2025
@sean-mcmanus sean-mcmanus moved this from Todo to Done in cpptools Jan 8, 2025
@sean-mcmanus
Copy link
Contributor

@nanlour Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.23.3 (pre-release).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service Visual Studio Inherited from Visual Studio
Projects
Status: Done
Development

No branches or pull requests

2 participants