Home | History | Annotate | Download | only in Basic
      1 //===--- ExceptionSpecificationType.h ---------------------------*- C++ -*-===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 //
     10 // This file defines the ExceptionSpecificationType enumeration and various
     11 // utility functions.
     12 //
     13 //===----------------------------------------------------------------------===//
     14 #ifndef LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
     15 #define LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
     16 
     17 namespace clang {
     18 
     19 /// \brief The various types of exception specifications that exist in C++0x.
     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 };
     29 
     30 inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) {
     31   return ESpecType >= EST_DynamicNone && ESpecType <= EST_MSAny;
     32 }
     33 
     34 inline bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType) {
     35   return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept;
     36 }
     37 
     38 } // end namespace clang
     39 
     40 #endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
     41