summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/nullptr03.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/nullptr03.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nullptr03.C9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr03.C b/gcc/testsuite/g++.dg/cpp0x/nullptr03.C
new file mode 100644
index 000000000..b6df89637
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nullptr03.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+// Test assignment to int
+
+const int n1 = nullptr; // { dg-error "cannot convert " }
+decltype(nullptr) mynull = 0;
+const int n2 = mynull; // { dg-error "cannot convert " }
+