This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/28558] [4.0/4.1/4.2 regression] Trouble with new and __attribute__



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]