forked from OSchip/llvm-project
Handle 128-bits IntegerLiterals in StmtPrinter
This fixes PR35677: "int128_t or uint128_t as non-type template parameter causes crash when considering invalid constructor".
This commit is contained in:
parent
414412d3dc
commit
4b5baa5b82
|
@ -1170,6 +1170,10 @@ void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) {
|
|||
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.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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>());
|
Loading…
Reference in New Issue