Give AST-walk passes a way to access DeclSpec attributes on functions and
  variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44073 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp
index 0437c20..5feb40b 100644
--- a/Parse/ParseDecl.cpp
+++ b/Parse/ParseDecl.cpp
@@ -1393,7 +1393,11 @@
       }
         
       ParamInfo.push_back(DeclaratorChunk::ParamInfo(ParmII, 
-        ParmDecl.getIdentifierLoc(), ParamTy.Val, ParmDecl.getInvalidType()));
+        ParmDecl.getIdentifierLoc(), ParamTy.Val, ParmDecl.getInvalidType(),
+        ParmDecl.getDeclSpec().getAttributes()));
+
+      // Ownership of DeclSpec has been handed off to ParamInfo.
+      DS.clearAttributes();
       
       // If the next token is a comma, consume it and keep reading arguments.
       if (Tok.isNot(tok::comma)) break;