forked from OSchip/llvm-project
[Sema] Let getters assert that trailing return type exists, NFCI
This was requested in the review of D90129.
This commit is contained in:
parent
5dbccc6c89
commit
ebfc427bbe
|
@ -1502,10 +1502,14 @@ struct DeclaratorChunk {
|
||||||
bool hasTrailingReturnType() const { return HasTrailingReturnType; }
|
bool hasTrailingReturnType() const { return HasTrailingReturnType; }
|
||||||
|
|
||||||
/// Get the trailing-return-type for this function declarator.
|
/// Get the trailing-return-type for this function declarator.
|
||||||
ParsedType getTrailingReturnType() const { return TrailingReturnType; }
|
ParsedType getTrailingReturnType() const {
|
||||||
|
assert(HasTrailingReturnType);
|
||||||
|
return TrailingReturnType;
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the trailing-return-type location for this function declarator.
|
/// Get the trailing-return-type location for this function declarator.
|
||||||
SourceLocation getTrailingReturnTypeLoc() const {
|
SourceLocation getTrailingReturnTypeLoc() const {
|
||||||
|
assert(HasTrailingReturnType);
|
||||||
return SourceLocation::getFromRawEncoding(TrailingReturnTypeLoc);
|
return SourceLocation::getFromRawEncoding(TrailingReturnTypeLoc);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue