[clang] [clang] Decay types of function and constant template parameter packs (PR #132189)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 24 14:35:06 PDT 2025
================
@@ -1277,19 +1278,27 @@ QualType Sema::CheckNonTypeTemplateParameterType(TypeSourceInfo *&TSI,
TSI = SubstAutoTypeSourceInfoDependent(TSI);
}
- return CheckNonTypeTemplateParameterType(TSI->getType(), Loc);
+ return CheckNonTypeTemplateParameterType(TSI->getType(), Loc, Diagnose);
}
-bool Sema::RequireStructuralType(QualType T, SourceLocation Loc) {
+bool Sema::RequireStructuralType(QualType T, SourceLocation Loc,
+ bool Diagnose) {
if (T->isDependentType())
return false;
- if (RequireCompleteType(Loc, T, diag::err_template_nontype_parm_incomplete))
+ if (Diagnose ? RequireCompleteType(Loc, T,
+ diag::err_template_nontype_parm_incomplete)
+ : !isCompleteType(Loc, T))
return true;
if (T->isStructuralType())
return false;
+ // If we're not emitting diagnostics, there's no need to figure out
+ // why exactly T is not a structural type.
+ if (!Diagnose)
+ return true;
----------------
offsetof wrote:
Hm, there's an `isCompleteType` check a few lines above. Is that not sufficient?
https://github.com/llvm/llvm-project/pull/132189
More information about the cfe-commits
mailing list