Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -pedantic -fixit %s -o - | %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ - |
Fariborz Jahanian | ef78ac6 | 2009-10-26 20:45:27 +0000 | [diff] [blame] | 2 | |
| 3 | /* This is a test of the various code modification hints that are |
| 4 | provided as part of warning or extension diagnostics. All of the |
| 5 | warnings will be fixed by -fixit, and the resulting file should |
| 6 | compile cleanly with -Werror -pedantic. */ |
| 7 | |
| 8 | struct S { |
| 9 | int i; |
| 10 | }; |
| 11 | |
| 12 | int foo(int S::* ps, S s, S* p) |
| 13 | { |
| 14 | p.*ps = 1; |
| 15 | return s->*ps; |
| 16 | } |
| 17 | |
| 18 | void foo1(int (S::*ps)(), S s, S* p) |
| 19 | { |
| 20 | (p.*ps)(); |
| 21 | (s->*ps)(); |
| 22 | } |
| 23 | |