Argyrios Kyrtzidis | 6764334 | 2010-06-29 22:47:00 +0000 | [diff] [blame] | 1 | // Test this without pch. |
| 2 | // RUN: %clang_cc1 -include %S/cxx-friends.h -fsyntax-only -verify %s |
| 3 | |
| 4 | // Test with pch. |
| 5 | // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h |
Richard Smith | 4fc5089 | 2013-06-26 02:41:25 +0000 | [diff] [blame] | 6 | // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize |
| 7 | |
| 8 | // Test with modules. |
| 9 | // RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h -fmodules |
| 10 | // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize -fmodules |
Argyrios Kyrtzidis | 6764334 | 2010-06-29 22:47:00 +0000 | [diff] [blame] | 11 | |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 12 | // expected-no-diagnostics |
| 13 | |
Argyrios Kyrtzidis | 6764334 | 2010-06-29 22:47:00 +0000 | [diff] [blame] | 14 | class F { |
| 15 | void m() { |
| 16 | A* a; |
| 17 | a->x = 0; |
| 18 | } |
| 19 | }; |
Richard Smith | 6e21b16 | 2012-04-22 02:13:50 +0000 | [diff] [blame] | 20 | |
| 21 | template<typename T> class PR12585::future_base::setter { |
| 22 | public: |
| 23 | int f() { |
| 24 | return promise<T*>().k; |
| 25 | } |
| 26 | }; |
| 27 | int k = PR12585::future_base::setter<int>().f(); |
Richard Smith | 4fc5089 | 2013-06-26 02:41:25 +0000 | [diff] [blame] | 28 | |
| 29 | Lazy::S *p; |