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