Skip to content

_HAS_CONDITIONAL_EXPLICIT=0 won't work with VS 2022 17.4 #10875

Description

@StephanTLavavej
  • Checked for duplicates

Describe the bug

ROOT sets _HAS_CONDITIONAL_EXPLICIT=0 for MSVC's STL:

#if (_MSC_VER >= 1926)
// FIXME: Silly workaround for cling not being able to parse the STL
// headers anymore after the update of Visual Studio v16.7.0
// To be checked/removed after the upgrade of LLVM & Clang
PPOpts.addMacroDef("_HAS_CONDITIONAL_EXPLICIT=0");
#endif

MSVC's STL (which I work on) has removed this codepath by merging microsoft/STL#2796, which will ship in VS 2022 17.4 Preview 1. As a result, ROOT will fail to build with:

[trimmed...]\utility(151,9): error G08EB1F86: expected member name or ';' after declaration specifiers [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\utility(151,9): error GC66A3811: expected ')' [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\utility(190,24): error G08EB1F86: expected member name or ';' after declaration specifiers [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\utility(190,24): error GC66A3811: expected ')' [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\tuple(268,9): error G08EB1F86: expected member name or ';' after declaration specifiers [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\tuple(268,9): error GC66A3811: expected ')' [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\tuple(302,5): error G28325FEB: non-static data member cannot be constexpr; did you intend to make it const? [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\tuple(302,24): error G68D9A705: member '_Tuple_conditional_explicit_v' declared as a template [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
[trimmed...]\tuple(302,79): error GC66A3811: expected ';' at end of declaration list [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]
CUSTOMBUILD : error : Error loading the default rootcling header files. [F:\gitP\root-project\root\build_amd64\core\G__Core.vcxproj]

Expected behavior

ROOT should build successfully, even when MSVC's STL uses Future Technology (i.e. C++20 explicit(bool) in C++14/17 modes).

Upstream Clang has supported this scenario (with a suppressible warning) since Clang 10.0.0 shipped on 2020-03-24. Example on Compiler Explorer: https://godbolt.org/z/a75ooK6cz

The comment in CIFactory.cpp indicates that this was a known issue (although I was unable to find anything filed in GitHub or Jira) - is ROOT planning to upgrade its Clang/LLVM dependency, which would resolve this?

To Reproduce

Build ROOT with the latest MSVC STL from https://github.com/microsoft/STL, or wait for VS 2022 17.4 Preview 1 to ship (we can't provide an ETA yet, but it'll be some time).

Setup

  1. ROOT version: master
  2. Operating system: Windows 11
  3. How you obtained ROOT: Built it ourselves (or tried to)

Additional context

Supporting explicit(bool) will also improve build throughput, as std::pair, std::tuple, and std::optional's constructor sets were nearly twice the size with the _HAS_CONDITIONAL_EXPLICIT=0 workaround.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions