[clang] Thread Safety Analysis: Support attributes on function pointers (PR #191187)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 30 06:15:24 PDT 2026
================
@@ -674,15 +684,27 @@ void Parser::ParseGNUAttributeArgs(
// These may refer to the function arguments, but need to be parsed early to
// participate in determining whether it's a redeclaration.
std::optional<ParseScope> PrototypeScope;
- if (normalizeAttrName(AttrName->getName()) == "enable_if" &&
- D && D->isFunctionDeclarator()) {
- const DeclaratorChunk::FunctionTypeInfo& FTI = D->getFunctionTypeInfo();
- PrototypeScope.emplace(this, Scope::FunctionPrototypeScope |
- Scope::FunctionDeclarationScope |
- Scope::DeclScope);
- for (unsigned i = 0; i != FTI.NumParams; ++i)
- Actions.ActOnReenterCXXMethodParameter(
- getCurScope(), dyn_cast_or_null<ParmVarDecl>(FTI.Params[i].Param));
+ if (D && IsAttributeArgsParsedInFunctionScope(*AttrName)) {
----------------
AaronBallman wrote:
Should this still be checking for `D->isFunctionDeclarator()`?
https://github.com/llvm/llvm-project/pull/191187
More information about the cfe-commits
mailing list