1 //===--- ExceptionSpecificationType.h ---------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the ExceptionSpecificationType enumeration and various
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
15 #define LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
19 /// \brief The various types of exception specifications that exist in C++11.
20 enum ExceptionSpecificationType {
21 EST_None, ///< no exception specification
22 EST_DynamicNone, ///< throw()
23 EST_Dynamic, ///< throw(T1, T2)
24 EST_MSAny, ///< Microsoft throw(...) extension
25 EST_BasicNoexcept, ///< noexcept
26 EST_ComputedNoexcept, ///< noexcept(expression)
27 EST_Delayed, ///< not known yet
28 EST_Uninstantiated ///< not instantiated yet
31 inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) {
32 return ESpecType >= EST_DynamicNone && ESpecType <= EST_MSAny;
35 inline bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType) {
36 return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept;
39 /// \brief Possible results from evaluation of a noexcept expression.
46 inline CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2) {
47 // CanThrowResult constants are ordered so that the maximum is the correct
49 return CT1 > CT2 ? CT1 : CT2;
52 } // end namespace clang
54 #endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H