diff options
author | Erich Keane <erich.keane@intel.com> | 2017-09-28 20:47:10 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-09-28 20:47:10 +0000 |
commit | 97dfc4ab28210e6b14a996eee1abc7c563182427 (patch) | |
tree | 2d4d665928c7db7a19df4b107541c305938caef2 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | c372e15c4e4a448e43924ad3405e81ed771c928c (diff) | |
download | bcm5719-llvm-97dfc4ab28210e6b14a996eee1abc7c563182427.tar.gz bcm5719-llvm-97dfc4ab28210e6b14a996eee1abc7c563182427.zip |
[Sema] Correct nothrow inherited by noexcept
As reported in https://bugs.llvm.org/show_bug.cgi?id=33235,
a noexcept function was unable to inherit from a nothrow defaulted
constructor. Attribute "nothrow" is supposed to be semantically
identical to noexcept, and in fact, a number of other places in the
code treat them identically.
This patch simply checks the RecordDecl for the correct attribute in
the case where no other exception specifier was set.
Differential Revision: https://reviews.llvm.org/D38209
llvm-svn: 314462
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 492694d07ef..82e112bb3f9 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -167,6 +167,9 @@ Sema::ImplicitExceptionSpecification::CalledDecl(SourceLocation CallLoc, if (ComputedEST == EST_None) return; + if (EST == EST_None && Method->hasAttr<NoThrowAttr>()) + EST = EST_BasicNoexcept; + switch(EST) { // If this function can throw any exceptions, make a note of that. case EST_MSAny: |