[PATCH] D128619: [Clang] Implement P0848 (Conditionally Trivial Special Member Functions)
Corentin Jabot via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 15 05:29:51 PDT 2022
cor3ntin added inline comments.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:17863-17869
+/// Assuming the suggested solution to CWG2595 gets accepted:
+/// [class.mem.special]p6:
+/// An eligible special member function is a special member function for which:
+/// - the function is not deleted,
+/// - the associated constraints, if any, are satisfied, and
+/// - no special member function of the same kind whose associated constraints,
+/// if any, are satisfied is more constrained.
----------------
================
Comment at: clang/lib/Sema/SemaDecl.cpp:17916
+
+ auto SetEligibleMethods = [&S, &Record,
+ AreSameKind](ArrayRef<CXXMethodDecl *> Methods,
----------------
That could be a separate (static) function
================
Comment at: clang/lib/Sema/SemaDecl.cpp:17937
+ continue;
+ auto *MethodI = Methods[i];
+ const Expr *ConstraintsI = MethodI->getTrailingRequiresClause();
----------------
You should probably be explicit about the type here.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:17960-17961
+ }
+ if (AnotherMethodIsMoreConstrained)
+ break;
+ }
----------------
Is that codepath ever taken?
I wonder if there is a way to do that that is not n^2. Maybe not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128619/new/
https://reviews.llvm.org/D128619
More information about the cfe-commits
mailing list