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

no instance of constructor "smartview" matches the argument list error in vscode #12

Closed
4 tasks done
leoyoung07 opened this issue Nov 4, 2023 · 6 comments
Closed
4 tasks done
Assignees
Labels
awaiting upstream Requries upstream changes invalid This doesn't seem right windows An issue specific to Windows

Comments

@leoyoung07
Copy link

✍️ Bug Description

cmake could build with no error, but vscode shows an error in editor:
image

🔁 Steps to reproduce

I created a project following the tutorial on Windows 11: https://saucer.github.io/docs/getting-started/basic-app.
I can build the project with no error using cmake:

C:\dev\cmake-3.27.5-windows-x86_64\bin\cmake.EXE --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_TOOLCHAIN_FILE:STRING=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET:STRING=x64-windows -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE "-DCMAKE_C_COMPILER:FILEPATH=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe" -SC:/LeoProjects/saucer-test -Bc:/LeoProjects/saucer-test/build -G "Visual Studio 17 2022" -T ClangCL,host=x64 -A x64

But vscode shows an error in editor: no instance of constructor "smartview" matches the argument list.
My c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/build/_deps/saucer-src/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.22621.0",
            "compilerPath": "cl.exe",
            "cStandard": "c17",
            "cppStandard": "c++20",
            "intelliSenseMode": "windows-msvc-x64",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

❔ Expected behavior

No response

👀 Screenshots

No response

🛸 Saucer Version

v2.1.0

🖥️ Operating System

Windows 11

🖥️ Distribution

No response

✅ I confirm that...

  • I have collected all the required information and read all the comments in this document
  • I searched for an existing bug report for this issue
  • the problem does occur with the reproduction steps I provided
  • what I described is indeed a problem
@leoyoung07 leoyoung07 added the bug Something isn't working label Nov 4, 2023
@Curve
Copy link
Member

Curve commented Nov 4, 2023

This seems to be windows related, what's your exact compiler version?

Also I don't think this is a bug in saucer but rather in the language server you use, afaik you can workaround this issue by writing saucer:: smartview smartview{} instead.

With the latest clangd version (could also not reproduce with older versions) I could not observe this error, so it may be related to the C/C++ Tools Extension

@Curve Curve added windows An issue specific to Windows and removed bug Something isn't working labels Nov 4, 2023
@Curve
Copy link
Member

Curve commented Nov 4, 2023

This might be related: microsoft/vscode-cpptools#2912

@Curve
Copy link
Member

Curve commented Nov 4, 2023

I could reproduce this with some basic code that uses concepts, the issue lies within the C/C++ VSCode extension as their language server is not able to deduce concepts correctly.

Another related issue: microsoft/vscode-cpptools#8132

I would strongly recommend to use the clangd extension as it suffers from way less bugs imho.

@Curve
Copy link
Member

Curve commented Nov 4, 2023

I've filed an additional issue for you here: microsoft/vscode-cpptools#11624

There is nothing I can do to fix this, it's on the C/C++ Extension. As mentioned earlier I'd recommend using clangd instead.

@Curve Curve closed this as completed Nov 4, 2023
@Curve Curve added invalid This doesn't seem right awaiting upstream Requries upstream changes labels Nov 4, 2023
@leoyoung07
Copy link
Author

I could reproduce this with some basic code that uses concepts, the issue lies within the C/C++ VSCode extension as their language server is not able to deduce concepts correctly.

Another related issue: microsoft/vscode-cpptools#8132

I would strongly recommend to use the clangd extension as it suffers from way less bugs imho.

Thanks for the suggestion, I'll try the clangd extension later.

@Curve
Copy link
Member

Curve commented Nov 4, 2023

I could reproduce this with some basic code that uses concepts, the issue lies within the C/C++ VSCode extension as their language server is not able to deduce concepts correctly.
Another related issue: microsoft/vscode-cpptools#8132
I would strongly recommend to use the clangd extension as it suffers from way less bugs imho.

Thanks for the suggestion, I'll try the clangd extension later.

Make sure you're properly exporting compile commands when using clangd (this may require clang-cl as well)

Curve added a commit that referenced this issue Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting upstream Requries upstream changes invalid This doesn't seem right windows An issue specific to Windows
Projects
None yet
Development

No branches or pull requests

2 participants