summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-04-21 19:24:29 +0000
committerBill Wendling <isanbard@gmail.com>2012-04-21 19:24:29 +0000
commiteaa8dfd29ce8f65585390b55e9bfd3b0c8d1eedd (patch)
tree1064945929add358fb331ce52b32f903fde1bb91 /include
parent103f41d0e72a9e52a07e19cbde58c3afc8735098 (diff)
Merging r155279:
------------------------------------------------------------------------ r155279 | chapuni | 2012-04-21 02:40:04 -0700 (Sat, 21 Apr 2012) | 1 line SemaDeclCXX.cpp: Fix utf8 in comment. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_31@155295 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/Type.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 9fd4901672..7b615c19dc 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -2701,7 +2701,8 @@ public:
ExtProtoInfo() :
Variadic(false), HasTrailingReturn(false), TypeQuals(0),
ExceptionSpecType(EST_None), RefQualifier(RQ_None),
- NumExceptions(0), Exceptions(0), NoexceptExpr(0), ExceptionSpecDecl(0),
+ NumExceptions(0), Exceptions(0), NoexceptExpr(0),
+ ExceptionSpecDecl(0), ExceptionSpecTemplate(0),
ConsumedArguments(0) {}
FunctionType::ExtInfo ExtInfo;
@@ -2714,6 +2715,7 @@ public:
const QualType *Exceptions;
Expr *NoexceptExpr;
FunctionDecl *ExceptionSpecDecl;
+ FunctionDecl *ExceptionSpecTemplate;
const bool *ConsumedArguments;
};
@@ -2759,9 +2761,10 @@ private:
// NoexceptExpr - Instead of Exceptions, there may be a single Expr* pointing
// to the expression in the noexcept() specifier.
- // ExceptionSpecDecl - Instead of Exceptions, there may be a single
- // FunctionDecl* pointing to the function which should be used to resolve
- // this function type's exception specification.
+ // ExceptionSpecDecl, ExceptionSpecTemplate - Instead of Exceptions, there may
+ // be a pair of FunctionDecl* pointing to the function which should be used to
+ // instantiate this function type's exception specification, and the function
+ // from which it should be instantiated.
// ConsumedArgs - A variable size array, following Exceptions
// and of length NumArgs, holding flags indicating which arguments
@@ -2804,6 +2807,7 @@ public:
EPI.NoexceptExpr = getNoexceptExpr();
} else if (EPI.ExceptionSpecType == EST_Uninstantiated) {
EPI.ExceptionSpecDecl = getExceptionSpecDecl();
+ EPI.ExceptionSpecTemplate = getExceptionSpecTemplate();
}
if (hasAnyConsumedArgs())
EPI.ConsumedArguments = getConsumedArgsBuffer();
@@ -2847,10 +2851,22 @@ public:
// NoexceptExpr sits where the arguments end.
return *reinterpret_cast<Expr *const *>(arg_type_end());
}
+ /// \brief If this function type has an uninstantiated exception
+ /// specification, this is the function whose exception specification
+ /// is represented by this type.
FunctionDecl *getExceptionSpecDecl() const {
if (getExceptionSpecType() != EST_Uninstantiated)
return 0;
- return *reinterpret_cast<FunctionDecl * const *>(arg_type_end());
+ return reinterpret_cast<FunctionDecl * const *>(arg_type_end())[0];
+ }
+ /// \brief If this function type has an uninstantiated exception
+ /// specification, this is the function whose exception specification
+ /// should be instantiated to find the exception specification for
+ /// this type.
+ FunctionDecl *getExceptionSpecTemplate() const {
+ if (getExceptionSpecType() != EST_Uninstantiated)
+ return 0;
+ return reinterpret_cast<FunctionDecl * const *>(arg_type_end())[1];
}
bool isNothrow(ASTContext &Ctx) const {
ExceptionSpecificationType EST = getExceptionSpecType();