microsoft / microsoft/vscode-cpptools

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

Abierto
#6,473 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

external Language Service Visual Studio
Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el diagnóstico con el test.cpp proporcionado, Boost 1.73.0 y .vscode/c_cpp_properties.json usando clang-cl.exe y, después, compárelo con clang.exe. Rastree el procesamiento de la configuración compilerPath por parte del servicio de lenguaje IntelliSense; el trabajo estará terminado cuando el ejemplo de boost::function no produzca ningún error de Problems-window.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp, vscode
Área
compilers, tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.