You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IntelliSense: False positive error message for std::unique_ptr return type #11979
If using SSH remote, specify OS of remote machine: None
Bug Summary and Steps to Reproduce
Bug Summary:
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.
Activity
sean-mcmanus commentedon Feb 20, 2024
nanlour (@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 .
sean-mcmanus commentedon Jan 10, 2025
nanlour (@nanlour) Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.23.3 (pre-release).