From 7821e0756744018a34c533f30cdabe62a72d4e4a 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164366 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaCXX/constructor-initializer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/SemaCXX/constructor-initializer.cpp') diff --git a/test/SemaCXX/constructor-initializer.cpp b/test/SemaCXX/constructor-initializer.cpp index f503d01f36..ecbe7bf5b9 100644 --- a/test/SemaCXX/constructor-initializer.cpp +++ b/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-70-g09d2