view gcc/testsuite/g++.dg/ext/pr71290.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/71290 - [6/7 Regression] Flexible array member is not diagnosed
// with -pedantic

// { dg-do compile }
// { dg-options "-Wall -Wpedantic" }

struct A
{
  int i;
  int arr[];   // { dg-warning "7:ISO C\\+\\+ forbids flexible array member .arr." }
};

template <class T>
struct B {
  T n;
  T a[];       // { dg-warning "5:ISO C\\+\\+ forbids flexible array member .a." }
};