view gcc/testsuite/gcc.dg/c11-generic-3.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

/* Test C11 _Generic.  Test we follow the resolution of DR#423.  */
/* { dg-do compile } */
/* { dg-options "-std=c11 -pedantic-errors" } */

char const *a = _Generic ("bla", char *: "");
char const *b = _Generic ("bla", char[4]: ""); /* { dg-error "not compatible with any association" } */
char const *c = _Generic ((int const) { 0 }, int: "");
char const *d = _Generic ((int const) { 0 }, int const: ""); /* { dg-error "not compatible with any association" } */
char const *e = _Generic (+(int const) { 0 }, int: "");
char const *f = _Generic (+(int const) { 0 }, int const: ""); /* { dg-error "not compatible with any association" } */