clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
592 stars 97 forks source link

Clangd does not see invalid "vector.emplace_back" arguments #623

Closed Aokigahara23 closed 2 months ago

Aokigahara23 commented 2 months ago

Hello guys, thank you for the extension at first)

I have a problem with clangd / clang-tidy providing errors for this simple piece of code:

  auto *vec = new std::vector<int>(1024, 0);

  vec->push_back(1);  // ok
  vec->push_back("itsastring");  // not ok
  vec->emplace_back("itsastring");   // ok for some reason, works the same if we pass any object as argument...

System information

$ clangd --version
                                                                                                                               1 ↵
Ubuntu clangd version 14.0.0-1ubuntu1.1
Features: linux+grpc
Platform: x86_64-pc-linux-gnu

clangd extension version: v0.1.28 Operating system: Ubuntu 20.04 (WSL2)

Any solution would help, i would like clangd/clang-tidy to generate as many errors and warnings as possible for my code, i will disable them by need.

HighCommander4 commented 2 months ago

Duplicate of https://github.com/clangd/clangd/issues/137