re PR c++/16171 ([ABI] Problems with standard names in different namespaces)

PR c++/16171
	* 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.

From-SVN: r104228
This commit is contained in:
Bastian Blank 2005-09-13 15:15:37 +00:00 committed by Mark Mitchell
parent 7b09c6a499
commit 3beac9100a
7 changed files with 72 additions and 5 deletions

View 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

View 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;

View 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.

View File

@ -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\]" } }

View File

@ -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\]" } }

View File

@ -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\]" } }

View File

@ -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\]" } }