[Bug c++/64867] warning for passing non-POD to varargs function

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 30 17:23:00 GMT 2015


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.



More information about the Gcc-bugs mailing list