clang  13.0.0git
ExceptionSpecificationType.h
Go to the documentation of this file.
1 //===--- ExceptionSpecificationType.h ---------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// 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 /// The various types of exception specifications that exist in C++11.
21  EST_None, ///< no exception specification
22  EST_DynamicNone, ///< throw()
23  EST_Dynamic, ///< throw(T1, T2)
24  EST_MSAny, ///< Microsoft throw(...) extension
25  EST_NoThrow, ///< Microsoft __declspec(nothrow) extension
26  EST_BasicNoexcept, ///< noexcept
27  EST_DependentNoexcept,///< noexcept(expression), value-dependent
28  EST_NoexceptFalse, ///< noexcept(expression), evals to 'false'
29  EST_NoexceptTrue, ///< noexcept(expression), evals to 'true'
30  EST_Unevaluated, ///< not evaluated yet, for special member function
31  EST_Uninstantiated, ///< not instantiated yet
32  EST_Unparsed ///< not parsed yet
33 };
34 
36  return ESpecType >= EST_DynamicNone && ESpecType <= EST_MSAny;
37 }
38 
40  return ESpecType >= EST_DependentNoexcept &&
41  ESpecType <= EST_NoexceptTrue;
42 }
43 
45  return ESpecType == EST_BasicNoexcept || ESpecType == EST_NoThrow ||
46  isComputedNoexcept(ESpecType);
47 }
48 
50  return ESpecType == EST_Unevaluated || ESpecType == EST_Uninstantiated;
51 }
52 
53 /// Possible results from evaluation of a noexcept expression.
58 };
59 
61  // CanThrowResult constants are ordered so that the maximum is the correct
62  // merge result.
63  return CT1 > CT2 ? CT1 : CT2;
64 }
65 
66 } // end namespace clang
67 
68 #endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
clang::EST_None
@ EST_None
no exception specification
Definition: ExceptionSpecificationType.h:21
clang::EST_Dynamic
@ EST_Dynamic
throw(T1, T2)
Definition: ExceptionSpecificationType.h:23
clang::isUnresolvedExceptionSpec
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
Definition: ExceptionSpecificationType.h:49
clang::mergeCanThrow
CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2)
Definition: ExceptionSpecificationType.h:60
clang::CT_Cannot
@ CT_Cannot
Definition: ExceptionSpecificationType.h:55
clang::EST_Unparsed
@ EST_Unparsed
not parsed yet
Definition: ExceptionSpecificationType.h:32
clang::isComputedNoexcept
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
Definition: ExceptionSpecificationType.h:39
clang::EST_DependentNoexcept
@ EST_DependentNoexcept
noexcept(expression), value-dependent
Definition: ExceptionSpecificationType.h:27
clang::EST_Unevaluated
@ EST_Unevaluated
not evaluated yet, for special member function
Definition: ExceptionSpecificationType.h:30
clang::EST_NoexceptTrue
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
Definition: ExceptionSpecificationType.h:29
clang::isDynamicExceptionSpec
bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType)
Definition: ExceptionSpecificationType.h:35
clang::ExceptionSpecificationType
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
Definition: ExceptionSpecificationType.h:20
clang::CanThrowResult
CanThrowResult
Possible results from evaluation of a noexcept expression.
Definition: ExceptionSpecificationType.h:54
clang::CT_Dependent
@ CT_Dependent
Definition: ExceptionSpecificationType.h:56
clang::EST_DynamicNone
@ EST_DynamicNone
throw()
Definition: ExceptionSpecificationType.h:22
clang::CT_Can
@ CT_Can
Definition: ExceptionSpecificationType.h:57
clang::EST_Uninstantiated
@ EST_Uninstantiated
not instantiated yet
Definition: ExceptionSpecificationType.h:31
clang::EST_MSAny
@ EST_MSAny
Microsoft throw(...) extension.
Definition: ExceptionSpecificationType.h:24
clang::EST_NoThrow
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
Definition: ExceptionSpecificationType.h:25
clang
Dataflow Directional Tag Classes.
Definition: CalledOnceCheck.h:17
clang::EST_BasicNoexcept
@ EST_BasicNoexcept
noexcept
Definition: ExceptionSpecificationType.h:26
clang::EST_NoexceptFalse
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
Definition: ExceptionSpecificationType.h:28
clang::isNoexceptExceptionSpec
bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType)
Definition: ExceptionSpecificationType.h:44