[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 03:09:12 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff dc974573a8a2364f24ce69c75ad80ab30753fe9a 699f47bba02012523e1862f9b15ce9de1d7511b5 -- clang/test/SemaCXX/cxx23-invalid-constexpr.cpp clang/lib/Sema/SemaDeclCXX.cpp clang/test/AST/Interp/cxx23.cpp clang/test/AST/Interp/literals.cpp clang/test/AST/Interp/shifts.cpp clang/test/CXX/basic/basic.types/p10.cpp clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p6.cpp clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp clang/test/CXX/drs/dr13xx.cpp clang/test/CXX/drs/dr14xx.cpp clang/test/CXX/drs/dr16xx.cpp clang/test/CXX/drs/dr6xx.cpp clang/test/CXX/expr/expr.const/p2-0x.cpp clang/test/CXX/expr/expr.const/p5-26.cpp clang/test/CXX/special/class.copy/p13-0x.cpp clang/test/PCH/cxx11-constexpr.cpp clang/test/SemaCXX/builtin_vectorelements.cpp clang/test/SemaCXX/constant-expression-cxx11.cpp clang/test/SemaCXX/constant-expression-cxx14.cpp clang/test/SemaCXX/constant-expression-cxx2b.cpp clang/test/SemaCXX/constexpr-function-recovery-crash.cpp clang/test/SemaCXX/cxx1z-constexpr-lambdas.cpp clang/test/SemaCXX/cxx2a-consteval.cpp clang/test/SemaCXX/deduced-return-type-cxx14.cpp clang/test/SemaCXX/ms-constexpr-invalid.cpp clang/test/SemaCXX/ms-constexpr.cpp clang/test/SemaCXX/sizeless-1.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index aa49dc73e1..20c8c3ef6c 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -7881,8 +7881,8 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD,
               << CSM << MD->isConsteval();
         }
     // FIXME: Explain why the special member can't be constexpr.
-    if (!getLangOpts().CPlusPlus23)
-      HadError = true;
+        if (!getLangOpts().CPlusPlus23)
+          HadError = true;
   }
 
   if (First) {

``````````

</details>


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


More information about the cfe-commits mailing list