With this commit, we now successfully parse "Cocoa.h"!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41303 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp
index d4017bb..e5c5bb9 100644
--- a/Parse/ParseDecl.cpp
+++ b/Parse/ParseDecl.cpp
@@ -356,8 +356,7 @@
/// [GNU] '_Decimal128'
/// [GNU] typeof-specifier
/// [OBJC] class-name objc-protocol-refs[opt] [TODO]
-/// [OBJC] typedef-name objc-protocol-refs [TODO]
-/// [OBJC] objc-protocol-refs [TODO]
+/// [OBJC] typedef-name objc-protocol-refs[opt] [TODO]
/// type-qualifier:
/// 'const'
/// 'volatile'
@@ -384,7 +383,15 @@
CurScope)) {
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typedef, Loc, PrevSpec,
TypeRep);
- break;
+ if (isInvalid)
+ break;
+ else { // FIXME: restrict this to "id" and ObjC classnames.
+ DS.Range.setEnd(Tok.getLocation());
+ ConsumeToken(); // The identifier
+ if (Tok.getKind() == tok::less)
+ ParseObjCProtocolReferences();
+ continue;
+ }
}
}
// FALL THROUGH.