diff options
author | Steve Naroff <snaroff@apple.com> | 2009-02-23 18:53:24 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-02-23 18:53:24 +0000 |
commit | 4262a07621043c19292f5fd90b1e426d65cd366c (patch) | |
tree | c259d103f7f208cf017a5ad9c21fcfb2467aadc7 /lib/Sema/SemaType.cpp | |
parent | d461777e23204fe8c480302d8ff76f5847605da6 (diff) |
- Generate error for protocol qualifiers on 'Class'.
- Generate error for protocol qualifiers on non-ObjC types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index acdeec6ba9..f8b277ae78 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -151,9 +151,13 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) { // id<protocol-list> Result = Context.getObjCQualifiedIdType((ObjCProtocolDecl**)PQ, DS.getNumProtocolQualifiers()); - else + else if (Result == Context.getObjCClassType()) + // Class<protocol-list> Diag(DS.getSourceRange().getBegin(), - diag::warn_ignoring_objc_qualifiers) << DS.getSourceRange(); + diag::err_qualified_class_unsupported) << DS.getSourceRange(); + else + Diag(DS.getSourceRange().getBegin(), + diag::err_invalid_protocol_qualifiers) << DS.getSourceRange(); } // TypeQuals handled by caller. break; |