aboutsummaryrefslogtreecommitdiff
path: root/test/FixIt/fixit-pmem.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-11-04 15:04:32 +0000
commit51fb8b013e7734b795139f49d3b1f77c539be20a (patch)
tree59e0e47a9831dcf0e21e547927c8ebb7e113bfd1 /test/FixIt/fixit-pmem.cpp
parent73490b890977362d28dd6326843a1ecae413921d (diff)
downloadsrc-51fb8b013e7734b795139f49d3b1f77c539be20a.tar.gz
src-51fb8b013e7734b795139f49d3b1f77c539be20a.zip
Update clang to r86025.vendor/clang/clang-r86025
Notes
Notes: svn path=/vendor/clang/dist/; revision=198893 svn path=/vendor/clang/clang-r86025/; revision=198895; tag=vendor/clang/clang-r86025
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)();
+}
+