diff options
Diffstat (limited to 'gcc/cp/parser.c')
| -rw-r--r-- | gcc/cp/parser.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7284d4b..08af6e2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -9099,11 +9099,20 @@ cp_parser_template_argument (cp_parser* parser) argument = TREE_OPERAND (argument, 0); } - if (qualifying_class) + /* If ADDRESS_P, then we use finish_qualified_id_expr so + that we get a pointer-to-member, if appropriate. + However, if ADDRESS_P is false, we don't want to turn + "T::f" into "(*this).T::f". */ + if (qualifying_class && address_p) argument = finish_qualified_id_expr (qualifying_class, argument, /*done=*/true, - address_p); + /*address_p=*/true); + else if (TREE_CODE (argument) == BASELINK) + /* We don't need the information about what class was used + to name the overloaded functions. */ + argument = BASELINK_FUNCTIONS (argument); + if (TREE_CODE (argument) == VAR_DECL) { /* A variable without external linkage might still be a |
