summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-10-02 17:16:14 +0000
committerReid Kleckner <rnk@google.com>2017-10-02 17:16:14 +0000
commita3fe27f6b574438a8cac72e819454b84c021bf34 (patch)
tree607345dbab37d15899c7968149b451a45c6a9d42 /clang/lib
parent6deb21252212271207704be29f65037c0f5bd2cf (diff)
downloadbcm5719-llvm-a3fe27f6b574438a8cac72e819454b84c021bf34.tar.gz
bcm5719-llvm-a3fe27f6b574438a8cac72e819454b84c021bf34.zip
Revert "[Sema] Warn on attribute nothrow conflicting with language specifiers"
This reverts r314461. It is warning on user code that uses END_COM_MAP(), which expands to declare QueryInterface with conflicting exception specifers. I've spent a while trying to understand why, but haven't been able to extract a reduced test case. Let's revert and I'll keep trying. llvm-svn: 314689
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 2a13c9576c7..1f4be4405b5 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -1985,25 +1985,6 @@ static void handleNoReturnAttr(Sema &S, Decl *D, const AttributeList &Attrs) {
Attrs.getRange(), S.Context, Attrs.getAttributeSpellingListIndex()));
}
-static void handleNoThrowAttr(Sema &S, Decl *D, const AttributeList &Attrs) {
- assert(isa<FunctionDecl>(D) && "attribute nothrow only valid on functions");
-
- auto *FD = cast<FunctionDecl>(D);
- const auto *FPT = FD->getType()->getAs<FunctionProtoType>();
-
- if (FPT && FPT->hasExceptionSpec() &&
- FPT->getExceptionSpecType() != EST_BasicNoexcept) {
- S.Diag(Attrs.getLoc(),
- diag::warn_nothrow_attr_disagrees_with_exception_specification);
- S.Diag(FD->getExceptionSpecSourceRange().getBegin(),
- diag::note_previous_decl)
- << "exception specification";
- }
-
- D->addAttr(::new (S.Context) NoThrowAttr(
- Attrs.getRange(), S.Context, Attrs.getAttributeSpellingListIndex()));
-}
-
static void handleNoCallerSavedRegsAttr(Sema &S, Decl *D,
const AttributeList &Attr) {
if (S.CheckNoCallerSavedRegsAttr(Attr))
@@ -6230,7 +6211,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
handleNoReturnAttr(S, D, Attr);
break;
case AttributeList::AT_NoThrow:
- handleNoThrowAttr(S, D, Attr);
+ handleSimpleAttribute<NoThrowAttr>(S, D, Attr);
break;
case AttributeList::AT_CUDAShared:
handleSharedAttr(S, D, Attr);
OpenPOWER on IntegriCloud