diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-16 01:14:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-16 01:14:37 +0000 |
commit | 6ccab97c17c17f38eb92c7fe02c766508875bd97 (patch) | |
tree | 388b7372dc49e35e6d638f7bec30b83d13a62c6b /lib/Sema/SemaDeclCXX.cpp | |
parent | 8b1aba495744bea7093899a65f08c3987263061c (diff) |
Check for unexpanded parameter packs in friend declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 4a9abec583..0cf5f99b64 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -6383,6 +6383,9 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS, if (TheDeclarator.isInvalidType()) return 0; + if (DiagnoseUnexpandedParameterPack(Loc, TSI, UPPC_FriendDeclaration)) + return 0; + // This is definitely an error in C++98. It's probably meant to // be forbidden in C++0x, too, but the specification is just // poorly written. @@ -6482,6 +6485,12 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition, DeclarationName Name = NameInfo.getName(); assert(Name); + // Check for unexpanded parameter packs. + if (DiagnoseUnexpandedParameterPack(Loc, TInfo, UPPC_FriendDeclaration) || + DiagnoseUnexpandedParameterPack(NameInfo, UPPC_FriendDeclaration) || + DiagnoseUnexpandedParameterPack(SS, UPPC_FriendDeclaration)) + return 0; + // The context we found the declaration in, or in which we should // create the declaration. DeclContext *DC; |