
When one kind of diagnostics is disabled, this should not preclude other diagnostics from displaying, even if they have lower priority. For example, this should print a warning about passing an uninitialized variable as a const reference: ``` > cat test.cpp void foo(const int &); int f(bool a) { int v; if (a) { foo(v); v = 5; } return v; } > clang test.cpp -fsyntax-only -Wuninitialized -Wno-sometimes-uninitialized ```
13 lines
292 B
C++
13 lines
292 B
C++
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -Wno-sometimes-uninitialized -verify %s
|
|
|
|
void foo(const int &);
|
|
|
|
int f(bool a) {
|
|
int v;
|
|
if (a) {
|
|
foo(v); // expected-warning {{variable 'v' is uninitialized when passed as a const reference argument here}}
|
|
v = 5;
|
|
}
|
|
return v;
|
|
}
|