From 519fc96c475680de2cc49e7811dbbfadb912cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:09 +0000 Subject: Vendor import of stripped clang trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/cfe/trunk@375505 --- lib/AST/CommentSema.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/AST/CommentSema.cpp') diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp index 067b3ae4222e..69d61dc55162 100644 --- a/lib/AST/CommentSema.cpp +++ b/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()) return false; + if (const auto *P = QT->getAs()) + if (P->getPointeeType()->getAs()) + return false; + if (const auto *P = QT->getAs()) + if (P->getPointeeType()->getAs()) + return false; return QT->isFunctionPointerType() || QT->isBlockPointerType(); } -- cgit v1.2.3