gcc/testsuite/g++.dg/warn/Wuninitialized-9.C
raw| 1 | // PR c++/80119 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-Wuninitialized" } |
| 4 | |
| 5 | #include <type_traits> |
| 6 | |
| 7 | template <bool b> |
| 8 | void failing_function(std::integral_constant<bool, b>) |
| 9 | { |
| 10 | int i; |
| 11 | if (b && (i = 4)) { |
| 12 | ++i; // { dg-bogus "may be used uninitialized" } |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | int main (void) |
| 17 | { |
| 18 | failing_function(std::false_type()); |
| 19 | } |