1*f4a2713aSLionel Sambuc // Test this without pch. 2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -include %s -verify -std=c++11 %s 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc // Test with pch. 5*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s 6*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -include-pch %t -verify -std=c++11 %s 7*f4a2713aSLionel Sambuc 8*f4a2713aSLionel Sambuc // expected-no-diagnostics 9*f4a2713aSLionel Sambuc 10*f4a2713aSLionel Sambuc #ifndef HEADER 11*f4a2713aSLionel Sambuc #define HEADER 12*f4a2713aSLionel Sambuc 13*f4a2713aSLionel Sambuc template<typename T> 14*f4a2713aSLionel Sambuc class New { 15*f4a2713aSLionel Sambuc New(const New&); 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc public: clone()18*f4a2713aSLionel Sambuc New *clone() { 19*f4a2713aSLionel Sambuc return new New(*this); 20*f4a2713aSLionel Sambuc } 21*f4a2713aSLionel Sambuc }; 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc #else 24*f4a2713aSLionel Sambuc clone_new(New<int> * n)25*f4a2713aSLionel SambucNew<int> *clone_new(New<int> *n) { 26*f4a2713aSLionel Sambuc return n->clone(); 27*f4a2713aSLionel Sambuc } 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc #endif 30