forked from OSchip/llvm-project
[clang][NFC] Fix and simplify the test added in 8dcc7eecb7
We only have to create a TypeTraitExpr node with 16 bits worth of arguments to detect an overflow with the assertion added in the constructor of TypeTraitExpr. Moreover the static_assert in original test is pointless since __is_constructible only check that the corresponding expression is well-formed.
This commit is contained in:
parent
edd819c757
commit
856ba638d5
|
@ -2831,13 +2831,7 @@ namespace ConstClass {
|
|||
}
|
||||
|
||||
namespace type_trait_expr_numargs_overflow {
|
||||
// Make sure that TypeTraitExpr can store 16 bits worth of arguments.
|
||||
struct S {
|
||||
template <typename... Ts> S(Ts... ts) {
|
||||
static_assert(sizeof...(ts) == 32768+1, "");
|
||||
}
|
||||
};
|
||||
|
||||
// Make sure that TypeTraitExpr can store 16 bits worth of arguments.
|
||||
#define T4(X) X,X,X,X
|
||||
#define T16(X) T4(X),T4(X),T4(X),T4(X)
|
||||
#define T64(X) T16(X),T16(X),T16(X),T16(X)
|
||||
|
@ -2846,11 +2840,7 @@ namespace type_trait_expr_numargs_overflow {
|
|||
#define T4096(X) T1024(X),T1024(X),T1024(X),T1024(X)
|
||||
#define T16384(X) T4096(X),T4096(X),T4096(X),T4096(X)
|
||||
#define T32768(X) T16384(X),T16384(X)
|
||||
|
||||
void test() {
|
||||
static_assert(__is_constructible(S, T32768(int), float), "");
|
||||
}
|
||||
|
||||
void test() { (void) __is_constructible(int, T32768(int)); }
|
||||
#undef T4
|
||||
#undef T16
|
||||
#undef T64
|
||||
|
@ -2859,5 +2849,4 @@ void test() {
|
|||
#undef T4096
|
||||
#undef T16384
|
||||
#undef T32768
|
||||
|
||||
} // namespace type_trait_expr_numargs_overflow
|
||||
|
|
Loading…
Reference in New Issue