diff options
-rw-r--r-- | clang/include/clang/Sema/DeclSpec.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h index 33b57db..abbefc9 100644 --- a/clang/include/clang/Sema/DeclSpec.h +++ b/clang/include/clang/Sema/DeclSpec.h @@ -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); } }; |