[clang] [clang] add `-fimplicit-constexpr` flag (PR #136436)

Hana Dusíková via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 19 15:28:33 PDT 2025


================
@@ -10163,6 +10163,16 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
     }
 
     ConstexprSpecKind ConstexprKind = D.getDeclSpec().getConstexprSpecifier();
+
+    // Clang's option -fimplicit-constexpr will make functions without constexpr
+    // or consteval specifier implicitly constexpr (compatibility with GCC.)
+    if (ConstexprKind == ConstexprSpecKind::Unspecified &&
+        getLangOpts().ImplicitConstexpr) {
----------------
hanickadot wrote:

changed that it only affects inline functions, it's easy to remove

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


More information about the cfe-commits mailing list