[PATCH] D134784: [IR] Don't allow DLL storage-class and local linkage

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 16:18:03 PDT 2022


MaskRay added a comment.

In D134784#3822303 <https://reviews.llvm.org/D134784#3822303>, @bd1976llvm wrote:

> In D134784#3821336 <https://reviews.llvm.org/D134784#3821336>, @MaskRay wrote:
>
>> For Clang, it seems that MSVC allows dllspec on a local linkage variable, so that's why we have to add it to CodeGen instead of rejecting it in Sema.
>
> Can you give an example? MSVC certainly rejects simple cases e.g. https://godbolt.org/z/bG3M7oj5W. I am worried that I have missed something...

`__declspec(dllexport) const int foo = 10;` foo with internal linkage is accepted.


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

https://reviews.llvm.org/D134784



More information about the llvm-commits mailing list