[OpenACC] Enable 'attach' clause for combined constructs
[llvm-project.git] / clang / test / SemaTemplate / instantiate-attr.cpp
blob6c26711a2f1779ba514a0cf2d4cdaf18277c9448
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 namespace test1 {
16 template <typename T> struct A {
17 int a;
18 T b[0];
19 } __attribute__((packed));
21 typedef A<unsigned long> type;
23 int test0[sizeof(type) == 4 ? 1 : -1];
24 int test1[__builtin_offsetof(type, a) == 0 ? 1 : -1];
25 int test2[__builtin_offsetof(type, b) == 4 ? 1 : -1];
28 namespace test2 {
29 template <class type>
30 struct fastscriptmember {
31 type Member __attribute__ ((packed));
32 char x;
34 int test0[sizeof(fastscriptmember<int>) == 5 ? 1 : -1];