[clang] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 31 03:53:53 PST 2024


================
@@ -453,8 +453,12 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
     if (LangOpts.CPlusPlus26)
       // FIXME: Use correct value for C++26.
       Builder.defineMacro("__cplusplus", "202400L");
-    else if (LangOpts.CPlusPlus23)
+    else if (LangOpts.CPlusPlus23) {
       Builder.defineMacro("__cplusplus", "202302L");
+      // [C++23] 15.11p2 [cpp.predefined]
+      Builder.defineMacro("__STDCPP_FLOAT16_T__", "1");
----------------
cor3ntin wrote:

Right there is `TargetInfo::hasFloat16Type` / `hasFullBFloat16Type`.
We probably want to check that both here, and when creating such type during parsing

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


More information about the cfe-commits mailing list