diff options
Diffstat (limited to 'gcc/cp/semantics.c')
| -rw-r--r-- | gcc/cp/semantics.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 37dca0a..ef42579 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2887,6 +2887,26 @@ expand_body (tree fn) static duration objects. */ if (DECL_STATIC_DESTRUCTOR (fn)) static_dtors = tree_cons (NULL_TREE, fn, static_dtors); + + if (DECL_CLONED_FUNCTION_P (fn)) + { + /* If this is a clone, go through the other clones now and mark + their parameters used. We have to do that here, as we don't + know whether any particular clone will be expanded, and + therefore cannot pick one arbitrarily. */ + tree probe; + + for (probe = TREE_CHAIN (DECL_CLONED_FUNCTION (fn)); + probe && DECL_CLONED_FUNCTION_P (probe); + probe = TREE_CHAIN (probe)) + { + tree parms; + + for (parms = DECL_ARGUMENTS (probe); + parms; parms = TREE_CHAIN (parms)) + TREE_USED (parms) = 1; + } + } } /* Generate RTL for FN. */ |
