Douglas Gregor | 83bc276 | 2012-02-20 16:12:14 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| 2 | // RUN: %clang_cc1 -include %s -verify -std=c++11 %s |
| 3 | |
| 4 | // Test with pch. |
| 5 | // RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s |
| 6 | // RUN: %clang_cc1 -include-pch %t -verify -std=c++11 %s |
| 7 | |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 8 | // expected-no-diagnostics |
| 9 | |
Douglas Gregor | 83bc276 | 2012-02-20 16:12:14 +0000 | [diff] [blame] | 10 | #ifndef HEADER |
| 11 | #define HEADER |
| 12 | |
| 13 | template<typename T> |
| 14 | class New { |
| 15 | New(const New&); |
| 16 | |
| 17 | public: |
| 18 | New *clone() { |
| 19 | return new New(*this); |
| 20 | } |
| 21 | }; |
| 22 | |
| 23 | #else |
| 24 | |
| 25 | New<int> *clone_new(New<int> *n) { |
| 26 | return n->clone(); |
| 27 | } |
| 28 | |
| 29 | #endif |