This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28558] [4.0/4.1/4.2 regression] Trouble with new and __attribute__
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Aug 2006 20:41:00 -0000
- Subject: [Bug c++/28558] [4.0/4.1/4.2 regression] Trouble with new and __attribute__
- References: <bug-28558-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from jason at gcc dot gnu dot org 2006-08-22 20:41 -------
This testcase reproduces the bug without new. The problem is that applying
attributes to a type creates a new TYPE_MAIN_VARIANT, which is fundamentally
nonsensical for class types. We really need to impose more design on the whole
attribute system.
IMO we should give an error for this code.
struct A
{
A(int) { }
};
int main()
{
A a = (A __attribute__((unused)))0;
}
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28558