summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/ExceptionSpecificationType.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/ExceptionSpecificationType.h')
-rw-r--r--include/clang/Basic/ExceptionSpecificationType.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/clang/Basic/ExceptionSpecificationType.h b/include/clang/Basic/ExceptionSpecificationType.h
index 98cfd297ad..e911bde191 100644
--- a/include/clang/Basic/ExceptionSpecificationType.h
+++ b/include/clang/Basic/ExceptionSpecificationType.h
@@ -16,7 +16,7 @@
namespace clang {
-/// \brief The various types of exception specifications that exist in C++0x.
+/// \brief The various types of exception specifications that exist in C++11.
enum ExceptionSpecificationType {
EST_None, ///< no exception specification
EST_DynamicNone, ///< throw()
@@ -24,7 +24,8 @@ enum ExceptionSpecificationType {
EST_MSAny, ///< Microsoft throw(...) extension
EST_BasicNoexcept, ///< noexcept
EST_ComputedNoexcept, ///< noexcept(expression)
- EST_Delayed ///< not known yet
+ EST_Delayed, ///< not known yet
+ EST_Uninstantiated ///< not instantiated yet
};
inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) {
@@ -35,6 +36,19 @@ inline bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType) {
return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept;
}
+/// \brief Possible results from evaluation of a noexcept expression.
+enum CanThrowResult {
+ CT_Cannot,
+ CT_Dependent,
+ CT_Can
+};
+
+inline CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2) {
+ // CanThrowResult constants are ordered so that the maximum is the correct
+ // merge result.
+ return CT1 > CT2 ? CT1 : CT2;
+}
+
} // end namespace clang
#endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H