[PATCH] D117569: Constexpr not supported with __declspec(dllimport).

David Majnemer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 19 22:18:32 PST 2022


majnemer requested changes to this revision.
majnemer added a comment.
This revision now requires changes to proceed.

I have a question regarding how this work with respect to the dllimport semantics known by the linker.
IIUC, we will now allow a program like:

  extern int __declspec(dllimport) dll_import_int;
  constexpr int& dll_import_constexpr_ref = dll_import_int;
  int& get() {
      return dll_import_constexpr_ref;
  }

Here, `get` will load `dll_import_constexpr_ref`. However, what will `dll_import_constexpr_ref` hold? It ought to hold the contents of `__imp_?dll_import_int@@3HA`. However, we can't dereference `__imp_?dll_import_int@@3HA` to get to its contents.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117569/new/

https://reviews.llvm.org/D117569



More information about the cfe-commits mailing list