summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/nullptr06.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/nullptr06.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr06.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr06.C b/gcc/testsuite/g++.dg/cpp0x/nullptr06.C
new file mode 100644
index 000000000..c50bb9bc1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr06.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+// Test compare to pointer
+
+#define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0)
+
+char* const cp1 = nullptr;
+
+void fun()
+{
+ assert_true(cp1 == nullptr);
+ decltype(nullptr) mynull = 0;
+ assert_true(cp1 == mynull);
+}