This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25316] POD structures can have
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2005 22:25:46 -0000
- Subject: [Bug c++/25316] POD structures can have
- References: <bug-25316-1447@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from gdr at integrable-solutions dot net 2005-12-08 22:25 -------
Subject: Re: New: POD structures can have
"mrs at apple dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| A user reported that this:
|
| mrs $ cat > t98.c
| struct X {
| int a, b;
| X() : a(0), b(0) {}
| };
|
| static void f(const char *s, ...);
|
| int main()
| {
| X x;
| f("foo!", x);
| return 0;
| }
|
| works on other C++ compilers (Metroworks), but on gcc:
|
| mrs $ ./g++ -B./ -c t98.c
| t98.c: In function 'int main()':
| t98.c:11: warning: cannot pass objects of non-POD type 'struct X' through
| '...'; call will abort at runtime
|
| This, according the a reading of the standard is a POD type, no, really. :-)
Are you saying "struct X" is a POD?
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25316