diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -5304,6 +5304,8 @@ // variable t: // // T t(create()...); + if (Args.empty()) + return false; assert(!Args.empty()); // Precondition: T and all types in the parameter pack Args shall be diff --git a/clang/test/SemaCXX/type-trait-eval-crash-issue-57008.cpp b/clang/test/SemaCXX/type-trait-eval-crash-issue-57008.cpp new file mode 100644 --- /dev/null +++ b/clang/test/SemaCXX/type-trait-eval-crash-issue-57008.cpp @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -fsyntax-only %s + +// Shouldn't crash here +// Reported by https://github.com/llvm/llvm-project/issues/57008 +template bool b = __is_constructible(Ts...); +bool x = b<>;