Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wint-in-bool-context-1.C

raw
1 // PR c++/79184
2 // { dg-do compile }
3 // { dg-options "-Wint-in-bool-context" }
4
5 enum { E = 2 };
6 template <bool> void f(int) { }
7 template <int> void f() {}
8
9 int
10 main ()
11 {
12 f<1 * 1>(); // { dg-bogus "in boolean context" }
13 f<1 << 1>(); // { dg-bogus "in boolean context" }
14 f<1 ? 3 : 2>(); // { dg-bogus "in boolean context" }
15 f<E>(); // { dg-bogus "in boolean context" }
16 }