aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ac0ad6b..12f4b9b 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1151,6 +1151,20 @@ implicit_conversion (to, from, expr, flags)
tree conv;
struct z_candidate *cand;
+ /* Resolve expressions like `A::p' that we thought might become
+ pointers-to-members. */
+ if (expr && TREE_CODE (expr) == OFFSET_REF)
+ {
+ expr = resolve_offset_ref (expr);
+ from = TREE_TYPE (expr);
+ }
+
+ if (from == error_mark_node || to == error_mark_node
+ || expr == error_mark_node)
+ return NULL_TREE;
+
+ /* Make sure both the FROM and TO types are complete so that
+ user-defined conversions are available. */
complete_type (from);
complete_type (to);