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 d5faa43 commit 7e647b9Copy full SHA for 7e647b9
clang/lib/AST/Decl.cpp
@@ -3880,7 +3880,19 @@ FunctionTypeLoc FunctionDecl::getFunctionTypeLoc() const {
3880
if (!TSI)
3881
return FunctionTypeLoc();
3882
3883
- return TSI->getTypeLoc().getAsAdjusted<FunctionTypeLoc>();
+ TypeLoc TL = TSI->getTypeLoc();
3884
+ FunctionTypeLoc FTL;
3885
+
3886
+ while (!(FTL = TL.getAs<FunctionTypeLoc>())) {
3887
+ if (auto PTL = TL.getAs<ParenTypeLoc>())
3888
+ TL = PTL.getInnerLoc();
3889
+ else if (auto ATL = TL.getAs<AttributedTypeLoc>())
3890
+ TL = ATL.getEquivalentTypeLoc();
3891
+ else
3892
+ break;
3893
+ }
3894
3895
+ return FTL;
3896
}
3897
3898
SourceRange FunctionDecl::getReturnTypeSourceRange() const {
0 commit comments