[Sema] Let getters assert that trailing return type exists, NFCI

This was requested in the review of D90129.
This commit is contained in:
Aaron Puchert 2020-10-28 23:29:41 +01:00
parent 5dbccc6c89
commit ebfc427bbe
1 changed files with 5 additions and 1 deletions

View File

@ -1502,10 +1502,14 @@ struct DeclaratorChunk {
bool hasTrailingReturnType() const { return HasTrailingReturnType; }
/// 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.
SourceLocation getTrailingReturnTypeLoc() const {
assert(HasTrailingReturnType);
return SourceLocation::getFromRawEncoding(TrailingReturnTypeLoc);
}
};