diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-12 21:36:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-05-12 21:36:23 +0000 |
commit | 2bd617c46c6e8a8940214bd0afe64a52b4fc59e8 (patch) | |
tree | 28257bfb5047fb33e6f4394731f18f038559d1b3 /clang/lib | |
parent | 2399628cea7b5e1aa9836a9077ce00ee2f76187a (diff) | |
download | bcm5719-llvm-2bd617c46c6e8a8940214bd0afe64a52b4fc59e8.tar.gz bcm5719-llvm-2bd617c46c6e8a8940214bd0afe64a52b4fc59e8.zip |
Method attributes may only be specified on method
declarations.
llvm-svn: 71597
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 76e73fc650c..d854f0b50c6 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1671,6 +1671,8 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration( PrevMethod = ImpDecl->getClassMethod(Context, Sel); ImpDecl->addClassMethod(Context, ObjCMethod); } + if (AttrList) + Diag(EndLoc, diag::warn_attribute_method_def); } else if (ObjCCategoryImplDecl *CatImpDecl = dyn_cast<ObjCCategoryImplDecl>(ClassDecl)) { @@ -1681,6 +1683,8 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration( PrevMethod = CatImpDecl->getClassMethod(Context, Sel); CatImpDecl->addClassMethod(Context, ObjCMethod); } + if (AttrList) + Diag(EndLoc, diag::warn_attribute_method_def); } if (PrevMethod) { // You can never have two method definitions with the same name. |