[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)
Joshua Cranmer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 14:37:54 PST 2025
================
@@ -7670,27 +7739,68 @@ static FloatingRank getFloatingRank(QualType T) {
}
}
+/// C++23 6.8.5 [conv.rank]
/// getFloatingTypeOrder - Compare the rank of the two specified floating
/// point types, ignoring the domain of the type (i.e. 'double' ==
-/// '_Complex double'). If LHS > RHS, return 1. If LHS == RHS, return 0. If
-/// LHS < RHS, return -1.
-int ASTContext::getFloatingTypeOrder(QualType LHS, QualType RHS) const {
+/// '_Complex double').
+/// If LHS > RHS, return FRCR_Greater. If LHS == RHS, return FRCR_Equal. If
+/// LHS < RHS, return FRCR_Lesser. If the values representable by the two
+/// are not subset of each other, return FRCR_Unordered. If LHS == RHS but
+/// LHS has a higher subrank than RHS return FRCR_Equal_Greater_Subrank else
+/// return FRCR_Equal_Lesser_Subrank.
+FloatConvRankCompareResult
+ASTContext::getFloatingTypeOrder(QualType LHS, QualType RHS) const {
+ if (LHS->isCXX23FloatingPointType(*this) &&
----------------
jcranmer-intel wrote:
I think it's worth explicitly calling out in a comment here that C and C++ have different rules for the extended floating-point types.
https://github.com/llvm/llvm-project/pull/78503
More information about the llvm-commits
mailing list