diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 02:25:20 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 02:25:20 +0000 |
| commit | 9dc9ee8208587894de4bb7377f8a89d24b99e1a9 (patch) | |
| tree | 1e917da7345bbe99c4329abae07998e2d6e14561 | |
| parent | 3700180a2bb68e74a75997c0ebc4c184d9912c95 (diff) | |
| download | ppe42-gcc-9dc9ee8208587894de4bb7377f8a89d24b99e1a9.tar.gz ppe42-gcc-9dc9ee8208587894de4bb7377f8a89d24b99e1a9.zip | |
PR c++/37016
* decl.c (build_ptrmemfunc_type): Don't require structural
comparison of PMF types.
* tree.c (cp_build_qualified_type_real): Don't clear
a valid TYPE_PTRMEMFUNC_TYPE.
* typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
templates.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138756 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 9 | ||||
| -rw-r--r-- | gcc/cp/tree.c | 3 | ||||
| -rw-r--r-- | gcc/cp/typeck.c | 10 |
4 files changed, 18 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8ff23cdb5dd..8ece21d96f9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2008-08-05 Jason Merrill <jason@redhat.com> + + PR c++/37016 + * decl.c (build_ptrmemfunc_type): Don't require structural + comparison of PMF types. + * tree.c (cp_build_qualified_type_real): Don't clear + a valid TYPE_PTRMEMFUNC_TYPE. + * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in + templates. + 2008-08-04 Jason Merrill <jason@redhat.com> PR c++/36963 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1ed98eee4ff..69fa647881c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6961,16 +6961,17 @@ build_ptrmemfunc_type (tree type) TYPE_MAIN_VARIANT (t) = unqualified_variant; TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant); TYPE_NEXT_VARIANT (unqualified_variant) = t; + TREE_TYPE (TYPE_BINFO (t)) = t; } /* Cache this pointer-to-member type so that we can find it again later. */ TYPE_SET_PTRMEMFUNC_TYPE (type, t); - /* Managing canonical types for the RECORD_TYPE behind a - pointer-to-member function is a nightmare, so use structural - equality for now. */ - SET_TYPE_STRUCTURAL_EQUALITY (t); + if (TYPE_STRUCTURAL_EQUALITY_P (type)) + SET_TYPE_STRUCTURAL_EQUALITY (t); + else if (TYPE_CANONICAL (type) != type) + TYPE_CANONICAL (t) = build_ptrmemfunc_type (TYPE_CANONICAL (type)); return t; } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 4114f868d41..ff19cd69d8b 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -873,7 +873,8 @@ cp_build_qualified_type_real (tree type, between the unqualified and qualified types. */ if (result != type && TREE_CODE (type) == POINTER_TYPE - && TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE) + && TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE + && TYPE_LANG_SPECIFIC (result) == TYPE_LANG_SPECIFIC (type)) TYPE_LANG_SPECIFIC (result) = NULL; return result; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index feb6b5f8f54..fd3dba9345c 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4642,15 +4642,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, /* In a template, we are processing a non-dependent expression so we can just form an ADDR_EXPR with the correct type. */ - if (processing_template_decl) - { - val = build_address (arg); - if (TREE_CODE (arg) == OFFSET_REF) - PTRMEM_OK_P (val) = PTRMEM_OK_P (arg); - return val; - } - - if (TREE_CODE (arg) != COMPONENT_REF) + if (processing_template_decl || TREE_CODE (arg) != COMPONENT_REF) { val = build_address (arg); if (TREE_CODE (arg) == OFFSET_REF) |

