Commit 4a5e0ed9 by Mark Mitchell Committed by Mark Mitchell

re PR c++/13883 (Assembler messages: symbol is already defined)

	PR c++/13883
	* mangle.c (write_encoding): Correct encoding of member template
	constructors.

	PR c++/13883
	* g++.dg/template/ctor3.C: New test.

From-SVN: r76868
parent 8cfb1942
2004-01-29 Mark Mitchell <mark@codesourcery.com>
PR c++/13883
* mangle.c (write_encoding): Correct encoding of member template
constructors.
2004-01-28 Giovanni Bajo <giovannibajo@gcc.gnu.org> 2004-01-28 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* parser.c (cp_parser_template_id): Parse tentatively `[:' after a * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
......
...@@ -688,18 +688,29 @@ write_encoding (const tree decl) ...@@ -688,18 +688,29 @@ write_encoding (const tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
{ {
tree fn_type; tree fn_type;
tree d;
if (decl_is_template_id (decl, NULL)) if (decl_is_template_id (decl, NULL))
fn_type = get_mostly_instantiated_function_type (decl); {
fn_type = get_mostly_instantiated_function_type (decl);
/* FN_TYPE will not have parameter types for in-charge or
VTT parameters. Therefore, we pass NULL_TREE to
write_bare_function_type -- otherwise, it will get
confused about which artificial parameters to skip. */
d = NULL_TREE;
}
else else
fn_type = TREE_TYPE (decl); {
fn_type = TREE_TYPE (decl);
d = decl;
}
write_bare_function_type (fn_type, write_bare_function_type (fn_type,
(!DECL_CONSTRUCTOR_P (decl) (!DECL_CONSTRUCTOR_P (decl)
&& !DECL_DESTRUCTOR_P (decl) && !DECL_DESTRUCTOR_P (decl)
&& !DECL_CONV_FN_P (decl) && !DECL_CONV_FN_P (decl)
&& decl_is_template_id (decl, NULL)), && decl_is_template_id (decl, NULL)),
decl); d);
} }
} }
......
2004-01-29 Mark Mitchell <mark@codesourcery.com>
PR c++/13883
* g++.dg/template/ctor3.C: New test.
2004-01-29 Giovanni Bajo <giovannibajo@gcc.gnu.org> 2004-01-29 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* g++.dg/tc1: New directory. * g++.dg/tc1: New directory.
......
struct A {};
struct B;
template <class TP> struct X: virtual A {
template <class TP2> X(TP2* ptr) {}
template <class TP2> X(const X<TP2>) {}
};
struct Y : X<B> {
Y(A* a) : X<B>(a) {}
};
void func1(X<B>);
void func2() {
A a;
Y y(&a);
func1(X<A>(&a));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment