diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-09-02 17:32:30 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-09-02 17:32:30 +0000 |
commit | 6d80c4b9c828e26f69d0b83c812be9adabc82f61 (patch) | |
tree | 65c3770d9e946aeae6c734c1e1b699792957fe41 /gcc/cp/parser.c | |
parent | 7a0f2d4eae4e32deb67a0af399724a49663eab6e (diff) | |
download | gcc-6d80c4b9c828e26f69d0b83c812be9adabc82f61.zip gcc-6d80c4b9c828e26f69d0b83c812be9adabc82f61.tar.gz gcc-6d80c4b9c828e26f69d0b83c812be9adabc82f61.tar.bz2 |
re PR c++/11808 (Wrong namespace lookup for template function when induced by a template parameter)
PR c++/11808
* cp-tree.h (KOENIG_LOOKUP_P): New macro.
(finish_call_expr): Change prototype.
* parser.c (cp_parser_postfix_expression): Adjust call to
finish_call_expr.
* pt.c (tsubst_copy_and_build): Use KOENIG_LOOKUP_P.
* semantics.c (finish_call_expr): Add koenig_p parameter.
PR c++/11808
* g++.dg/expr/call1.C: New test.
From-SVN: r70998
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 735d592..01d6dba 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3506,6 +3506,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) case CPP_OPEN_PAREN: /* postfix-expression ( expression-list [opt] ) */ { + bool koenig_p; tree args = (cp_parser_parenthesized_expression_list (parser, false, /*non_constant_p=*/NULL)); @@ -3524,14 +3525,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) parser->non_constant_expression_p = true; } + koenig_p = false; if (idk == CP_ID_KIND_UNQUALIFIED) { if (args && (is_overloaded_fn (postfix_expression) || DECL_P (postfix_expression) || TREE_CODE (postfix_expression) == IDENTIFIER_NODE)) - postfix_expression - = perform_koenig_lookup (postfix_expression, args); + { + koenig_p = true; + postfix_expression + = perform_koenig_lookup (postfix_expression, args); + } else if (TREE_CODE (postfix_expression) == IDENTIFIER_NODE) postfix_expression = unqualified_fn_lookup_error (postfix_expression); @@ -3570,12 +3575,14 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) function. */ postfix_expression = finish_call_expr (postfix_expression, args, - /*disallow_virtual=*/true); + /*disallow_virtual=*/true, + koenig_p); else /* All other function calls. */ postfix_expression = finish_call_expr (postfix_expression, args, - /*disallow_virtual=*/false); + /*disallow_virtual=*/false, + koenig_p); /* The POSTFIX_EXPRESSION is certainly no longer an id. */ idk = CP_ID_KIND_NONE; |