summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-09-26 18:20:39 +0000
committerErich Keane <erich.keane@intel.com>2017-09-26 18:20:39 +0000
commit9d10bdf6448f8971e5c893d23bcb7d933a0efce4 (patch)
tree3e0e31760521c4cbbc2c1c631d9c536e42c0a830 /clang/lib/Sema
parentb379ba6a62efca54313c1a91ebc5da3dbe25f3c0 (diff)
downloadbcm5719-llvm-9d10bdf6448f8971e5c893d23bcb7d933a0efce4.tar.gz
bcm5719-llvm-9d10bdf6448f8971e5c893d23bcb7d933a0efce4.zip
[Sema] Corrected the warn-on-throw-from-noexcept behavior to include nothrow
Discovered that 'nothrow' (which is supposed to be an alias for noexcept) was not warning with a throw inside of it. This patch corrects the behavior previously created to add 'nothrow' to this list. Differential Revision: https://reviews.llvm.org/D38203 llvm-svn: 314229
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/AnalysisBasedWarnings.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 0b48838474a..08fc0802c6e 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -426,7 +426,7 @@ static void checkThrowInNonThrowingFunc(Sema &S, const FunctionDecl *FD,
static bool isNoexcept(const FunctionDecl *FD) {
const auto *FPT = FD->getType()->castAs<FunctionProtoType>();
- if (FPT->isNothrow(FD->getASTContext()))
+ if (FPT->isNothrow(FD->getASTContext()) || FD->hasAttr<NoThrowAttr>())
return true;
return false;
}
OpenPOWER on IntegriCloud