diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-30 00:27:21 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-30 00:27:21 +0000 |
commit | 33e1576ef88ae6fcc4ed8686f34ed28b1a41bcce (patch) | |
tree | daec5bd9459dd1f46cf12db1809ff45467f0a732 /test/PCH | |
parent | d2d4d68a58898c5d13d66d45a5d9440fc1d790fe (diff) |
[PCH] The diagnostic state points can refer to previously created
diagnostic states; make sure the ASTReader sets the diagnostic state
properly instead of always recreating it.
Fixes rdar://12581618 & http://llvm.org/PR14181
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH')
-rw-r--r-- | test/PCH/pragma-diag-section.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/test/PCH/pragma-diag-section.cpp b/test/PCH/pragma-diag-section.cpp index 103b252416..627156f153 100644 --- a/test/PCH/pragma-diag-section.cpp +++ b/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 |