view gcc/testsuite/g++.dg/ext/pr71290.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

// 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." }
};