PR c++/52706
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Apr 2012 17:07:39 +0000 (17:07 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Apr 2012 17:07:39 +0000 (17:07 +0000)
* mangle.c (write_type): nullptr_t is a builtin type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186469 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/common.opt
gcc/cp/ChangeLog
gcc/cp/mangle.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/nullptr27.C [new file with mode: 0644]

index 39f1679..ee0c66a 100644 (file)
@@ -788,6 +788,8 @@ Driver Undocumented
 ;    argument.
 ;    First selectable in G++ 4.7.
 ;
+; 7: The version of the ABI that treats nullptr_t as a builtin type.
+;    First selectable in G++ 4.8.
 ; Additional positive integers will be assigned as new versions of
 ; the ABI become the default version of the ABI.
 fabi-version=
index a00d781..69d5b1d 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-15  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52706
+       * mangle.c (write_type): nullptr_t is a builtin type.
+
 2012-04-14  Jan Hubicka  <jh@suse.cz>
 
        * tree.c: Update field referenced for new cgraph/varpool layout.
index 1536828..d00df1f 100644 (file)
@@ -2023,6 +2023,8 @@ write_type (tree type)
 
            case NULLPTR_TYPE:
              write_string ("Dn");
+             if (abi_version_at_least (7))
+               ++is_builtin_type;
              break;
 
            case TYPEOF_TYPE:
index 83af065..f3f6895 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-15  Jason Merrill  <jason@redhat.com>
 
+       PR c++/52706
+       * g++.dg/cpp0x/nullptr27.C: New.
+
        PR c++/52818
        * g++.dg/warn/format8.C: New.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/nullptr27.C b/gcc/testsuite/g++.dg/cpp0x/nullptr27.C
new file mode 100644 (file)
index 0000000..1b86868
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/52706
+// { dg-options "-std=c++11 -fabi-version=0" }
+// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } }
+
+template<class T, decltype(nullptr) = nullptr>
+int f(T);
+
+int i2 = f(nullptr); // 17