From 61b2ffa60f6e75a5ce057ebcc88647d1574e42b0 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 21 Sep 2012 08:58:33 +0000 Subject: Make warnings about uninitialized fields include the field name. This makes the wording more informative, and consistent with the other warnings about uninitialized variables. Also, me and David who reviewed this couldn't figure out why we would need to do a lookup to get the name of the variable; so just print the name directly. llvm-svn: 164366 --- clang/test/SemaCXX/constructor-initializer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'clang/test/SemaCXX/constructor-initializer.cpp') diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index f503d01f360..ecbe7bf5b9e 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/test/SemaCXX/constructor-initializer.cpp @@ -135,12 +135,12 @@ class InitializeUsingSelfTest { TwoInOne D; int E; InitializeUsingSelfTest(int F) - : A(A), // expected-warning {{field is uninitialized when used here}} - B((((B)))), // expected-warning {{field is uninitialized when used here}} - C(A && InitializeUsingSelfTest::C), // expected-warning {{field is uninitialized when used here}} - D(D, // expected-warning {{field is uninitialized when used here}} - D), // expected-warning {{field is uninitialized when used here}} - E(IntParam(E)) {} // expected-warning {{field is uninitialized when used here}} + : A(A), // expected-warning {{field 'A' is uninitialized when used here}} + B((((B)))), // expected-warning {{field 'B' is uninitialized when used here}} + C(A && InitializeUsingSelfTest::C), // expected-warning {{field 'C' is uninitialized when used here}} + D(D, // expected-warning {{field 'D' is uninitialized when used here}} + D), // expected-warning {{field 'D' is uninitialized when used here}} + E(IntParam(E)) {} // expected-warning {{field 'E' is uninitialized when used here}} }; int IntWrapper(int &i) { return 0; }; @@ -160,8 +160,8 @@ class CopyConstructorTest { bool A, B, C; CopyConstructorTest(const CopyConstructorTest& rhs) : A(rhs.A), - B(B), // expected-warning {{field is uninitialized when used here}} - C(rhs.C || C) { } // expected-warning {{field is uninitialized when used here}} + B(B), // expected-warning {{field 'B' is uninitialized when used here}} + C(rhs.C || C) { } // expected-warning {{field 'C' is uninitialized when used here}} }; // Make sure we aren't marking default constructors when we shouldn't be. -- cgit v1.2.3