rnk added a comment.

> That doesn't handle the second of your test cases though, where dllimport is 
> put on the member directly:
> ...
> It's not clear to me how we'd want to handle that. I don't think it comes up 
> in libc++, and I can't think of any code that would want to do that either, 
> really.

I think this does actually matter for libc++, I think I have seen this pattern:

  template <typename T>
  struct Foo {
    _LIBCPP_FUNC_VIS _LIBCPP_EXCLUDE_FROM_ABI void method() { }
  };

I can't find an instance right now, though. I think it comes up when you want 
to have a default visibility function, and also keep it out of the libc++ DSO 
interface.

This is a somewhat weird and contradictory case, though, the attributes 
directly conflict. I think it would be reasonable to teach SemaDeclAttr to 
ignore the dllimport attribute if the other attribute is already present.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155713

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

Reply via email to