[PATCH] D136554: Implement CWG2631

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 11:18:58 PDT 2022


shafik added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:9602-9604
+    return Ctx.Context ==
+               ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed ||
+           Ctx.IsCheckingDefaultArgumentOrInitializer;
----------------
aaron.ballman wrote:
> Hmm, it'd be nice to not name this with the same identifier as the `bool` member on line 1333, that surprised me a little bit when I ran into it below.
Why are we logically ORing an enumerator w/ a `bool`?


================
Comment at: clang/lib/Serialization/ASTReaderStmt.cpp:3831
+      S = CXXDefaultArgExpr::CreateEmpty(
+          Context, /*HasRewrittenInit*/ Record[ASTStmtReader::NumExprFields]);
       break;
----------------



================
Comment at: clang/lib/Serialization/ASTReaderStmt.cpp:3836
+      S = CXXDefaultInitExpr::CreateEmpty(
+          Context, /*HasRewrittenInit*/ Record[ASTStmtReader::NumExprFields]);
       break;
----------------



================
Comment at: clang/test/SemaCXX/cxx2a-consteval-default-params.cpp:10
+    {
+        return undefined();  // expected-error {{not a constant expression}} \
+                             // expected-note  {{undefined function 'undefined'}}
----------------
I don't think we expect a diagnostic here since `check_lambdas_unused` is never called.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136554/new/

https://reviews.llvm.org/D136554



More information about the cfe-commits mailing list