summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-29 04:21:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-29 04:21:28 +0000
commita5aaca9295144f29814c7367424d551ff49ecb3e (patch)
tree7a49ea315c5ffaf8bc7309d7ee2771c78d1ddfa3 /clang/lib/Sema
parent278266faa887246d7575ad22afcbe8c7c37fcf6a (diff)
downloadbcm5719-llvm-a5aaca9295144f29814c7367424d551ff49ecb3e.tar.gz
bcm5719-llvm-a5aaca9295144f29814c7367424d551ff49ecb3e.zip
Propagate the spelling list index for an attribute across template instantiation.
llvm-svn: 173768
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index a4b8c356dde..0e51ba3ba37 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -3330,11 +3330,11 @@ void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E,
}
void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, TypeSourceInfo *TS,
- bool isDeclSpec) {
+ bool isDeclSpec, unsigned SpellingListIndex) {
// FIXME: Cache the number on the Attr object if non-dependent?
// FIXME: Perform checking of type validity
D->addAttr(::new (Context) AlignedAttr(AttrRange, Context, false, TS,
- isDeclSpec));
+ isDeclSpec, SpellingListIndex));
return;
}
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index b679d49215b..f5405ff383b 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -80,15 +80,17 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
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;
}
OpenPOWER on IntegriCloud