Commit 6f67f000 by Mark Mitchell Committed by Mark Mitchell

re PR c++/28557 (Trouble with templated type conversion operator)

	PR c++/28557
	* pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
	PR c++/28557
	* g++.dg/template/conv9.C: New test.

From-SVN: r115886
parent 006d133d
2006-08-02 Mark Mitchell <mark@codesourcery.com>
PR c++/28557
* pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
2006-07-31 Mark Mitchell <mark@codesourcery.com> 2006-07-31 Mark Mitchell <mark@codesourcery.com>
PR c++/28523 PR c++/28523
......
...@@ -7675,6 +7675,7 @@ tsubst_baselink (tree baselink, tree object_type, ...@@ -7675,6 +7675,7 @@ tsubst_baselink (tree baselink, tree object_type,
tree name; tree name;
tree qualifying_scope; tree qualifying_scope;
tree fns; tree fns;
tree optype;
tree template_args = 0; tree template_args = 0;
bool template_id_p = false; bool template_id_p = false;
...@@ -7688,6 +7689,7 @@ tsubst_baselink (tree baselink, tree object_type, ...@@ -7688,6 +7689,7 @@ tsubst_baselink (tree baselink, tree object_type,
ambiguous now. Therefore, we perform the lookup again. */ ambiguous now. Therefore, we perform the lookup again. */
qualifying_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (baselink)); qualifying_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (baselink));
fns = BASELINK_FUNCTIONS (baselink); fns = BASELINK_FUNCTIONS (baselink);
optype = BASELINK_OPTYPE (baselink);
if (TREE_CODE (fns) == TEMPLATE_ID_EXPR) if (TREE_CODE (fns) == TEMPLATE_ID_EXPR)
{ {
template_id_p = true; template_id_p = true;
...@@ -7715,6 +7717,9 @@ tsubst_baselink (tree baselink, tree object_type, ...@@ -7715,6 +7717,9 @@ tsubst_baselink (tree baselink, tree object_type,
= build_nt (TEMPLATE_ID_EXPR, = build_nt (TEMPLATE_ID_EXPR,
BASELINK_FUNCTIONS (baselink), BASELINK_FUNCTIONS (baselink),
template_args); template_args);
/* Update the conversion operator type. */
BASELINK_OPTYPE (baselink)
= tsubst (optype, args, complain, in_decl);
if (!object_type) if (!object_type)
object_type = current_class_type; object_type = current_class_type;
......
2006-08-02 Mark Mitchell <mark@codesourcery.com>
PR c++/28557
* g++.dg/template/conv9.C: New test.
2006-08-02 Daniel Jacobowitz <dan@codesourcery.com> 2006-08-02 Daniel Jacobowitz <dan@codesourcery.com>
PR debug/28063 PR debug/28063
// PR c++/28557
struct A
{
template<typename T> operator T() { return T(); }
};
template<int> void foo()
{
A().operator int();
}
void bar()
{
foo<0>();
}
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