diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-02 20:35:41 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-02 20:35:41 +0000 |
| commit | d85b6f37f8ce4a1783edeffb332682f395c5e6a9 (patch) | |
| tree | c28fb1643c0e1a9c9a02e7b33be1f25e44a31cb2 | |
| parent | 64460b363aba44f641b6adb4ede0079a0c84b154 (diff) | |
| download | ppe42-gcc-d85b6f37f8ce4a1783edeffb332682f395c5e6a9.tar.gz ppe42-gcc-d85b6f37f8ce4a1783edeffb332682f395c5e6a9.zip | |
PR c++/28557
* pt.c (tsubst_baselink): Substitute into BASELINK_OPTYPE.
PR c++/28557
* g++.dg/template/conv9.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115886 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/pt.c | 5 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/template/conv9.C | 16 |
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1e327c22e76..9feacb451bc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> PR c++/28523 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 30e6cd09a4b..c0205a419c7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7675,6 +7675,7 @@ tsubst_baselink (tree baselink, tree object_type, tree name; tree qualifying_scope; tree fns; + tree optype; tree template_args = 0; bool template_id_p = false; @@ -7688,6 +7689,7 @@ tsubst_baselink (tree baselink, tree object_type, ambiguous now. Therefore, we perform the lookup again. */ qualifying_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (baselink)); fns = BASELINK_FUNCTIONS (baselink); + optype = BASELINK_OPTYPE (baselink); if (TREE_CODE (fns) == TEMPLATE_ID_EXPR) { template_id_p = true; @@ -7715,6 +7717,9 @@ tsubst_baselink (tree baselink, tree object_type, = build_nt (TEMPLATE_ID_EXPR, BASELINK_FUNCTIONS (baselink), template_args); + /* Update the conversion operator type. */ + BASELINK_OPTYPE (baselink) + = tsubst (optype, args, complain, in_decl); if (!object_type) object_type = current_class_type; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8aa4e1a1778..4df1b9a5945 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR debug/28063 diff --git a/gcc/testsuite/g++.dg/template/conv9.C b/gcc/testsuite/g++.dg/template/conv9.C new file mode 100644 index 00000000000..269e338a36c --- /dev/null +++ b/gcc/testsuite/g++.dg/template/conv9.C @@ -0,0 +1,16 @@ +// PR c++/28557 + +struct A +{ + template<typename T> operator T() { return T(); } +}; + +template<int> void foo() +{ + A().operator int(); +} + +void bar() +{ + foo<0>(); +} |

