[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / SemaTemplate / instantiate-attr.cpp
blob1e94614f371daa9415f99e37dafbe579185df215
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 template <typename T>
4 struct A {
5 char a __attribute__((aligned(16)));
7 struct B {
8 typedef T __attribute__((aligned(16))) i16;
9 i16 x;
12 int a[sizeof(A<int>) == 16 ? 1 : -1];
13 int a2[sizeof(A<int>::B) == 16 ? 1 : -1];
15 // rdar://problem/8243419
16 namespace test1 {
17 template <typename T> struct A {
18 int a;
19 T b[0];
20 } __attribute__((packed));
22 typedef A<unsigned long> type;
24 int test0[sizeof(type) == 4 ? 1 : -1];
25 int test1[__builtin_offsetof(type, a) == 0 ? 1 : -1];
26 int test2[__builtin_offsetof(type, b) == 4 ? 1 : -1];
29 namespace test2 {
30 template <class type>
31 struct fastscriptmember {
32 type Member __attribute__ ((packed));
33 char x;
35 int test0[sizeof(fastscriptmember<int>) == 5 ? 1 : -1];