view gcc/testsuite/g++.dg/warn/Wduplicated-branches4.C @ 158:494b0b89df80 default tip

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

// PR c++/82541
// { dg-do compile }
// { dg-options "-Wduplicated-branches" }

template<int N>
struct AR
{
    char a1[N > 0 ? N : 1]; // { dg-bogus "this condition has identical branches" }
    char a2[N > 0 ? 1 : 1]; // { dg-warning "this condition has identical branches" }
};

int
main ()
{
    AR<1> w;
}