view gcc/testsuite/g++.old-deja/g++.mike/p7868.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 assemble  }
// prms-id: 7868

struct DIAGTYP {
};
struct DIAGTYP1 {
  struct DIAGTYP;       // { dg-message "" } forward declaration
  void bar() { new struct DIAGTYP; }	// { dg-error "" } undefined
  void foo() { new struct DIAGTYP1; }
};

int main () {
  struct DIAGTYP;               // { dg-message "" } forward declaration
  struct DIAGTYP  *lerror_desc;
  lerror_desc= new struct DIAGTYP;	// { dg-error "" } undefined
}

void foo () {
  struct DIAGTYP  *lerror_desc;
  lerror_desc= new struct DIAGTYP;
}