view gcc/testsuite/g++.old-deja/g++.bugs/900404_07.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do assemble  }
// g++ 1.37.1 bug 900404_07

// It is illegal to use a cast to attempt to convert an object type
// to a non-scalar type (e.g. an array type).

// g++ fails to properly flag as errors such illegal uses of array types.

// keywords: array types, casts, type conversion

typedef int array_type[10];

array_type *ap;

void foo ()
{
  int i = *((array_type) *ap);	/* { dg-error "13:ISO C\\+\\+ forbids casting to an array type" } missed */
}