[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / attr-aligned.cpp
blob4b9c55f4c7dd7c091da40b4690308a438f7813b9
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 typedef struct S1 { char c; } S1 __attribute__((aligned(8)));
5 static_assert(alignof(S1) == 8, "attribute ignored");
6 static_assert(alignof(struct S1) == 1, "attribute applied to original type");
8 typedef struct __attribute__((aligned(8))) S2 { char c; } AS;
9 static_assert(alignof(S2) == 8, "attribute not propagated");
10 static_assert(alignof(struct S2) == 8, "attribute ignored");
12 typedef struct __attribute__((aligned(4))) S3 {
13 char c;
14 } S3 __attribute__((aligned(8)));
15 static_assert(alignof(S3) == 8, "attribute ignored");
16 static_assert(alignof(struct S3) == 4, "attribute clobbered");