]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/52706 ([C++11] Demangling of templates with std::nullptr_t as non-type...
authorJason Merrill <jason@redhat.com>
Sun, 15 Apr 2012 17:07:39 +0000 (13:07 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 15 Apr 2012 17:07:39 +0000 (13:07 -0400)
PR c++/52706
* mangle.c (write_type): nullptr_t is a builtin type.

From-SVN: r186469

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 39f1679ab1a83a2f2533a280313bedd3d817241e..ee0c66a4d9943061fc8d1ec6635fb7532e75c699 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 a00d7815b61f9ba2bf34bb89af8a822ece26611b..69d5b1d3428edc2ca3ad8278495611d6e747cccb 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 1536828a32cbfc3ff89a51bb373769ca2744c355..d00df1fe49aba13c1963ff918a60584f8b2b645f 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 83af0658f009a2e59b2a27c6eb7be0c4fe30acab..f3f68951bf493f7ff62ca6c5d717677bbe16f48f 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
This page took 0.07721 seconds and 5 git commands to generate.