This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13440] New: attributes lost in explicit template specializations
- From: "dannysmith at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Dec 2003 09:45:33 -0000
- Subject: [Bug c++/13440] New: attributes lost in explicit template specializations
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Parsing of explicit template specializations loses attribute
directive if the attributes are declared immediately after the the class-key
rather than at the curly bracket end of class definition.
eg:
==================================================
// attrib11.C
template <class intT> struct Bar{};
template<> struct Bar<int>
{
char c;
int i;
} __attribute__ ((packed)); // is packed.
template<> struct __attribute__ ((packed)) Bar<short>
{
char c;
int i;
}; // is _not_ packed
Bar<int> iBar;
Bar<short> sBar;
char test[sizeof iBar == sizeof sBar ? 1 : -1];
// end attrib11.C
==================================================
This has significance to dll[im/ex]port attribute, since
the second form (with __attribute__(()) replaced by __declspec())
is the one accepted by the native w32 compiler.
Danny
--
Summary: attributes lost in explicit template specializations
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dannysmith at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-mingw32
GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13440