================
@@ -82,6 +82,39 @@ class LifetimeChecker {
llvm_unreachable("unhandled causing fact in PointerUnion");
}
+ /// For an explicit specialization, returns the source-level specialization
+ /// declaration to target for attribute placement, if one exists. Skips
+ /// implicit specialization redeclarations that are backed by the template
+ /// pattern. In other cases, returns nullptr.
+ static const FunctionDecl *
+ getExplicitSpecializationDeclForAttr(const FunctionDecl *FDef) {
+ if (FDef->getTemplateSpecializationKindForInstantiation() !=
+ TSK_ExplicitSpecialization)
+ return nullptr;
+
+ auto IsImplicitTemplateSpecialization = [](const FunctionDecl *Redecl,
----------------
NeKon69 wrote:
Well, as far as can I see, there is no reliable way to distinguish between
clang-generated instantiations and user written ones, that is mostly because
they both fall under the same `TSK_ExplicitSpecialization` category..
https://github.com/llvm/llvm-project/pull/203866
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits