[Openmp-commits] [lld] [mlir] [llvm] [openmp] [libcxxabi] [libunwind] [lldb] [libcxx] [clang] [compiler-rt] [flang] [libc] [clang-tools-extra] [C23] Implement N3018: The constexpr specifier for object definitions (PR #73099)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 5 07:38:37 PST 2023

@@ -13816,7 +13862,9 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {
     // C99 6.7.8p4. All file scoped initializers need to be constant.
-    if (!getLangOpts().CPlusPlus && !VDecl->isInvalidDecl())
+    // Avoid double diagnosing for constexpr variables.
cor3ntin wrote:

    // Avoid double diagnoses for constexpr variables.


More information about the Openmp-commits mailing list