cxx-exprs.cpp 451 B

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