[PATCH] D82880: [clang] Handle 128-bits IntegerLiterals in StmtPrinter
David Stone via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 25 11:26:46 PDT 2021
davidstone updated this revision to Diff 333369.
davidstone added a comment.
Reformatted
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82880/new/
https://reviews.llvm.org/D82880
Files:
clang/lib/AST/StmtPrinter.cpp
clang/test/AST/ast-print-int128.cpp
Index: clang/test/AST/ast-print-int128.cpp
===================================================================
--- /dev/null
+++ clang/test/AST/ast-print-int128.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -ast-print -std=c++20 %s -o - | FileCheck %s
+
+template <bool>
+struct enable_if {
+};
+
+template <__uint128_t x, typename = typename enable_if<x != 0>::type>
+void f();
+
+template <__int128_t>
+void f();
+
+using T = decltype(f<0>());
+
+// CHECK: using T = decltype(f<0>());
Index: clang/lib/AST/StmtPrinter.cpp
===================================================================
--- clang/lib/AST/StmtPrinter.cpp
+++ clang/lib/AST/StmtPrinter.cpp
@@ -1170,6 +1170,10 @@
case BuiltinType::ULong: OS << "UL"; break;
case BuiltinType::LongLong: OS << "LL"; break;
case BuiltinType::ULongLong: OS << "ULL"; break;
+ case BuiltinType::Int128:
+ break; // no suffix.
+ case BuiltinType::UInt128:
+ break; // no suffix.
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82880.333369.patch
Type: text/x-patch
Size: 953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210325/d3f6f437/attachment.bin>
More information about the cfe-commits
mailing list