clang/test/SemaCXX/warn-no-sometimes-uninitialized.cpp
raw| 1 | // RUN: %clang_cc1 -fsyntax-only -Wuninitialized -Wno-sometimes-uninitialized -verify %s |
| 2 | |
| 3 | void foo(const int &); |
| 4 | |
| 5 | int f(bool a) { |
| 6 | int v; |
| 7 | if (a) { |
| 8 | foo(v); // expected-warning {{variable 'v' is uninitialized when passed as a const reference argument here}} |
| 9 | v = 5; |
| 10 | } |
| 11 | return v; |
| 12 | } |