[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 12 02:19:41 PDT 2025
================
@@ -2253,6 +2260,60 @@ static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef,
}
}
+static void DiagnoseNonConstructibleReason(
+ Sema &SemaRef, SourceLocation Loc,
+ const llvm::SmallVector<clang::QualType, 1> &Ts) {
+ bool CompleteTypes = true;
+ for (const auto &ArgTy : Ts) {
+ if (ArgTy->isVoidType() || ArgTy->isIncompleteArrayType())
+ continue;
+ if (ArgTy->isIncompleteType()) {
+ SemaRef.Diag(Loc, diag::err_incomplete_type_used_in_type_trait_expr)
+ << ArgTy;
+ CompleteTypes = false;
+ }
+ }
+ if (!CompleteTypes)
+ return;
----------------
cor3ntin wrote:
Incomplete types should have been diagnosed already, so the check for incomplete type is not useful (we do need checks for void and incomplete array types)
https://godbolt.org/z/hc5jrjz51
https://github.com/llvm/llvm-project/pull/143309
More information about the cfe-commits
mailing list