================
@@ -17509,8 +17528,17 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const
DeclSpec &DS,
if (TheDeclarator.isInvalidType())
return nullptr;
- if (DiagnoseUnexpandedParameterPack(Loc, TSI, UPPC_FriendDeclaration))
+ // If '...' is present, the type must contain an unexpanded parameter
+ // pack, and vice versa.
+ if (EllipsisLoc.isInvalid() &&
+ DiagnoseUnexpandedParameterPack(Loc, TSI, UPPC_FriendDeclaration))
return nullptr;
+ if (EllipsisLoc.isValid() &&
+ !TSI->getType()->containsUnexpandedParameterPack()) {
+ Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
+ << TSI->getTypeLoc().getSourceRange();
+ EllipsisLoc = SourceLocation();
----------------
cor3ntin wrote:
Thanks
https://github.com/llvm/llvm-project/pull/101448
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits