c++: alignment of local typedef in template [PR65211]
authorJason Merrill <jason@redhat.com>
Thu, 14 Apr 2022 01:56:03 +0000 (21:56 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 14 Apr 2022 01:56:43 +0000 (21:56 -0400)
commit8369b4e4c6433535981d377edc1d4abb799c9225
treef8c984355172013ae244a8055c54f29bd5729df4
parent1824da60663b4532199ecd051d8ba6da8995821d
c++: alignment of local typedef in template [PR65211]

Because common_handle_aligned_attribute only applies the alignment to the
TREE_TYPE of a typedef, not the DECL_ORIGINAL_TYPE, we need to copy it
explicitly in tsubst.

PR c++/65211

gcc/cp/ChangeLog:

* pt.cc (tsubst_decl) [TYPE_DECL]: Copy TYPE_ALIGN.

gcc/testsuite/ChangeLog:

* g++.target/i386/vec-tmpl1.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.target/i386/vec-tmpl1.C [new file with mode: 0644]