diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/AST/CommentSema.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/AST/CommentSema.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/CommentSema.cpp b/contrib/llvm-project/clang/lib/AST/CommentSema.cpp index 067b3ae4222e..69d61dc55162 100644 --- a/contrib/llvm-project/clang/lib/AST/CommentSema.cpp +++ b/contrib/llvm-project/clang/lib/AST/CommentSema.cpp @@ -588,6 +588,8 @@ void Sema::checkReturnsCommand(const BlockCommandComment *Command) { if (isObjCPropertyDecl()) return; if (isFunctionDecl() || isFunctionOrBlockPointerVarLikeDecl()) { + assert(!ThisDeclInfo->ReturnType.isNull() && + "should have a valid return type"); if (ThisDeclInfo->ReturnType->isVoidType()) { unsigned DiagKind; switch (ThisDeclInfo->CommentDecl->getKind()) { @@ -873,6 +875,12 @@ bool Sema::isFunctionOrBlockPointerVarLikeDecl() { // can be ignored. if (QT->getAs<TypedefType>()) return false; + if (const auto *P = QT->getAs<PointerType>()) + if (P->getPointeeType()->getAs<TypedefType>()) + return false; + if (const auto *P = QT->getAs<BlockPointerType>()) + if (P->getPointeeType()->getAs<TypedefType>()) + return false; return QT->isFunctionPointerType() || QT->isBlockPointerType(); } |