[cfe-dev] C++11 POD bug

Kal Conley kcconley at gmail.com
Sat Jun 2 15:30:40 PDT 2012


I have the following code:

$ cat pod.cc
struct Pod {
  int i;
  Pod() = default;

int main(int argc, char **argv) {
  int Size = 1;
  Pod PodArray[Size];
  return 0;

I believe that "Pod" should be a POD type in c++11. But when I try to
compile this with clang I get:

$ clang++ --std=c++11 pod.cc
pod.cc:8:15: error: variable length array of non-POD element type 'Pod'
  Pod PodArray[Size];
1 error generated.

I'm using:

$ clang++ --version
clang version 3.1 (trunk 156916)
Target: x86_64-apple-darwin11.4.0
Thread model: posix


More information about the cfe-dev mailing list