hans added a comment.

Interesting! Do you have an example where this (local dllexport/import classes) 
comes up in practice?

MSVC will also allow the following:

  namespace {
  struct __declspec(dllexport) T {
      void foo();
  };
  }

whereas Clang will not, and I think Clang is making the right call there.



================
Comment at: clang/lib/AST/Decl.cpp:492
+  // classes with dllexport/dllimport attributes.
+  if (spec->getASTContext().getTargetInfo().shouldDLLImportComdatSymbols())
+    if (spec->hasAttr<DLLExportAttr>() || spec->hasAttr<DLLImportAttr>())
----------------
We usually check ASTContext's `getTargetInfo().getCXXABI().isMicrosoft()`


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

https://reviews.llvm.org/D145271

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to