view gcc/testsuite/g++.old-deja/g++.jason/anon.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// { dg-do run  }
// Bug: g++ has trouble copying anonymous structs.

typedef struct { int i; } foo;
struct A : public foo { 
  struct { int i; } x;
};

int main ()
{
  A a;
  a.i = 5;
  a.x.i = 42;
  A b (a);
  a = b;
  if (a.i != 5 || a.x.i != 42)
    return 1;
  return 0;
}