aboutsummaryrefslogtreecommitdiff
path: root/test/FixIt/fixit-pmem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/FixIt/fixit-pmem.cpp')
-rw-r--r--test/FixIt/fixit-pmem.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/FixIt/fixit-pmem.cpp b/test/FixIt/fixit-pmem.cpp
new file mode 100644
index 000000000000..bb36f7fa9343
--- /dev/null
+++ b/test/FixIt/fixit-pmem.cpp
@@ -0,0 +1,23 @@
+// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
+
+/* This is a test of the various code modification hints that are
+ provided as part of warning or extension diagnostics. All of the
+ warnings will be fixed by -fixit, and the resulting file should
+ compile cleanly with -Werror -pedantic. */
+
+struct S {
+ int i;
+};
+
+int foo(int S::* ps, S s, S* p)
+{
+ p.*ps = 1;
+ return s->*ps;
+}
+
+void foo1(int (S::*ps)(), S s, S* p)
+{
+ (p.*ps)();
+ (s->*ps)();
+}
+