================
@@ -2434,9 +2434,12 @@ Sema::PopFunctionScopeInfo(const 
AnalysisBasedWarnings::Policy *WP,
     OpenMP().popOpenMPFunctionRegion(Scope.get());
 
   // Issue any analysis-based warnings.
-  if (WP && D)
+  if (WP && D) {
+    if (auto *FD = dyn_cast<FunctionDecl>(D)) {
----------------
erichkeane wrote:

Instead of doing the cast here, can we have `inferNoReturnAttr` just take 
`Decl`, and early-exist if the cast isn't valid?  Cleans this up a little.

Additionally, this is a case where you'd have to skip curley braces per coding 
standard.

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

Reply via email to