PR c++/16171
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Sep 2005 15:15:37 +0000 (15:15 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Sep 2005 15:15:37 +0000 (15:15 +0000)
* mangle.c (find_substitution): Do not use special substitutions
for identifiers not in std::.

PR c++/16171
* g++.dg/abi/mangle26.C: New test.
* g++.dg/abi/mangle27.C: New test.
* g++.dg/abi/mangle28.C: New test.
* g++.dg/abi/mangle29.C: New test.

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

gcc/cp/ChangeLog
gcc/cp/mangle.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/mangle26.C [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/mangle27.C [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/mangle28.C [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/mangle29.C [new file with mode: 0644]

index d7fd5ea..4033dc3 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-13  Bastian Blank <waldi@debian.org>
+
+       PR c++/16171
+       * mangle.c (find_substitution): Do not use special substitutions
+       for identifiers not in std::.
+       
 2005-09-13  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/23839
index 5cae850..9dca2a5 100644 (file)
@@ -606,20 +606,19 @@ find_substitution (tree node)
                                       SUBID_CHAR_TRAITS))
        {
          /* Got them.  Is this basic_istream?  */
-         tree name = DECL_NAME (CLASSTYPE_TI_TEMPLATE (type));
-         if (name == subst_identifiers[SUBID_BASIC_ISTREAM])
+         if (is_std_substitution (decl, SUBID_BASIC_ISTREAM))
            {
              write_string ("Si");
              return 1;
            }
          /* Or basic_ostream?  */
-         else if (name == subst_identifiers[SUBID_BASIC_OSTREAM])
+         else if (is_std_substitution (decl, SUBID_BASIC_OSTREAM))
            {
              write_string ("So");
              return 1;
            }
          /* Or basic_iostream?  */
-         else if (name == subst_identifiers[SUBID_BASIC_IOSTREAM])
+         else if (is_std_substitution (decl, SUBID_BASIC_IOSTREAM))
            {
              write_string ("Sd");
              return 1;
index 8aaa169..c192765 100644 (file)
@@ -1,4 +1,10 @@
-2005-09-13  Mark Mitchell  <mark@codesourcery.com>
+2005-09-13  Bastian Blank <waldi@debian.org>
+
+       PR c++/16171
+       * g++.dg/abi/mangle26.C: New test. 
+       * g++.dg/abi/mangle27.C: New test. 
+       * g++.dg/abi/mangle28.C: New test. 
+       * g++.dg/abi/mangle29.C: New test. 
 
        PR c++/23839
        * g++.dg/parse/register1.C: New test.
diff --git a/gcc/testsuite/g++.dg/abi/mangle26.C b/gcc/testsuite/g++.dg/abi/mangle26.C
new file mode 100644 (file)
index 0000000..cfec4b9
--- /dev/null
@@ -0,0 +1,14 @@
+// Test of std mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+  struct A {
+    virtual void f () { }
+  };
+}
+
+std::A a;
+
+// { dg-final { scan-assembler "\n_?_ZNSt1AC1Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle27.C b/gcc/testsuite/g++.dg/abi/mangle27.C
new file mode 100644 (file)
index 0000000..da4efba
--- /dev/null
@@ -0,0 +1,14 @@
+// Test of std::basic_iostream<char, std::char_traits<char> > mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+  template<typename> struct char_traits;
+
+  template<typename, typename> struct basic_iostream { basic_iostream(){} };
+}
+
+std::basic_iostream<char,std::char_traits<char> > s1;
+
+// { dg-final { scan-assembler "\n_?_ZNSdC1Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle28.C b/gcc/testsuite/g++.dg/abi/mangle28.C
new file mode 100644 (file)
index 0000000..b8c40ca
--- /dev/null
@@ -0,0 +1,14 @@
+// Test of std::basic_istream<char, std::char_traits<char> > mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+  template<typename> struct char_traits;
+
+  template<typename, typename> struct basic_istream { basic_istream(){} };
+}
+
+std::basic_istream<char,std::char_traits<char> > s1;
+
+// { dg-final { scan-assembler "\n_?_ZNSiC1Ev\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle29.C b/gcc/testsuite/g++.dg/abi/mangle29.C
new file mode 100644 (file)
index 0000000..4f64efb
--- /dev/null
@@ -0,0 +1,14 @@
+// Test of std::basic_ostream<char, std::char_traits<char> > mangling
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+namespace std {
+  template<typename> struct char_traits;
+
+  template<typename, typename> struct basic_ostream { basic_ostream(){} };
+}
+
+std::basic_ostream<char,std::char_traits<char> > s1;
+
+// { dg-final { scan-assembler "\n_?_ZNSoC1Ev\[: \t\n\]" } }