microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

IntelliSense errors on macOS 15 after updating Command Line Tools #12766

Closed nextonesfaster closed 1 month ago

nextonesfaster commented 1 month ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: Intellisense is displaying errors which do not appear when compiling directly. The errors started appearing only after upgrading the Command Line Tools to version 16.

Steps to reproduce:

  1. Create a .cpp file with the following code:
#include <utility>

int main()
{
    std::pair<int, int> pair(1, 2);
    auto [one, two] = pair;
}
  1. Ensure cpp standard is set to c++17.
  2. Hover over [ on the 6th line
  3. See error: std::tuple_size<"std::__1::pair<int, int>">::value is not a valid integral constant-expression

Expected behavior: No error should appear, since this is a valid program when using c++17 or newer.

Configuration and Logs

`c_cpp_properties.json`:

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}

C/C++ Log Diagnostics:

-------- Diagnostics - 9/25/2024, 3:03:47 PM
Version: 1.21.6
Current Configuration:
{
    "name": "Mac",
    "includePath": [
        "/Users/name/dev/test/**"
    ],
    "defines": [],
    "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "cppStandard": "c++17",
    "intelliSenseMode": "macos-clang-arm64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "cStandard": "c17",
    "mergeConfigurations": false,
    "compilerPath": "/usr/bin/clang++",
    "browse": {
        "path": [
            "/Users/name/dev/test/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
cpptools version (native): 1.21.6.0
Translation Unit Mappings:
[ /Users/name/dev/test/problems/problem_94.cpp - source TU]:
[ /Users/name/dev/test/problems/test.cpp - source TU]:
    /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_stdlib.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/math.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/sys/_pthread/_pthread_types.h
    /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/sys/signal.h
Translation Unit Configurations:
[ /Users/name/dev/test/test.cpp ]:
    Process ID: 37513
    Memory Usage: 74 MB
    Compiler Path: /usr/bin/clang++
    Includes:
    System Includes:
        /usr/local/include
        /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1
        /Library/Developer/CommandLineTools/usr/lib/clang/16/include
        /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include
        /Library/Developer/CommandLineTools/usr/include
    Frameworks:
        /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/System/Library/Frameworks
    Standard Version: c++17
    IntelliSense Mode: macos-clang-arm64
    Other Flags:
        --clang
        --clang_version=160000
Total Memory Usage: 288 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 11912

Other Extensions

clang-format, disabling it makes no difference

Additional context

No response

nextonesfaster commented 1 month ago

Switching to pre-release version 1.22.5 seems to fix this.