microsoft / microsoft/vscode-cpptools

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

オープン
#6,473 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

external Language Service Visual Studio
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された test.cpp、Boost 1.73.0、.vscode/c_cpp_properties.json を使い、clang-cl.exe で診断を再現してから、clang.exe と比較します。IntelliSense 言語サービスによる compilerPath 設定の処理を追跡します。boost::function の例で Problems-window エラーが発生しなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, vscode
領域
compilers, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。