Skip to content

clang-cl "/clang:" args not working with v17 build from main? #63930

@Colengms

Description

@Colengms

I work on the C/C++ Extension for VS Code. We rely on the /clang: prefix in order to pass gcc args to clang-cl, to coax it into returning system include paths and system defines. i.e.: clang-cl.exe /clang:-xc++ /clang:-E /clang:-dM nul

In the process of assisting a dev working on Edge (Chromium), I discovered their process of building chromium involves snapping to a pre-release commit (in main, as per docs from Google), and that the latest builds from main no longer supports that syntax:

clang-cl.exe /clang:-xc++ /clang:-E /clang:-dM nul
clang-cl: error: unsupported option '-x c++'; did you mean '/TC' or '/TP'?

I'm not sure if this is a bug or intentional removal of this functionality. But, without this or an alternative, the C/C++ Extension for VS Code would be unable to support automatically querying system include paths and system defines from clang-cl. Could this get fixed/restored? By filing this issue, I'm hoping to head-off a large number of issues being opened against the C/C++ Extension for VS Code when LLVM 17 is released.

This is also how we support other compilers based on clang-cl, such as Intel's LLVM based compilers: icx.exe, dpcpp.exe, cpcpp-cl.exe

As a side note / bonus issue; We build clang-tidy and clang-format for distribution with the C/C++ Extension for VS Code. I recently tried to build these out of main. I noticed (at least as of commit f763270), that cross-compilation builds hosted on x64 macOS and targeting Arm64 macOS, were consistently hanging. This didn't repro when building from the version 16 release tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-cl`clang-cl` driver. Don't use for other compiler parts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions