- Cleanup "hack" comment and fix typos.
- Use getLang().ObjC2 when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41333 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp
index 6ee190e..e4f1138 100644
--- a/Parse/Parser.cpp
+++ b/Parse/Parser.cpp
@@ -370,8 +370,8 @@
return Actions.ParsedFreeStandingDeclSpec(CurScope, DS);
}
- // OBJC: This grammar hack allows prefix attributes on class interfaces.
- if (Tok.getKind() == tok::at) {
+ // ObjC2 allows prefix attributes on class interfaces.
+ if (getLang().ObjC2 && Tok.getKind() == tok::at) {
SourceLocation AtLoc = ConsumeToken(); // the "@"
if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_interface)
return ParseObjCAtInterfaceDeclaration(AtLoc, DS.getAttributes());