microsoft / microsoft/vscode-cpptools

IntelliSense for clang-cl produces incorrect error with boost::function

Aperta
#6,473 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

external Language Service Visual Studio
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10 Pro 1909
  • VS Code Version: 1.51.0
  • C/C++ Extension Version: 1.1.0

When I specify the path to clang-cl.exe to compilerPath property of c_cpp_properties.json, incorrect errors appear in the problems window. Using boost::function is an easy way to reproduce it.

Steps to reproduce

  1. Make sure you have installed Clang 9.0.0 for Windows
  2. Download Boost 1.73.0 from https://www.boost.org and extract it somewhere
  3. Create a directory
  4. Put test.cpp in the directory
#include <boost/function.hpp>

void f(const boost::function<void()> &x) {
    x();
}
  1. Put .vscode/c_cpp_properties.json
{
    "version": 4,
    "configurations": [
        {
            "name": "Clang",
            "compilerPath": "C:/Program Files/LLVM/bin/clang-cl.exe",
            "includePath": [
                "C:/your/path/to/boost_1_73_0"
            ]
        }
    ]
}
  1. Open the directory with VSCode
  2. Open test.cpp with the editor

Expected behavior

No error is shown in the problems window. You can get this result by specifying clang.exe instead of clang-cl.exe.

Actual behavior

The following error is shown in the problems window.

call of an object of a class type without appropriate operator() or conversion functions to pointer-to-function type

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci la diagnostica con il test.cpp fornito, Boost 1.73.0 e .vscode/c_cpp_properties.json usando clang-cl.exe, quindi confrontala con clang.exe. Traccia la gestione dell'impostazione compilerPath da parte del servizio linguistico IntelliSense; il lavoro è concluso quando l'esempio boost::function non produce alcun errore in Problems-window.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, vscode
Ambito
compilers, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.