diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-16 17:48:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-16 17:48:04 +0000 |
commit | a669c534cf414339060868d70d2348fea9ce6c7d (patch) | |
tree | c508a4afd5800a62813ae8f1af1c4ea14bc70cca /lib/Sema/SemaDeclCXX.cpp | |
parent | 099ffe812664e3a24164710c181c26e646391250 (diff) |
Add tests checking for unexpanded parameter packs in declarations that
occur within statements. Teach Sema::ActOnExceptionDeclarator() to
check for unexpanded parameter packs in the exception type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 54e69a1111..d257531565 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -6138,9 +6138,18 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S, /// handler. Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) { TypeSourceInfo *TInfo = GetTypeForDeclarator(D, S); + bool Invalid = D.isInvalidType(); + + // Check for unexpanded parameter packs. + if (TInfo && DiagnoseUnexpandedParameterPack(D.getIdentifierLoc(), TInfo, + UPPC_ExceptionType)) { + TInfo = Context.getTrivialTypeSourceInfo(Context.IntTy, + D.getIdentifierLoc()); + Invalid = true; + } + QualType ExDeclType = TInfo->getType(); - bool Invalid = D.isInvalidType(); IdentifierInfo *II = D.getIdentifier(); if (NamedDecl *PrevDecl = LookupSingleName(S, II, D.getIdentifierLoc(), LookupOrdinaryName, |