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 | 72772f65ec20d926203cffece00c7f16a3dc358e (patch) | |
| tree | 067d9dbe04e8f474e7a84395522fce8c14b0b725 /clang/lib | |
| parent | 03fcccbb47ddfb9ac70194e19b03638d0e7184ba (diff) | |
| download | bcm5719-llvm-72772f65ec20d926203cffece00c7f16a3dc358e.tar.gz bcm5719-llvm-72772f65ec20d926203cffece00c7f16a3dc358e.zip | |
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.
llvm-svn: 121984
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 54e69a11115..d2575315654 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/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, |

