blob: 0926309a9ab819abcda1cbe78b97afdc19e98cf2 [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++ -
Fariborz Jahanianef78ac62009-10-26 20:45:27 +00002
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
8struct S {
9 int i;
10};
11
12int foo(int S::* ps, S s, S* p)
13{
14 p.*ps = 1;
15 return s->*ps;
16}
17
18void foo1(int (S::*ps)(), S s, S* p)
19{
20 (p.*ps)();
21 (s->*ps)();
22}
23