C++ PATCH for c++/48138 (losing __attribute ((aligned)) on template argument)

Jason Merrill jason@redhat.com
Tue Jun 21 03:08:00 GMT 2011


On 06/20/2011 10:23 AM, Jason Merrill wrote:
> strip_typedefs needs to propagate DECL_USER_ALIGN as well as attributes
> in the attribute list.

...except that we don't want to retain attributes on template type 
arguments, since they aren't part of mangling, so you could get a class 
template instantiation that is the same type regardless of the alignment 
of the argument, but the effective argument varies depending on which 
alignment was first used to instantiate it.

The PR suggests a warning when we drop the attributes, which makes 
sense.  This patch does not yet provide the warning in the case of 
function templates, but does for class templates.  Warning for function 
templates will wait until after Nathan's patch to improve template 
overloading diagnostics.

Tested x86_64-pc-linux-gnu, applying to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 48138-2.patch
Type: text/x-patch
Size: 3603 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110621/03034e06/attachment.bin>


More information about the Gcc-patches mailing list