[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 07:51:19 PDT 2025
================
@@ -6606,7 +6606,10 @@ void Sema::checkClassLevelDLLAttribute(CXXRecordDecl *Class) {
if (ClassExported && !ClassAttr->isInherited() &&
TSK == TSK_ExplicitInstantiationDeclaration &&
!Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
- Class->dropAttr<DLLExportAttr>();
+ if (auto *DEA = Class->getAttr<DLLExportAttr>()) {
+ Class->addAttr(DLLExportOnDeclAttr::Create(Context, DEA->getLoc()));
----------------
erichkeane wrote:
I honestly would like this better if we just kept the `DLLExportAttr` and added a bool flag to it for `ignoredBecauseItsOnaDeclWhereItWouldntWorkForVariousReasons` in the `extra members` section.
https://github.com/llvm/llvm-project/pull/133699
More information about the cfe-commits
mailing list