aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBenjamin Maxwell <benjamin.maxwell@arm.com>2025-02-03 09:37:16 +0000
committerGitHub <noreply@github.com>2025-02-03 09:37:16 +0000
commit692c9b210728323ac499a402ee6eb901f35856f2 (patch)
treee8f862ea437007da4fe5566daba408b70fe66399 /clang/lib/CodeGen/CodeGenModule.cpp
parentcc72042a94b80b7b2f8f7c383ad6e157260b817f (diff)
downloadllvm-692c9b210728323ac499a402ee6eb901f35856f2.zip
llvm-692c9b210728323ac499a402ee6eb901f35856f2.tar.gz
llvm-692c9b210728323ac499a402ee6eb901f35856f2.tar.bz2
[clang] Support member function poiners in Decl::getFunctionType() (#125077)
This seems consistent with the documentation, which claims it: ``` /// Looks through the Decl's underlying type to extract a FunctionType /// when possible. Will return null if the type underlying the Decl does not /// have a FunctionType. const FunctionType *getFunctionType(bool BlocksToo = true) const; ``` Note: This patch rewords this doc comment to clarify it includes various function pointer types. Without this, attaching attributes (which use `HasFunctionProto`) to member function pointers errors with: ``` error: '<attr>' only applies to non-K&R-style functions ``` ...which does not really make sense, since member functions are not K&C functions. With this change the Arm SME TypeAttrs work correctly on member function pointers. Note, however, that not all attributes work correctly when applied to function pointers or member function pointers. For example, `alloc_align` crashes when applied to a function pointer (on truck): https://godbolt.org/z/YvMhnhKfx (as it only expects a `FunctionDecl` not a `ParmVarDecl`). The same crash applies to member function pointers (for the same reason).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions