Fix http://llvm.org/bugs/show_bug.cgi?id=2816.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index e81a8b8..80970a2 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -445,9 +445,9 @@
       
       DS.SetRangeEnd(EndProtoLoc);
 
-      // Do not allow any other declspecs after the protocol qualifier list
-      // "<foo,bar>short" is not allowed.
-      goto DoneWithDeclSpec;
+      // Need to support trailing type qualifiers (e.g. "id<p> const").
+      // If a type specifier follows, it will be diagnosed elsewhere.
+      continue;
     }
     // GNU attributes support.
     case tok::kw___attribute:
@@ -585,9 +585,9 @@
 
         Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id,
              SourceRange(Loc, EndProtoLoc));
-        // Do not allow any other declspecs after the protocol qualifier list
-        // "<foo,bar>short" is not allowed.
-        goto DoneWithDeclSpec;
+        // Need to support trailing type qualifiers (e.g. "id<p> const").
+        // If a type specifier follows, it will be diagnosed elsewhere.
+        continue;
       }
     }
     // If the specifier combination wasn't legal, issue a diagnostic.