-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationextension:microsoft
Description
Bugzilla Link | 51558 |
Version | trunk |
OS | Windows NT |
CC | @DougGregor,@zmodem,@zygoloid,@rnk |
Extended Description
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.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluationextension:microsoft