[clang] [Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (PR #101448)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 16:57:06 PDT 2024


================
@@ -754,6 +754,10 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
     Builder.defineMacro("__cpp_multidimensional_subscript", "202211L");
     Builder.defineMacro("__cpp_auto_cast", "202110L");
   }
+  // C++26 features.
+  if (LangOpts.CPlusPlus26) {
+    Builder.defineMacro("__cpp_variadic_friend", "202403L");
+  }
----------------
Sirraide wrote:

We actually don’t define `__cpp_pack_indexing` yet, and the other C++26 features that we support that have a feature-test macro are also exposed in previous language modes, so this would be the first one that’s (currently) C++26 only (though, again, maybe we want to expose this one in older language modes too?).

I don’t actually know if this is the case, but I’m assuming the reason why we don’t define `__cpp_pack_indexing` is because there is a chance that the syntax might change or something like that?

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


More information about the cfe-commits mailing list