diff options
author | Jason Merrill <jason@redhat.com> | 2010-01-04 12:53:37 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-01-04 12:53:37 -0500 |
commit | 282c399b39bc92f5f3765a96bf13025873370e77 (patch) | |
tree | 2da3ffaea6649e84f2466843cf65550a3a31416b | |
parent | 4b4a42c40af8376511de3b797c3d75a34f09b925 (diff) | |
download | gcc-282c399b39bc92f5f3765a96bf13025873370e77.zip gcc-282c399b39bc92f5f3765a96bf13025873370e77.tar.gz gcc-282c399b39bc92f5f3765a96bf13025873370e77.tar.bz2 |
re PR c++/42555 (16-byte aligned double is disallowed only in templates)
PR c++/42555
* pt.c (tsubst_decl): Don't apply type attributes in place.
From-SVN: r155628
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attrib35.C | 19 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 77dd1df6..427e57f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2010-01-04 Jason Merrill <jason@redhat.com> + PR c++/42555 + * pt.c (tsubst_decl): Don't apply type attributes in place. + PR c++/42567 * semantics.c (describable_type): Remove decltype comment and semantics. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d5342a1..d2a1f9d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9400,7 +9400,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) TREE_CHAIN (r) = NULL_TREE; apply_late_template_attributes (&r, DECL_ATTRIBUTES (r), - (int) ATTR_FLAG_TYPE_IN_PLACE, + /*flags=*/0, args, complain, in_decl); /* Preserve a typedef that names a type. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8d559e9..aebd716 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-01-04 Jason Merrill <jason@redhat.com> + PR c++/42555 + * g++.dg/ext/attrib35.C: New. + PR c++/42567 * g++.dg/cpp0x/auto17.C: New. diff --git a/gcc/testsuite/g++.dg/ext/attrib35.C b/gcc/testsuite/g++.dg/ext/attrib35.C new file mode 100644 index 0000000..60c4840 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib35.C @@ -0,0 +1,19 @@ +// { dg-do compile { target i*86-*-* x86_64-*-* } } +// { dg-options "-O3 -msse2" } + +// You can make NON-template typedefs with a large alignment. +typedef double AlignedDoubleType __attribute__((aligned(16))); + +template <typename RealType> +RealType f(const RealType* p) +{ + // But if you use a template parameter it complains. + typedef RealType AlignedRealType __attribute__((aligned(16))); + + return p[0]; +} + +double f2(const double* p) +{ + return f<double>(p); +} |