================
@@ -17354,12 +17354,18 @@ Decl 
*Sema::BuildStaticAssertDeclaration(SourceLocation StaticAssertLoc,
 DeclResult Sema::ActOnTemplatedFriendTag(
     Scope *S, SourceLocation FriendLoc, unsigned TagSpec, SourceLocation 
TagLoc,
     CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc,
-    const ParsedAttributesView &Attr, MultiTemplateParamsArg TempParamLists) {
+    SourceLocation EllipsisLoc, const ParsedAttributesView &Attr,
+    MultiTemplateParamsArg TempParamLists) {
   TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForTypeSpec(TagSpec);
 
   bool IsMemberSpecialization = false;
   bool Invalid = false;
 
+  // FIXME: This works for now; revisit once we support packs in NNSs.
+  if (EllipsisLoc.isValid())
+    Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
+        << SourceRange(FriendLoc, NameLoc);
+
----------------
Sirraide wrote:

Iirc, ‘all of the invalid ones involving templates’ for want of a better way of 
putting it. This seems to work for any friend declarations w/ a template-head 
that we can’t handle anyway (because the NNS contains an unexpanded pack or is 
dependent). This is not a particularly good way of doing it (hence the FIXME) 
and it’s basically where I left off when trying to figure out all the possible 
code paths where we need to issue an error about a variadic friend declaration 
being invalid.

I’ll take another look at this once we have clarification on the cwg issue you 
opened earlier. Also, on that note, how would I check whether a friend 
declaration is trying to expand a pack that is part of the declaration itself, 
as opposed to some other pack?

https://github.com/llvm/llvm-project/pull/101448
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to