Skip to content

Commit

Permalink
Add another test for PR48434.
Browse files Browse the repository at this point in the history
  • Loading branch information
zygoloid committed Dec 9, 2020
1 parent 2a2c228 commit 4ae8651
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions clang/test/PCH/decl-attrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ namespace preferred_name {
Y y;
}

namespace aligned {
// PR48434: ensure attributes don't introduce deserialization cycles.
template<typename T> struct X1;
using Y1 = X1<int>;
template<typename T> struct alignas(Y1*) X1 {};
Y1 y1;

template<typename T> struct X2;
using Y2 = X2<int>;
template<typename T> struct alignas(Y2*) X2 {};
}

#else

namespace preferred_name {
Expand All @@ -24,4 +36,11 @@ namespace preferred_name {
}
}

namespace aligned {
extern Y1 y1;
extern Y2 y2;
static_assert(alignof(Y1) == alignof(Y1*), "");
static_assert(alignof(Y2) == alignof(Y2*), "");
}

#endif

0 comments on commit 4ae8651

Please sign in to comment.