diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2013-11-27 18:53:58 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2013-11-27 18:53:58 +0000 |
| commit | 3a8e2d9136995a70f9c60e2729fbb78f874ad6f8 (patch) | |
| tree | e1eb2e550c76d234d6e2478867d67ebcaeaf2da7 /clang/lib/Sema | |
| parent | 3dc549dbe38a3878df91947ac784894268105d27 (diff) | |
| download | bcm5719-llvm-3a8e2d9136995a70f9c60e2729fbb78f874ad6f8.tar.gz bcm5719-llvm-3a8e2d9136995a70f9c60e2729fbb78f874ad6f8.zip | |
Adding the Subjects entry back for the noreturn attributes. This caused some test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods.
llvm-svn: 195862
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index a8d336e2293..ccbf9ac1356 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1672,23 +1672,6 @@ static void handleAnalyzerNoReturnAttr(Sema &S, Decl *D, Attr.getAttributeSpellingListIndex())); } -static void handleCXX11NoReturnAttr(Sema &S, Decl *D, - const AttributeList &Attr) { - // C++11 [dcl.attr.noreturn]p1: - // The attribute may be applied to the declarator-id in a function - // declaration. - FunctionDecl *FD = dyn_cast<FunctionDecl>(D); - if (!FD) { - S.Diag(Attr.getLoc(), diag::err_attribute_wrong_decl_type) - << Attr.getName() << ExpectedFunctionOrMethod; - return; - } - - D->addAttr(::new (S.Context) - CXX11NoReturnAttr(Attr.getRange(), S.Context, - Attr.getAttributeSpellingListIndex())); -} - // PS3 PPU-specific. static void handleVecReturnAttr(Sema &S, Decl *D, const AttributeList &Attr) { /* @@ -4195,8 +4178,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_CUDAConstant:handleConstantAttr (S, D, Attr); break; case AttributeList::AT_Constructor: handleConstructorAttr (S, D, Attr); break; case AttributeList::AT_CXX11NoReturn: - handleCXX11NoReturnAttr(S, D, Attr); - break; + handleSimpleAttribute<CXX11NoReturnAttr>(S, D, Attr); break; case AttributeList::AT_Deprecated: handleAttrWithMessage<DeprecatedAttr>(S, D, Attr); break; |

