summaryrefslogtreecommitdiffstats
path: root/test/PCH/pragma-diag-section.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/PCH/pragma-diag-section.cpp')
-rw-r--r--test/PCH/pragma-diag-section.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/PCH/pragma-diag-section.cpp b/test/PCH/pragma-diag-section.cpp
index 627156f..eea6bd7 100644
--- a/test/PCH/pragma-diag-section.cpp
+++ b/test/PCH/pragma-diag-section.cpp
@@ -1,20 +1,20 @@
// Test this without pch.
-// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -Wuninitialized
// Test with pch.
// RUN: %clang_cc1 %s -emit-pch -o %t
-// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
+// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -Wuninitialized
#ifndef HEADER
#define HEADER
#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wtautological-compare"
+#pragma clang diagnostic ignored "-Wuninitialized"
template <typename T>
struct TS1 {
void m() {
- T a = 0;
- T b = a==a;
+ T a;
+ T b = a;
}
};
#pragma clang diagnostic pop
@@ -25,8 +25,10 @@ struct TS1 {
template <typename T>
struct TS2 {
void m() {
- T a = 0;
- T b = a==a; // expected-warning {{self-comparison always evaluates to true}} expected-note@39 {{in instantiation of member function}}
+ T a;
+ T b = a; // expected-warning {{variable 'a' is uninitialized}} \
+ expected-note@41 {{in instantiation of member function}} \
+ expected-note@28 {{initialize the variable 'a' to silence}}
}
};
OpenPOWER on IntegriCloud