https://bugs.llvm.org/show_bug.cgi?id=51558
Bug ID: 51558
Summary: Address of dllimport symbol is not constexpr
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: skyos...@chromium.org
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk
The following C++ program fails to compile on the x64_64-pc-windows-msvc
target:
extern __declspec(dllimport) int x;
constexpr int* y = &x;
Error message:
test.cc(7,16): error: constexpr variable 'y' must be initialized by a
constant expression
This is on Clang version 14.0.0 (https://github.com/llvm/llvm-project/
ee65938357d5fffe9e586fa155b37268b5a358ac), target: x86_64-pc-windows-msvc. I
ran into this while trying to compile Perfetto (https://perfetto.dev) as a part
of Chromium.
The same program builds correctly on MSVC (tested on 19.29.30037 for x64).
Interestingly, MSVC had a regression related to this in 2018[1] which has since
been fixed.
[1]
https://developercommunity.visualstudio.com/t/c-regression-stdmax-of-two-constexpr-does-not-eval/312456
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs