[PATCH] D153835: [Sema] Clone VisibilityAttr for functions in template instantiations

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 14:32:44 PDT 2023


efriedma added a comment.

Can you write the complete rule we're trying to follow here?  Like, if you have a free function template, prioritize attributes in the following order ..., if you have a member function, use the following order ..., etc.  I know that's a significant amount of writing, but I don't really have any intuition here about how it should work. So I'm not sure how to review this without a reference.  (The closest thing I have to intuition is comparing the rules to the ones for C++ anonymous namespaces, but visibility is a lot more complicated.)

Given how complicated the rules are here, it might be easier to understand if you teach the relevant code in clang/lib/AST/Decl.cpp (getExplicitVisibilityAux, I think?) to explicitly check for attributes on the original template, instead of cloning the attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153835



More information about the cfe-commits mailing list