view gcc/testsuite/gcc.dg/Wtraditional-conversion.c @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Source: PR 137.

   We would not warn about passing an enum, but would warn about
   passing a enum that was part of an array.  TYPE_MAIN_VARIANT was
   not used in the appropriate place in the warning code.  */

/* { dg-do compile } */
/* { dg-options -Wtraditional-conversion } */

typedef enum { a } __attribute__((packed)) t;
void f(t x) {}

int main(void)
{
  t x[2], y;
  f(x[0]);			/* { dg-bogus "different width" } */
  f(y);				/* { dg-bogus "different width" } */
  return 0;
}