[clang] 4ae8651 - Add another test for PR48434.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 9 12:23:25 PST 2020
Author: Richard Smith
Date: 2020-12-09T12:22:35-08:00
New Revision: 4ae8651c59241bca0c1ea5adaf8f06b292696b6f
URL: https://github.com/llvm/llvm-project/commit/4ae8651c59241bca0c1ea5adaf8f06b292696b6f
DIFF: https://github.com/llvm/llvm-project/commit/4ae8651c59241bca0c1ea5adaf8f06b292696b6f.diff
LOG: Add another test for PR48434.
Added:
Modified:
clang/test/PCH/decl-attrs.cpp
Removed:
################################################################################
diff --git a/clang/test/PCH/decl-attrs.cpp b/clang/test/PCH/decl-attrs.cpp
index c89354d0c5de..249107001874 100644
--- a/clang/test/PCH/decl-attrs.cpp
+++ b/clang/test/PCH/decl-attrs.cpp
@@ -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 {
@@ -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
More information about the cfe-commits
mailing list