Argyrios Kyrtzidis | 243aedb | 2011-01-14 20:54:07 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| 2 | // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only |
| 3 | |
| 4 | // Test with pch. |
| 5 | // RUN: %clang_cc1 %s -emit-pch -o %t |
| 6 | // RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only |
| 7 | |
Andy Gibbs | c6e68da | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 8 | // expected-no-diagnostics |
| 9 | |
Argyrios Kyrtzidis | 243aedb | 2011-01-14 20:54:07 +0000 | [diff] [blame] | 10 | #ifndef HEADER |
| 11 | #define HEADER |
| 12 | |
| 13 | #pragma clang diagnostic push |
| 14 | #pragma clang diagnostic ignored "-Wtautological-compare" |
| 15 | template <typename T> |
| 16 | struct TS { |
Chandler Carruth | 33bf3e7 | 2011-03-27 09:46:56 +0000 | [diff] [blame] | 17 | void m() { |
| 18 | T a = 0; |
| 19 | T b = a==a; |
| 20 | } |
Argyrios Kyrtzidis | 243aedb | 2011-01-14 20:54:07 +0000 | [diff] [blame] | 21 | }; |
| 22 | #pragma clang diagnostic pop |
| 23 | |
| 24 | #else |
| 25 | |
| 26 | void f() { |
| 27 | TS<int> ts; |
| 28 | ts.m(); |
| 29 | } |
| 30 | |
| 31 | #endif |