view gcc/testsuite/gcc.dg/pr43082.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

/* Test that the compiler does not crash when void expressions are
   found inside conditional expressions.  PR c/43082.  */
/* { dg-do compile } */

void
foo (int x)
{
  if (x ? (void)(0) : (void)(1)) /* { dg-error "void value not ignored as it ought to be" } */
    ;
}