[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / misaligned-member-with-depdent-type.cpp
blobcd4768350bab4f6c4f43d555815e868df868c553
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 struct __attribute__((packed)) {
4 unsigned options;
5 template <typename T>
6 void getOptions() {
7 (T *)&options;
9 template <typename U>
10 void getOptions2() {
11 (U)&options;
13 } s;
15 struct __attribute__((packed)) { // expected-error {{anonymous structs and classes must be class members}}
16 unsigned options ;
17 template <typename T> getOptions() // expected-error {{a type specifier is required for all declarations}}
19 (T *) & options;