cxx-friends.cpp 759 B

1234567891011121314151617181920212223242526272829
  1. // Test this without pch.
  2. // RUN: %clang_cc1 -include %S/cxx-friends.h -fsyntax-only -verify %s
  3. // Test with pch.
  4. // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h
  5. // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize
  6. // Test with modules.
  7. // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h -fmodules
  8. // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize -fmodules
  9. // expected-no-diagnostics
  10. class F {
  11. void m() {
  12. A* a;
  13. a->x = 0;
  14. }
  15. };
  16. template<typename T> class PR12585::future_base::setter {
  17. public:
  18. int f() {
  19. return promise<T*>().k;
  20. }
  21. };
  22. int k = PR12585::future_base::setter<int>().f();
  23. Lazy::S *p;