[PATCH] D119646: [clang] Allow consteval functions in default arguments

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 12 19:41:52 PST 2022


erichkeane added inline comments.


================
Comment at: clang/lib/AST/Decl.cpp:2816
   if (auto *E = dyn_cast_or_null<FullExpr>(Arg))
-    return E->getSubExpr();
+    if (!isa<ConstantExpr>(E))
+      return E->getSubExpr();
----------------
So what is happening here?  I would still expect us to give the proper default-arg in this case?  What subtly am I missing?


================
Comment at: clang/lib/Sema/SemaExpr.cpp:18967
 
+  void VisitConstantExpr(ConstantExpr *E) {
+    // Don't mark declarations within a ConstantExpression, as this expression
----------------
This part makes sense to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119646



More information about the cfe-commits mailing list