llvm-project/clang/lib/Parse
Douglas Gregor 8d4de67e1d Implement parsing for message sends in Objective-C++. Message sends in
Objective-C++ have a more complex grammar than in Objective-C
(surprise!), because

  (1) The receiver of an instance message can be a qualified name such
  as ::I or identity<I>::type.
  (2) Expressions in C++ can start with a type.

The receiver grammar isn't actually ambiguous; it just takes a bit of
work to parse past the type before deciding whether we have a type or
expression. We do this in two places within the grammar: once for
message sends and once when we're determining whether a []'d clause in
an initializer list is a message send or a C99 designated initializer.

This implementation of Objective-C++ message sends contains one known
extension beyond GCC's implementation, which is to permit a
typename-specifier as the receiver type for a class message, e.g.,

  [typename compute_receiver_type<T>::type method];

Note that the same effect can be achieved in GCC by way of a typedef,
e.g.,

  typedef typename computed_receiver_type<T>::type Computed;
  [Computed method];

so this is merely a convenience.

Note also that message sends still cannot involve dependent types or
values.

llvm-svn: 102031
2010-04-21 22:36:40 +00:00
..
AttributeList.cpp other half of r101005 2010-04-12 02:18:49 +00:00
CMakeLists.txt Reorder files. 2009-07-21 21:03:50 +00:00
DeclSpec.cpp Keep track of the actual storage specifier written on a variable or 2010-04-19 22:54:31 +00:00
Makefile Allow users to set CPPFLAGS and CXXFLAGS on the make command line. 2010-03-12 22:55:16 +00:00
MinimalAction.cpp Migrate the responsibility for turning the receiver name in an 2010-04-21 20:38:13 +00:00
ParseCXXInlineMethods.cpp Fix 80-cols violtaions 2010-04-14 23:07:37 +00:00
ParseDecl.cpp Audit uses of Sema::LookupSingleName for those lookups that are 2010-04-15 23:40:53 +00:00
ParseDeclCXX.cpp Parse friend template ids as types instead of ending up in 2010-04-14 00:24:33 +00:00
ParseExpr.cpp Implement parsing for message sends in Objective-C++. Message sends in 2010-04-21 22:36:40 +00:00
ParseExprCXX.cpp Implement parsing for message sends in Objective-C++. Message sends in 2010-04-21 22:36:40 +00:00
ParseInit.cpp Implement parsing for message sends in Objective-C++. Message sends in 2010-04-21 22:36:40 +00:00
ParseObjc.cpp Implement parsing for message sends in Objective-C++. Message sends in 2010-04-21 22:36:40 +00:00
ParsePragma.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
ParsePragma.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
ParseStmt.cpp change Scope::WithinElse to be a normal scope flag, widen the 2010-04-12 06:12:50 +00:00
ParseTemplate.cpp Reinstate my CodeModificationHint -> FixItHint renaming patch, without 2010-03-31 17:46:05 +00:00
ParseTentative.cpp Fix an assertion-on-error during tentative constructor parsing by 2010-02-26 08:45:28 +00:00
Parser.cpp Diagnose misordered initializers in constructor templates immediately instead of 2010-04-10 07:37:23 +00:00
RAIIObjectsForParser.h Privatize class members. 2009-12-10 21:50:21 +00:00