Propagate the spelling list index for an attribute across template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173768 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index b679d49..f5405ff 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -80,15 +80,17 @@
                                         TemplateArgs);
           if (!Result.isInvalid())
             AddAlignedAttr(Aligned->getLocation(), New, Result.takeAs<Expr>(), 
-                           Aligned->getIsMSDeclSpec());
+                           Aligned->getIsMSDeclSpec(),
+                           Aligned->getSpellingListIndex());
         } else {
           TypeSourceInfo *Result = SubstType(Aligned->getAlignmentType(),
                                              TemplateArgs,
                                              Aligned->getLocation(),
                                              DeclarationName());
           if (Result)
-            AddAlignedAttr(Aligned->getLocation(), New, Result, 
-                           Aligned->getIsMSDeclSpec());
+            AddAlignedAttr(Aligned->getLocation(), New, Result,
+                           Aligned->getIsMSDeclSpec(),
+                           Aligned->getSpellingListIndex());
         }
         continue;
       }