This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15774] Conflicting function decls not diagnosed
- From: "dannysmith at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jun 2004 01:42:12 -0000
- Subject: [Bug c++/15774] Conflicting function decls not diagnosed
- References: <20040602105408.15774.dannysmith@users.sourceforge.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dannysmith at users dot sourceforge dot net 2004-06-28 01:42 -------
Yes I did test it and it was wrong, because it appears C++ front end handles
attributes of class member functions differently than global functions.
Attributes of member functions are only honoured when declared within class
definition, which makes sense to me. So for something like this (g++-old-
deja/g++.ext/attrib2.C) my patch would cause an error to be emitted. Should it?
Should C++ require (as does C) that the subsequent definition also have an
explicit attribute?
// { dg-do run { target i?86-*-* } }
// Test that stdcall doesn't prevent us from using op delete.
// Contributed by Jason Merrill <jason@cygnus.com>
struct A {
void operator delete (void *) __attribute__ ((stdcall));
};
void foo()
{
A* ap = new A;
delete ap;
}
void A:: operator delete (void *) { }
int main()
{
A* ap = new A;
delete ap;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15774