[clang] Don't wrap immediate invocations in ConstantExprs within constexpr initializers (PR #89565)

Daniel M. Katz via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 10:34:35 PDT 2024


================
@@ -2554,16 +2554,26 @@ Decl *Parser::ParseDeclarationAfterDeclarator(
   return ParseDeclarationAfterDeclaratorAndAttributes(D, TemplateInfo);
 }
 
+static bool isConstexprVariable(const Decl *D) {
+  if (const VarDecl *Var = dyn_cast_or_null<VarDecl>(D))
----------------
katzdm wrote:

Ah, good to know re: `*_or_null` being deprecated. Thanks.

I think I originally had this utility in `SemaDeclCXX.cpp`, where I copied its structure from a similar [`isNonlocalVariable()`](https://github.com/llvm/llvm-project/blob/35b292efc6fc31b884255d7cb46db7d6346c6f46/clang/lib/Sema/SemaDeclCXX.cpp#L18550-L18555) function. But I agree, I see no reason why this would be null.

https://github.com/llvm/llvm-project/pull/89565


More information about the cfe-commits mailing list