diff options
author | Erich Keane <erich.keane@intel.com> | 2019-05-30 17:31:54 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2019-05-30 17:31:54 +0000 |
commit | d02f4a1043c0c6b472e6cfeb8a34f282d7cccb31 (patch) | |
tree | bdbc7d80e0e10cf8566b6ae2e458bc17cfa1fd79 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 51ce0b196a8babe7ac8b81da69139a2eae3cca0b (diff) | |
download | bcm5719-llvm-d02f4a1043c0c6b472e6cfeb8a34f282d7cccb31.tar.gz bcm5719-llvm-d02f4a1043c0c6b472e6cfeb8a34f282d7cccb31.zip |
Add Attribute NoThrow as an Exception Specifier Type
In response to https://bugs.llvm.org/show_bug.cgi?id=33235, it became
clear that the current mechanism of hacking through checks for the
exception specification of a function gets confused really quickly when
there are alternate exception specifiers.
This patch introcues EST_NoThrow, which is the equivilent of
EST_noexcept when caused by EST_noThrow. The existing implementation is
left in place to cover functions with no FunctionProtoType.
Differential Revision: https://reviews.llvm.org/D62435
llvm-svn: 362119
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 00b158debc5..6e67968929a 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -6045,6 +6045,8 @@ mergeExceptionSpecs(Sema &S, FunctionProtoType::ExceptionSpecInfo ESI1, if (EST2 == EST_NoexceptFalse) return ESI2; // If either of them is non-throwing, the result is the other. + if (EST1 == EST_NoThrow) return ESI2; + if (EST2 == EST_NoThrow) return ESI1; if (EST1 == EST_DynamicNone) return ESI2; if (EST2 == EST_DynamicNone) return ESI1; if (EST1 == EST_BasicNoexcept) return ESI2; @@ -6073,6 +6075,7 @@ mergeExceptionSpecs(Sema &S, FunctionProtoType::ExceptionSpecInfo ESI1, case EST_DependentNoexcept: case EST_NoexceptFalse: case EST_NoexceptTrue: + case EST_NoThrow: llvm_unreachable("handled above"); case EST_Dynamic: { |