aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/c/c-decl.cc2
-rw-r--r--gcc/testsuite/gcc.dg/c11-nullptr-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/c11-nullptr-3.c7
-rw-r--r--gcc/testsuite/gcc.dg/c23-nullptr-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/c23-nullptr-7.c5
5 files changed, 19 insertions, 2 deletions
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 1128d72c..96bfe92 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -4799,7 +4799,7 @@ c_init_decl_processing (void)
boolean_type_node));
/* C-specific nullptr initialization. */
- record_builtin_type (RID_MAX, "nullptr_t", nullptr_type_node);
+ record_builtin_type (RID_MAX, "typeof (nullptr)", nullptr_type_node);
/* The size and alignment of nullptr_t is the same as for a pointer to
character type. */
SET_TYPE_ALIGN (nullptr_type_node, GET_MODE_ALIGNMENT (ptr_mode));
diff --git a/gcc/testsuite/gcc.dg/c11-nullptr-2.c b/gcc/testsuite/gcc.dg/c11-nullptr-2.c
new file mode 100644
index 0000000..3b37b11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c11-nullptr-2.c
@@ -0,0 +1,5 @@
+/* Test there is no nullptr_t built-in typedef. Bug 114869. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+int nullptr_t;
diff --git a/gcc/testsuite/gcc.dg/c11-nullptr-3.c b/gcc/testsuite/gcc.dg/c11-nullptr-3.c
new file mode 100644
index 0000000..5abb082
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c11-nullptr-3.c
@@ -0,0 +1,7 @@
+/* Test there is no nullptr_t in <stddef.h> for C11. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stddef.h>
+
+int nullptr_t;
diff --git a/gcc/testsuite/gcc.dg/c23-nullptr-5.c b/gcc/testsuite/gcc.dg/c23-nullptr-5.c
index 54266af..f708ec2 100644
--- a/gcc/testsuite/gcc.dg/c23-nullptr-5.c
+++ b/gcc/testsuite/gcc.dg/c23-nullptr-5.c
@@ -3,7 +3,7 @@
/* { dg-options "-std=c23 -pedantic-errors" } */
int i;
-nullptr_t fn () { ++i; return nullptr; }
+typeof (nullptr) fn () { ++i; return nullptr; }
int
main ()
diff --git a/gcc/testsuite/gcc.dg/c23-nullptr-7.c b/gcc/testsuite/gcc.dg/c23-nullptr-7.c
new file mode 100644
index 0000000..2692e30
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-nullptr-7.c
@@ -0,0 +1,5 @@
+/* Test there is no nullptr_t built-in typedef. Bug 114869. */
+/* { dg-do compile } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
+
+int nullptr_t;