diff options
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index dcce44a439f..213279ac0a9 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2374,12 +2374,12 @@ maybe_dummy_object (tree type, tree* binfop) if (binfop) *binfop = binfo; - if (current_class_ref && context == current_class_type - /* Kludge: Make sure that current_class_type is actually - correct. It might not be if we're in the middle of - tsubst_default_argument. */ - && same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (current_class_ref)), - current_class_type)) + if (current_class_ref + /* current_class_ref might not correspond to current_class_type if + we're in tsubst_default_argument or a lambda-declarator; in either + case, we want to use current_class_ref if it matches CONTEXT. */ + && (same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (current_class_ref), context))) decl = current_class_ref; else if (current != current_class_type && context == nonlambda_method_basetype ()) |