[PATCH] D133266: [MinGW] Reject explicit non-default visibility applied to dllexport/dllimport declaration

ben via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 11:57:55 PDT 2022


bd1976llvm added a comment.

This approach doesn't account for the implementation of -fvisibility-global-new-delete-hidden. The following case now fails after this change:

> type new_del.cpp

namespace std {

  typedef __typeof__(sizeof(int)) size_t;
  struct nothrow_t {};
  struct align_val_t {};

}
__declspec(dllexport) void operator delete(void* ptr) throw() {return;}

> clang.exe --target=x86_64-pc-windows-gnu new_del.cpp -fvisibility-global-new-delete-hidden -c

new_del.cpp:8:28: error: non-default visibility cannot be applied to 'dllexport' declaration
__declspec(dllexport) void operator delete(void* ptr) throw() {return;}

  ^

1 error generated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133266



More information about the cfe-commits mailing list