diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
| commit | 13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch) | |
| tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/PCH/pragma-diag-section.cpp | |
| parent | 657bc3d9848e3be92029b2416031340988cd0111 (diff) | |
Notes
Diffstat (limited to 'test/PCH/pragma-diag-section.cpp')
| -rw-r--r-- | test/PCH/pragma-diag-section.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/PCH/pragma-diag-section.cpp b/test/PCH/pragma-diag-section.cpp index 5b996bb2f0d1..627156f15398 100644 --- a/test/PCH/pragma-diag-section.cpp +++ b/test/PCH/pragma-diag-section.cpp @@ -11,7 +11,7 @@ #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; @@ -21,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 |
