]> granicus.if.org Git - clang/commit
Implement automatic bracket insertion for Objective-C class message
authorDouglas Gregor <dgregor@apple.com>
Thu, 16 Sep 2010 01:51:54 +0000 (01:51 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 16 Sep 2010 01:51:54 +0000 (01:51 +0000)
commit9497a73ad0d54859edbf48beb93ebb19a7ae50c9
treec71789bbb2dda9a909fb3655f088085e2f286d10
parentb36cd3e1757fb4fcd9509f35558c847b04bef35f
Implement automatic bracket insertion for Objective-C class message
sends. These are far trickier than instance messages, because we
typically have something like

  NSArray alloc]

where it appears to be a declaration of a variable named "alloc" up
until we see the ']' (or a ':'), and at that point we can't backtrace.
So, we use a combination of syntactic and semantic disambiguation to
treat this as a message send only when the type is an Objective-C type
and it has the syntax of a class message send (which would otherwise
be ill-formed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114057 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Parse/Parser.h
lib/Parse/ParseDecl.cpp
lib/Parse/ParseExpr.cpp
lib/Parse/ParseObjc.cpp
lib/Parse/ParseTentative.cpp
lib/Sema/SemaExprObjC.cpp
test/FixIt/fixit-objc-message.m