This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64867] warning for passing non-POD to varargs function
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 17:22:58 +0000
- Subject: [Bug c++/64867] warning for passing non-POD to varargs function
- Auto-submitted: auto-generated
- References: <bug-64867-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64867
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #5)
> (In reply to Jason Merrill from comment #3)
> > Passing a non-POD to a varargs function is conditionally-supported, with
> > implementation-defined semantics. In GCC 5 it's supported and treated like
> > normal pass-by-value. You can get a diagnostic about it with
> > -Wconditionally-supported.
>
> I tried this today and it does not work with the test case in comment #4.
>
> pokyo. gcc --version
> gcc (GCC) 5.0.0 20150129 (experimental)
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> pokyo. g++ --std=c++11 --syntax-only -Wall -Wconditionally-supported q.cc
> pokyo.
Are you sure that class is not trivial which is why gcc is not warning about
it? C++11 does not really have pod and non-pod any more but rather trivial and
non-trivial and the rules has chnaged with respect of constructures.