https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97222

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #3 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
> would be interesting to see how ICC mangles the aligned case

It doesn't, it just takes the properties from whichever instantiation happens
to be performed first. On ICC,

     std::cout << alignof(typename identity<float>::type) << std::endl;
     std::cout << alignof(typename identity<fp>::type) << std::endl;

prints 4 4, and 

     std::cout << alignof(typename identity<fp>::type) << std::endl;
     std::cout << alignof(typename identity<float>::type) << std::endl;

prints 16 16. The ICC behavior seems unsound, compared to the GCC / Clang
behavior of (effectively) stripping the attribute from template arguments.

> There is NO way defined at this point to mange for some attributes
> including but not limited to may_alias and alignment.

These can be mangled as <extended-qualifier>s:
http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.qualified-type

Presumably the more problematic part from an ABI perspective is that this will
change a bunch of existing manglings. Similarly from a source compatibility
standpoint, making the alignment override part of the type would be a breaking
change. It'd probably be better to add a new syntax for the new functionality
(please, not based on an attributed typedef this time!) and deprecate the old
way.

Reply via email to