Support attributes in *yet another* place.  Is there any place you 
can't stick an attributes?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57795 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 78793ce..041d876 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -321,6 +321,17 @@
     
     // Parse the next declarator.
     D.clear();
+    
+    // Accept attributes in an init-declarator.  In the first declarator in a
+    // declaration, these would be part of the declspec.  In subsequent
+    // declarators, they become part of the declarator itself, so that they
+    // don't apply to declarators after *this* one.  Examples:
+    //    short __attribute__((common)) var;    -> declspec
+    //    short var __attribute__((common));    -> declarator
+    //    short x, __attribute__((common)) var;    -> declarator
+    if (Tok.is(tok::kw___attribute))
+      D.AddAttributes(ParseAttributes());
+    
     ParseDeclarator(D);
   }