diff options
Diffstat (limited to 'clang/test/PCH/pragma-diag-section.cpp')
| -rw-r--r-- | clang/test/PCH/pragma-diag-section.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/clang/test/PCH/pragma-diag-section.cpp b/clang/test/PCH/pragma-diag-section.cpp index 103b252416d..627156f1539 100644 --- a/clang/test/PCH/pragma-diag-section.cpp +++ b/clang/test/PCH/pragma-diag-section.cpp @@ -5,15 +5,13 @@ // RUN: %clang_cc1 %s -emit-pch -o %t // RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -// expected-no-diagnostics - #ifndef HEADER #define HEADER #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wtautological-compare" template <typename T> -struct TS { +struct TS1 { void m() { T a = 0; T b = a==a; @@ -23,9 +21,22 @@ struct TS { #else + +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}} + } +}; + void f() { - TS<int> ts; - ts.m(); + TS1<int> ts1; + ts1.m(); + + + TS2<int> ts2; + ts2.m(); } #endif |

