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