[llvm-bugs] [Bug 44956] New: Clang 10.0-r2 includes unsupported headers from msvc >= 16.4 on Windows when in C++2a

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 18 12:43:24 PST 2020


            Bug ID: 44956
           Summary: Clang 10.0-r2 includes unsupported headers from msvc
                    >= 16.4 on Windows when in C++2a
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mjklaim at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk


 - `clang` 10.0-r2
 - Windows 10
 - `msvc` 16.4.4/16.4.5/16.5-preview
 - (`build2` v0.12.0 as build system, but it doesn't seem specific; `build2`
will find the latest msvc install on the system to provide it to clang; all the
following commands are extracts from `build2`'s verbose output)

How To Reproduce

#include <utility> // any header potentially including <concepts>

int main() {}

clang++ -std=c++2a -D_MT -D_DLL -w -x c++ -MQ ^ -M -MG

(or with build2:
cxx.std = latest

using cxx

exe{test} : cxx{main}

Execute: `b config.cxx=clang++`


In file included from C:\Users\klaim\temp\minimaltest\main.cxx:1:
In file included from C:\Program Files (x86)\Microsoft Visual
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\concepts:14:2: error:
Despite the presence of some Clang-related bits, this header currently does not
      Clang. You can define _SILENCE_CLANG_CONCEPTS_MESSAGE to silence this
message and acknowledge that this is unsupported.
#error Despite the presence of some Clang-related bits, this header currently
does not support Clang. \
^: C:\Users\klaim\temp\minimaltest\main.cxx \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\utility \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\yvals_core.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vcruntime.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\sal.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\concurrencysal.h \
  C:\Program\ Files\LLVM\lib\clang\10.0.0\include\vadefs.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\vadefs.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xkeycheck.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\type_traits \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xstddef \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstddef \
  C:\Program\ Files\LLVM\lib\clang\10.0.0\include\stddef.h \
  C:\Program\ Files\LLVM\lib\clang\10.0.0\include\__stddef_max_align_t.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\xtr1common \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib \
  C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.17763.0\ucrt\math.h \
  C:\Program\ Files\ (x86)\Windows\
Kits\10\Include\10.0.17763.0\ucrt\corecrt_math.h \
  C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.17763.0\ucrt\corecrt.h
  C:\Program\ Files\ (x86)\Windows\ Kits\10\Include\10.0.17763.0\ucrt\stdlib.h
  C:\Program\ Files\ (x86)\Windows\
Kits\10\Include\10.0.17763.0\ucrt\corecrt_malloc.h \
  C:\Program\ Files\ (x86)\Windows\
Kits\10\Include\10.0.17763.0\ucrt\corecrt_search.h \
  C:\Program\ Files\ (x86)\Windows\
Kits\10\Include\10.0.17763.0\ucrt\corecrt_wstdlib.h \
  C:\Program\ Files\LLVM\lib\clang\10.0.0\include\limits.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\limits.h \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\initializer_list \
  C:\Program\ Files\ (x86)\Microsoft\ Visual\
1 error generated.


To compile successfully, in the same way clang 9.0.1 compiles successfully in
the same context.


1. As mentionned, switching clang to 9.0.1 removes the issue.
2. The issue appears only with `-std=c++2a`, not with `-std=1z` (C++17)
3. Looking at `<utility>` line 15 we can see:

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200218/671f99e6/attachment-0001.html>

More information about the llvm-bugs mailing list