summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/nullptr05.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/nullptr05.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr05.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr05.C b/gcc/testsuite/g++.dg/cpp0x/nullptr05.C
new file mode 100644
index 000000000..22a8b51c1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr05.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+// Test assignment to method pointer
+
+class F { };
+
+typedef void (F::*pmf)();
+
+const pmf pmf1 = nullptr;
+const pmf pmf2 = __null;
+const pmf pmf3 = 0;
+decltype(nullptr) mynull = 0;
+const pmf pmf4 = mynull;