2016-07-14 06:03:47 +08:00
|
|
|
// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source local %s -Wuninitialized -Werror=unused 2>&1 | FileCheck -check-prefix=DIAGS %s
|
2016-07-14 04:35:26 +08:00
|
|
|
|
|
|
|
// Make sure -Wuninitialized works even though the header had a warn-as-error occurrence.
|
|
|
|
|
|
|
|
// DIAGS: error: unused variable 'x'
|
|
|
|
// DIAGS: warning: variable 'x1' is uninitialized
|
|
|
|
// DIAGS-NOT: error: use of undeclared identifier
|
|
|
|
// DIAGS: warning: variable 'x1' is uninitialized
|
|
|
|
|
|
|
|
#include "pch-warn-as-error-code-split.h"
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
int x1; // expected-note {{initialize}}
|
|
|
|
int x2 = x1; // expected-warning {{uninitialized}}
|
|
|
|
(void)x2;
|
|
|
|
foo_head();
|
|
|
|
}
|