aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2007-09-28 14:07:57 -0400
committerJason Merrill <jason@gcc.gnu.org>2007-09-28 14:07:57 -0400
commitd9d9dbc0d0d3a1f419115367cfe23992a92f822b (patch)
treec0601f8dd3b95792f0db5c5bd35d56980a712650 /gcc/testsuite
parent930a1e6372869fa553130c5e7fa22c27485b7ec5 (diff)
downloadgcc-d9d9dbc0d0d3a1f419115367cfe23992a92f822b.zip
gcc-d9d9dbc0d0d3a1f419115367cfe23992a92f822b.tar.gz
gcc-d9d9dbc0d0d3a1f419115367cfe23992a92f822b.tar.bz2
re PR c++/10179 (alignment attributes are not inherited correctly with empty classes)
PR c++/10179 * class.c (layout_empty_base): Take rli parameter, update rli->record_align if empty base has user-specified alignment. (build_base_field): Pass rli to it. From-SVN: r128871
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/ext/align2.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/align2.C b/gcc/testsuite/g++.dg/ext/align2.C
new file mode 100644
index 0000000..da54bd9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/align2.C
@@ -0,0 +1,14 @@
+// PR c++/10179
+
+struct __attribute((aligned(__alignof(double)))) A
+{ /* empty */ };
+
+struct T : public A
+{
+ char c;
+};
+
+template<bool> struct StaticAssert;
+template<> struct StaticAssert<true> {};
+
+StaticAssert<__alignof(T) == __alignof(double)> d;