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/semantics.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/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c9f3675..8670f8b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1585,7 +1585,7 @@ perform_koenig_lookup (tree fn, tree args) Returns code for the call. */ tree -finish_call_expr (tree fn, tree args, bool disallow_virtual) +finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) { tree result; tree orig_fn; @@ -1605,7 +1605,11 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual) { if (type_dependent_expression_p (fn) || any_type_dependent_arguments_p (args)) - return build_nt (CALL_EXPR, fn, args); + { + result = build_nt (CALL_EXPR, fn, args); + KOENIG_LOOKUP_P (result) = koenig_p; + return result; + } if (!BASELINK_P (fn) && TREE_CODE (fn) != PSEUDO_DTOR_EXPR && TREE_TYPE (fn) != unknown_type_node) @@ -1707,7 +1711,10 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual) result = build_function_call (fn, args); if (processing_template_decl) - return build (CALL_EXPR, TREE_TYPE (result), orig_fn, orig_args); + { + result = build (CALL_EXPR, TREE_TYPE (result), orig_fn, orig_args); + KOENIG_LOOKUP_P (result) = koenig_p; + } return result; } |