This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19508] [4.0 regression] dwarf2, ICE on __attribute__(aligned) in class template
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jan 2005 12:09:39 -0000
- Subject: [Bug c++/19508] [4.0 regression] dwarf2, ICE on __attribute__(aligned) in class template
- References: <20050118164428.19508.jan@etpmod.phys.tue.nl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2005-01-20 12:09 -------
The problem here is that tsubst does not know about attributes, and we knew
this already. So it won't look into DECL_ORIGINAL_TYPE because it assumes it is
always NULL for template parameters. You may want to notice that the attribute
is in fact ignored:
--------------------------------------------------------
template <typename T>
struct BVector
{
typedef T value_type __attribute__ ((aligned(8)));
value_type v;
};
BVector<int> m;
int main()
{
printf("%d\n", __alignof__(m.v));
}
--------------------------------------------------------
This prints "4" on i686-pc-linux-gnu (if you compile it without -g to avoid the
ICE).
I tried tsubsting within the ORIGINAL_TYPE of a TYPE_DECL too, and it works in
avoiding the ICE, but for nothing else. Also, the long-term solution is to not
apply attributes to template types, store the attribute list aside and apply it
after substitution. So, after all, this would not be a step forward not even in
that direction.
Thus, it is better to simply not apply the attribute to template types at all.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |giovannibajo at libero dot
|dot org |it
Status|NEW |ASSIGNED
Last reconfirmed|2005-01-20 04:36:26 |2005-01-20 12:09:35
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19508