diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-17 23:46:49 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-17 23:46:49 +0000 |
commit | a6b0907a71c66e6bf65e2477a6f9783d9fec4d47 (patch) | |
tree | 96a3b7915b7ddd129bdcea5498262b4ef446f25f | |
parent | 2fe0025a1300689b2d2517bb89ecadbab8b62ac5 (diff) |
Instantiate attributes on typedefs. This is a quick fix for PR7148,
when we really need a proper audit of our handling of attributes in
templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103999 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 1 | ||||
-rw-r--r-- | test/SemaTemplate/instantiate-attr.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 1280c0cb88..f3d37787f8 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -217,6 +217,7 @@ Decl *TemplateDeclInstantiator::VisitTypedefDecl(TypedefDecl *D) { Typedef->setPreviousDeclaration(cast<TypedefDecl>(InstPrev)); } + InstantiateAttrs(D, Typedef); Typedef->setAccess(D->getAccess()); Owner->addDecl(Typedef); diff --git a/test/SemaTemplate/instantiate-attr.cpp b/test/SemaTemplate/instantiate-attr.cpp index 7fb1736459..e8291ed00d 100644 --- a/test/SemaTemplate/instantiate-attr.cpp +++ b/test/SemaTemplate/instantiate-attr.cpp @@ -2,6 +2,12 @@ template <typename T> struct A { char a __attribute__((aligned(16))); + + struct B { + typedef T __attribute__((aligned(16))) i16; + i16 x; + }; }; int a[sizeof(A<int>) == 16 ? 1 : -1]; +int a2[sizeof(A<int>::B) == 16 ? 1 : -1]; |