aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-02-18 17:52:36 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-02-18 17:52:36 +0000
commitba372b85524f712e5b97a176f6ce0197d365835d (patch)
tree9269ad70b414fe6efb71943109e5fb739b62ecc4 /lib/Sema/SemaType.cpp
parent60800081361b0ffc114877b8abbc81cb57b4edf6 (diff)
Cleanup objc's gc attributes code no longer needed.
This make warn-weak-field.m to fail (subject of a followup patch). attr-objc-gc.m no passes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 677f994cac..96800dd4d1 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -779,15 +779,20 @@ static void HandleAddressSpaceTypeAttribute(QualType &Type,
/// specified type. The attribute contains 1 argument, weak or strong.
static void HandleObjCGCTypeAttribute(QualType &Type,
const AttributeList &Attr, Sema &S){
- // FIXME. Needs more work for this to make sense.
+ // FIXME. change error code.
if (Type.getObjCGCAttr() != QualType::GCNone) {
S.Diag(Attr.getLoc(), diag::err_attribute_address_multiple_qualifiers);
return;
}
// Check the attribute arguments.
+ if (!Attr.getParameterName()) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_argument_n_not_string)
+ << "objc_gc" << 1;
+ return;
+ }
QualType::GCAttrTypes attr;
- if (!Attr.getParameterName() || Attr.getNumArgs() != 0) {
+ if (Attr.getNumArgs() != 0) {
S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
return;
}