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++/25316] POD structures can have



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


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