diff options
author | Roy Jacobson <roi.jacobson1@gmail.com> | 2022-08-22 20:45:03 +0300 |
---|---|---|
committer | Roy Jacobson <roi.jacobson1@gmail.com> | 2022-08-23 21:48:42 +0300 |
commit | 7171615099142ed49042c0f27af437b05150dd9b (patch) | |
tree | f0467e4fb64152286977a942b5adf95c6169a850 /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | ba8b5ff874ad438a07ac3cc4f2bc75898b1401f8 (diff) | |
download | llvm-7171615099142ed49042c0f27af437b05150dd9b.zip llvm-7171615099142ed49042c0f27af437b05150dd9b.tar.gz llvm-7171615099142ed49042c0f27af437b05150dd9b.tar.bz2 |
[Clang] Implement P0848 (Conditionally Trivial Special Member Functions)
This patch implements P0848 in Clang.
During the instantiation of a C++ class, in `Sema::ActOnFields`, we evaluate constraints for all the SMFs and compare the constraints to compute the eligibility. We defer the computation of the type's [copy-]trivial bits from addedMember to the eligibility computation, like we did for destructors in D126194. `canPassInRegisters` is modified as well to better respect the ineligibility of functions.
Note: Because of the non-implementation of DR1734 and DR1496, I treat deleted member functions as 'eligible' for the purpose of [copy-]triviallity. This is unfortunate, but I couldn't think of a way to make this make sense otherwise.
Reviewed By: #clang-language-wg, cor3ntin, aaron.ballman
Differential Revision: https://reviews.llvm.org/D128619
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 20bfbf1..eff811e 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -674,6 +674,9 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, // C++20 features. if (LangOpts.CPlusPlus20) { //Builder.defineMacro("__cpp_aggregate_paren_init", "201902L"); + // P0848 is implemented, but we're still waiting for other concepts + // issues to be addressed before bumping __cpp_concepts up to 202002L. + // Refer to the discussion of this at https://reviews.llvm.org/D128619. Builder.defineMacro("__cpp_concepts", "201907L"); Builder.defineMacro("__cpp_conditional_explicit", "201806L"); //Builder.defineMacro("__cpp_consteval", "201811L"); |