C++ frontend marks structs with va_list as non-POD. This problem is probably related to 31488. roman@work:~$ cat va_list_is_not_pod.cc #include <stdarg.h> #include <type_traits> struct fiber { va_list va; }; int main(int argc, char *argv[]) { static_assert(std::is_pod<struct fiber>::value, "Should be POD"); } roman@work:~$ g++ -std=c++11 va_list_is_not_pod.cc -o test va_list_is_not_pod.cc: In function ‘int main(int, char**)’: va_list_is_not_pod.cc:11:5: error: static assertion failed: Should be POD gcc version 4.7.2 (Debian 4.7.2-5)
Seems to be fixed in gcc 4.9.0 20130519 (experimental)
Surely this depends on whether is_pod<va_list> is true, and is that required, or is it unspecified? I think this should always pass though: static_assert(is_pod<fiber>::value == is_pod<va_list>::value, "same PODness");
(In reply to Jonathan Wakely from comment #2) My interprettaion is that the standard does not say anything about that (I think I had once a similar question in regard to another type from the C Library). I suspect that this could be a C++ Library defect. But I would argue that here the intention is arg_list to be a pod based on [support.runtime] p2: "The contents of these headers are the same as the Standard C library headers [..] <stdarg.h>, [..], respectively, with the following changes: [..]" I cannot deduce anything from the changes that could be interpreted in a way explaining such a difference. My guess is that the is_pod trait was not fully implemented in gcc 4.7.2, was it?
I use offsetof on this structure and C++ produces a warning about POD data type. std::is_pod is not so important here. I temporary add -Wno-invalid-offsetof to my code.
This is still an issue. Confirmed.