aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-04-08 02:08:13 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-04-08 02:08:13 -0400
commit3a2cb4d037cc66a0b6567d944cbc9450adf11814 (patch)
treed9df08540a47670491171f7843e50c2e8dc8420f /gcc/cp/name-lookup.c
parentc9b558895e7c82d5973c8682c766dedb95bb4d32 (diff)
downloadgcc-3a2cb4d037cc66a0b6567d944cbc9450adf11814.zip
gcc-3a2cb4d037cc66a0b6567d944cbc9450adf11814.tar.gz
gcc-3a2cb4d037cc66a0b6567d944cbc9450adf11814.tar.bz2
re PR c++/48481 (C++ overloading memory hog)
PR c++/48481 * cp-tree.h (OVL_ARG_DEPENDENT): New. * name-lookup.c (add_function): Set it. * semantics.c (finish_call_expr): Free OVERLOADs if it's set. From-SVN: r172163
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 18e3441..696a8f5 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -4725,7 +4725,11 @@ add_function (struct arg_lookup *k, tree fn)
else if (fn == k->functions)
;
else
- k->functions = build_overload (fn, k->functions);
+ {
+ k->functions = build_overload (fn, k->functions);
+ if (TREE_CODE (k->functions) == OVERLOAD)
+ OVL_ARG_DEPENDENT (k->functions) = true;
+ }
return false;
}