diff options
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index ff5f7a58927..803bd7de881 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -529,8 +529,16 @@ ObjCPropertyDecl *Sema::CreatePropertyDecl(Scope *S, if (IDecl->ClassImplementsProtocol(PNSCopying, true)) Diag(AtLoc, diag::warn_implements_nscopying) << PropertyId; } - if (T->isObjCObjectType()) - Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object); + + if (T->isObjCObjectType()) { + SourceLocation StarLoc = TInfo->getTypeLoc().getLocEnd(); + StarLoc = PP.getLocForEndOfToken(StarLoc); + Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object) + << FixItHint::CreateInsertion(StarLoc, "*"); + T = Context.getObjCObjectPointerType(T); + SourceLocation TLoc = TInfo->getTypeLoc().getLocStart(); + TInfo = Context.getTrivialTypeSourceInfo(T, TLoc); + } DeclContext *DC = cast<DeclContext>(CDecl); ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, DC, |

