We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb3f1ae commit b6f0130Copy full SHA for b6f0130
clang/lib/AST/Decl.cpp
@@ -3876,8 +3876,17 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const {
3876
3877
FunctionTypeLoc FunctionDecl::getFunctionTypeLoc() const {
3878
const TypeSourceInfo *TSI = getTypeSourceInfo();
3879
- return TSI ? TSI->getTypeLoc().IgnoreParens().getAs<FunctionTypeLoc>()
3880
- : FunctionTypeLoc();
+
+ if (!TSI)
3881
+ return FunctionTypeLoc();
3882
3883
+ TypeLoc TL = TSI->getTypeLoc().IgnoreParens();
3884
3885
+ // ignore function type attributes
3886
+ while (auto ATL = TL.getAs<AttributedTypeLoc>())
3887
+ TL = ATL.getModifiedLoc();
3888
3889
+ return TL.getAs<FunctionTypeLoc>();
3890
}
3891
3892
SourceRange FunctionDecl::getReturnTypeSourceRange() const {
0 commit comments