From: Chris Lattner Date: Fri, 3 Apr 2009 18:38:42 +0000 (+0000) Subject: add fixit advice to an archiac ObjC issue. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75e3606728e30e00b3be0779243b55305e167828;p=clang add fixit advice to an archiac ObjC issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68395 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 1f8d473891..83c02490fe 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -832,6 +832,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, DS.SetRangeEnd(EndProtoLoc); Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id) + << CodeModificationHint::CreateInsertion(Loc, "id") << SourceRange(Loc, EndProtoLoc); // Need to support trailing type qualifiers (e.g. "id

const"). // If a type specifier follows, it will be diagnosed elsewhere. diff --git a/test/FixIt/fixit-objc.m b/test/FixIt/fixit-objc.m new file mode 100644 index 0000000000..baef2337c1 --- /dev/null +++ b/test/FixIt/fixit-objc.m @@ -0,0 +1,8 @@ +// RUN: clang-cc -fsyntax-only -fixit-at=fixit-at.c:3:1 %s -o %t.m && +// RUN: clang-cc -verify %t.m + +@protocol X; + +void foo() { + *P; // should be fixed to 'id'. +}