-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
clang-cl`clang-cl` driver. Don't use for other compiler parts`clang-cl` driver. Don't use for other compiler parts
Description
I use offsetof
in a template parameter, this works on all compilers (Clang, MSVC, GCC) except clang-cl.
error: non-type template argument is not a constant expression
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stddef.h(47,31): note:
expanded from macro 'offsetof'
...offsetof(s,m) ((::size_t)&reinterpret_cast<char const volatile&>((((s*)0)->m)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Obviously reinterpret_cast
is not constant evaluable. So I guess MSVC provides a builtin, but clang-cl does not?
JCash and frederick-vs-ja
Metadata
Metadata
Assignees
Labels
clang-cl`clang-cl` driver. Don't use for other compiler parts`clang-cl` driver. Don't use for other compiler parts