[clang] [clang][bytecode] Allow IntAP(S) in CastIntegralFixedPoint op (PR #196949)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 11 06:34:18 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/196949.diff
2 Files Affected:
- (modified) clang/lib/AST/ByteCode/Opcodes.td (+1-1)
- (modified) clang/test/AST/ByteCode/fixed-point.cpp (+5)
``````````diff
diff --git a/clang/lib/AST/ByteCode/Opcodes.td b/clang/lib/AST/ByteCode/Opcodes.td
index 3fb25a5fa0884..a9bac64636cc7 100644
--- a/clang/lib/AST/ByteCode/Opcodes.td
+++ b/clang/lib/AST/ByteCode/Opcodes.td
@@ -758,7 +758,7 @@ def CastPointerIntegralAPS : Opcode {
let Args = [ArgUint32];
}
def CastIntegralFixedPoint : Opcode {
- let Types = [FixedSizeIntegralTypeClass];
+ let Types = [IntegralTypeClass];
let Args = [ArgUint32];
let HasGroup = 1;
}
diff --git a/clang/test/AST/ByteCode/fixed-point.cpp b/clang/test/AST/ByteCode/fixed-point.cpp
index c8baa1972536a..fb44558fc037b 100644
--- a/clang/test/AST/ByteCode/fixed-point.cpp
+++ b/clang/test/AST/ByteCode/fixed-point.cpp
@@ -20,6 +20,11 @@ static_assert(A == 0.0k);
static_assert(A == 0);
static_assert(!A);
+#ifdef __SIZEOF_INT128__
+constexpr __int128 i128 = 42;
+static_assert(i128 == 42.0k, "");
+#endif
+
constexpr bool toBool() {
if (A)
return true;
``````````
</details>
https://github.com/llvm/llvm-project/pull/196949
More information about the cfe-commits
mailing list