Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 28489d3..eef067b 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -587,9 +587,9 @@
 CXXMethodDecl::Create(ASTContext &C, CXXRecordDecl *RD,
                       SourceLocation L, DeclarationName N,
                       QualType T, TypeSourceInfo *TInfo,
-                      bool isStatic, bool isInline) {
+                      bool isStatic, StorageClass SCAsWritten, bool isInline) {
   return new (C) CXXMethodDecl(CXXMethod, RD, L, N, T, TInfo,
-                               isStatic, isInline);
+                               isStatic, SCAsWritten, isInline);
 }
 
 bool CXXMethodDecl::isUsualDeallocationFunction() const {
@@ -745,11 +745,12 @@
                            SourceLocation L, DeclarationName N,
                            QualType T, TypeSourceInfo *TInfo,
                            bool isExplicit,
-                           bool isInline, bool isImplicitlyDeclared) {
+                           bool isInline,
+                           bool isImplicitlyDeclared) {
   assert(N.getNameKind() == DeclarationName::CXXConstructorName &&
          "Name must refer to a constructor");
-  return new (C) CXXConstructorDecl(RD, L, N, T, TInfo, isExplicit, isInline,
-                                      isImplicitlyDeclared);
+  return new (C) CXXConstructorDecl(RD, L, N, T, TInfo, isExplicit,
+                                    isInline, isImplicitlyDeclared);
 }
 
 bool CXXConstructorDecl::isDefaultConstructor() const {
@@ -848,8 +849,7 @@
                           bool isImplicitlyDeclared) {
   assert(N.getNameKind() == DeclarationName::CXXDestructorName &&
          "Name must refer to a destructor");
-  return new (C) CXXDestructorDecl(RD, L, N, T, isInline,
-                                   isImplicitlyDeclared);
+  return new (C) CXXDestructorDecl(RD, L, N, T, isInline, isImplicitlyDeclared);
 }
 
 void