diff options
author | Anders Carlsson <andersca@mac.com> | 2008-08-24 16:33:25 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-08-24 16:33:25 +0000 |
commit | 6e14a8f2ac4af8e3741eac8e9dccec0061bc7166 (patch) | |
tree | 279bcd8923e5ac8d64ed7ffaabe0ec3b6c203c3c /lib/Sema/SemaDeclAttr.cpp | |
parent | a88b509d233d3f42382130c159c05cafa006b3e0 (diff) |
Fix silly bug in objc_gc attribute parsing and add test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 2cfb3b9b96..f94711e987 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -467,7 +467,7 @@ static void HandleVisibilityAttr(Decl *d, const AttributeList &Attr, Sema &S) { } static void HandleObjCGCAttr(Decl *d, const AttributeList &Attr, Sema &S) { - if (!Attr.getParameterName()) { + if (!Attr.getParameterName()) { S.Diag(Attr.getLoc(), diag::err_attribute_argument_n_not_string, "objc_gc", std::string("1")); return; @@ -486,7 +486,7 @@ static void HandleObjCGCAttr(Decl *d, const AttributeList &Attr, Sema &S) { if (TypeLen == 4 && !memcmp(TypeStr, "weak", 4)) type = ObjCGCAttr::Weak; - else if (TypeLen == 5 && !memcmp(TypeStr, "strong", 5)) + else if (TypeLen == 6 && !memcmp(TypeStr, "strong", 6)) type = ObjCGCAttr::Strong; else { S.Diag(Attr.getLoc(), diag::warn_attribute_type_not_supported, |