This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
patch that caused change reported in PR c++/8964
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc at gcc dot gnu dot org, mark at codesourcery dot com
- Date: Mon, 23 Dec 2002 09:47:54 -0800
- Subject: patch that caused change reported in PR c++/8964
PR c++/8964 reports a change in name mangling that is not affected by
the --abi-version switch. It's caused by this patch, which adds a
-Wabi warning that is issued for this test case, and information to the
documentation about this kind of code.
Should the name mangling here be affected by --abi-version?
--- gcc/gcc/ChangeLog ---
2002-10-03 Mark Mitchell <mark@codesourcery.com>
* doc/invoke.texi (-Wabi): Document mangling bug.
--- gcc/gcc/cp/ChangeLog ---
2002-10-03 Mark Mitchell <mark@codesourcery.com>
PR c++/8006
* mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template
template parameters.
(globals): Add entity and need_abi_warning.
(decl_is_template_id): Use TYPE_TEMPLATE_INFO, not
CLASSTYPE_TEMPLATE_INFO.
(is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not
TYPE_TI_TEMPLATE.
(write_prefix): Handle typename types correctly.
(write_template_prefix): Handle template template parameters
correctly.
(start_mangling): Add entity parameter.
(finish_mangling): Warn about names whose mangling will change.
(mangle_decl_string): Adjust.
(mangle_type_string): Likewise.
(mangle_special_for_type): Likewise.
(mangle_ctor_vtbl_for_type): Likewise.
(mangle_thunk): Likewise.
(mangle_guard_variable): Likewise.
(mangle_ref_init_variable): Likewise.
Here's a small test case that causes the assembler to complain
about duplicate symbols before the change, but not after.
-------------------
// two names get the same mangling; ABI change
struct bus{};
template < class T,int I > struct A
{
typedef bus X;
};
template<class T> struct A<T,3>
{
typedef char X;
};
template <template <class B,int I> class XX>
void foo(typename XX<int,3>::X a){}
template <template <class B,int I> class XX>
void foo(typename XX<int,4>::X a){}
int main()
{
struct bus test;
foo<A>('x');
foo<A>(test);
}
-------------------
I'll add this information to the PR.
Janis