-
Notifications
You must be signed in to change notification settings - Fork 15.3k
FunctionDecl::getFunctionTypeLoc: ignore function type attributes #118420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
b6f0130
d5faa43
7e647b9
21af94d
f125b5e
6d749da
3d18b08
94079e1
1470d04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3876,8 +3876,17 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const { | |
|
|
||
| FunctionTypeLoc FunctionDecl::getFunctionTypeLoc() const { | ||
| const TypeSourceInfo *TSI = getTypeSourceInfo(); | ||
| return TSI ? TSI->getTypeLoc().IgnoreParens().getAs<FunctionTypeLoc>() | ||
| : FunctionTypeLoc(); | ||
|
|
||
| if (!TSI) | ||
| return FunctionTypeLoc(); | ||
|
|
||
| TypeLoc TL = TSI->getTypeLoc().IgnoreParens(); | ||
|
|
||
| // ignore function type attributes | ||
| while (auto ATL = TL.getAs<AttributedTypeLoc>()) | ||
| TL = ATL.getModifiedLoc(); | ||
|
||
|
|
||
| return TL.getAs<FunctionTypeLoc>(); | ||
| } | ||
|
|
||
| SourceRange FunctionDecl::getReturnTypeSourceRange() const { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there other sugars we need to ignore? e.g., a
ParenTypevia:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. But to implement it in its updated form, I mimicked
getAsAdjusted. So currently, it supportsParenTypeandAttributedType. I think I should addMacroQualifiedTypefor example.