================
@@ -125,6 +130,18 @@ static bool isNoexcept(const FunctionDecl *FD) {
   return FPT && (FPT->isNothrow() || FD->hasAttr<NoThrowAttr>());
 }
 
+static bool isNoexcept(const Decl *D) {
+  if (const auto *FD = D->getAsFunction())
+    return isNoexcept(FD);
+  if (const auto *BD = dyn_cast<BlockDecl>(D)) {
+    if (auto *TSI = BD->getSignatureAsWritten()) {
+      auto *FPT = TSI->getType()->castAs<FunctionProtoType>();
+      return FPT->isNothrow() || BD->hasAttr<NoThrowAttr>();
----------------
dougsonos wrote:

This was the earlier implementation too but in any case, rewritten with getAs

https://github.com/llvm/llvm-project/pull/238401
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to