================
@@ -1979,6 +1979,9 @@ void clang::inferNoReturnAttr(Sema &S, const Decl *D) {
   if (!FD->hasAttr<NoReturnAttr>() && !FD->hasAttr<InferredNoReturnAttr>() &&
       isKnownToAlwaysThrow(FD)) {
     NonConstFD->addAttr(InferredNoReturnAttr::CreateImplicit(S.Context));
+
+    // Emit a diagnostic suggesting the function being marked [[noreturn]].
+    S.Diag(FD->getLocation(), diag::warn_suggest_noreturn_function) << 0 << FD;
----------------
erichkeane wrote:

```suggestion
    S.Diag(FD->getLocation(), diag::warn_suggest_noreturn_function) << 0 << FD;
```

We need some comment saying what `0` means here.  Typically we do something 
like: `/*THING_THIS_SELECTS=*/0` here.

https://github.com/llvm/llvm-project/pull/146234
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to