summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-09 17:09:21 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-09 17:09:21 +0000
commit9f0e1aa0f2491d2f2ec1688d0975bb89ae7f9755 (patch)
tree17bd4f4c17e2027e3aa05219f84fdc4382998410 /clang/lib/Sema/SemaDeclCXX.cpp
parenta08318acb27b166fa0364910d958b3e5a8943a51 (diff)
downloadbcm5719-llvm-9f0e1aa0f2491d2f2ec1688d0975bb89ae7f9755.tar.gz
bcm5719-llvm-9f0e1aa0f2491d2f2ec1688d0975bb89ae7f9755.zip
Simplify template instantiation for C++ exception declarations,
eliminating an unnecessary use of TemporaryBase in the process. llvm-svn: 113500
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index e8aa1e6d5fe..86533cdb0fb 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -6077,13 +6077,13 @@ Decl *Sema::ActOnFinishLinkageSpecification(Scope *S,
/// \brief Perform semantic analysis for the variable declaration that
/// occurs within a C++ catch clause, returning the newly-created
/// variable.
-VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
+VarDecl *Sema::BuildExceptionDeclaration(Scope *S,
TypeSourceInfo *TInfo,
IdentifierInfo *Name,
- SourceLocation Loc,
- SourceRange Range) {
+ SourceLocation Loc) {
bool Invalid = false;
-
+ QualType ExDeclType = TInfo->getType();
+
// Arrays and functions decay.
if (ExDeclType->isArrayType())
ExDeclType = Context.getArrayDecayedType(ExDeclType);
@@ -6095,7 +6095,7 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType,
// incomplete type, other than [cv] void*.
// N2844 forbids rvalue references.
if (!ExDeclType->isDependentType() && ExDeclType->isRValueReferenceType()) {
- Diag(Loc, diag::err_catch_rvalue_ref) << Range;
+ Diag(Loc, diag::err_catch_rvalue_ref);
Invalid = true;
}
@@ -6213,10 +6213,9 @@ Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Invalid = true;
}
- VarDecl *ExDecl = BuildExceptionDeclaration(S, ExDeclType, TInfo,
+ VarDecl *ExDecl = BuildExceptionDeclaration(S, TInfo,
D.getIdentifier(),
- D.getIdentifierLoc(),
- D.getDeclSpec().getSourceRange());
+ D.getIdentifierLoc());
if (Invalid)
ExDecl->setInvalidDecl();
OpenPOWER on IntegriCloud