xref: /minix3/external/bsd/llvm/dist/clang/test/FixIt/fixit-pmem.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: cp %s %t
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pedantic -fixit -x c++ %t
3*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ %t
4*f4a2713aSLionel Sambuc // XFAIL: *
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc /* This is a test of the various code modification hints that are
7*f4a2713aSLionel Sambuc    provided as part of warning or extension diagnostics. All of the
8*f4a2713aSLionel Sambuc    warnings will be fixed by -fixit, and the resulting file should
9*f4a2713aSLionel Sambuc    compile cleanly with -Werror -pedantic. */
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc struct  S {
12*f4a2713aSLionel Sambuc 	int i;
13*f4a2713aSLionel Sambuc };
14*f4a2713aSLionel Sambuc 
foo(int S::* ps,S s,S * p)15*f4a2713aSLionel Sambuc int foo(int S::* ps, S s, S* p)
16*f4a2713aSLionel Sambuc {
17*f4a2713aSLionel Sambuc   p.*ps = 1;
18*f4a2713aSLionel Sambuc   return s->*ps;
19*f4a2713aSLionel Sambuc }
20*f4a2713aSLionel Sambuc 
foo1(int (S::* ps)(),S s,S * p)21*f4a2713aSLionel Sambuc void foo1(int (S::*ps)(), S s, S* p)
22*f4a2713aSLionel Sambuc {
23*f4a2713aSLionel Sambuc   (p.*ps)();
24*f4a2713aSLionel Sambuc   (s->*ps)();
25*f4a2713aSLionel Sambuc }
26*f4a2713aSLionel Sambuc 
27