I ran the below with g++ -std=c++0x pod_test.cpp
on g++ 4.6.2 (mingw). I get an error on A4. Why isn't A4 POD?
#include <iostream>
#include <new>
#include <cstring>
using namespace std;
struct A {
int a, b;
char c;
};
struct A2 {
short buf[1];
};
struct A3:A {
};
struct A4:A {
short buf[1];
};
static_assert(std::is_pod<A>::value, "Struct must be a POD type");
static_assert(std::is_pod<A2>::value, "Struct must be a POD type");
static_assert(std::is_pod<A3>::value, "Struct must be a POD type");
static_assert(std::is_pod<A4>::value, "Struct must be a POD type");
int main(){}