Then there's the question why the outer function has to be a template
as well for this to happen: It's because if it's not a template, gdc
uses a completely different code path: There's a
"!gen.functionNeedsChain (f)" check in outputFunction which is false
for the failing case. (cgraph_finalize_function marks the function as
reachable)
BTW: I think that this isn't happening in gcc-4.8 is pure luck. Most of
the cgraph_analyze* functions have been rewritten in gcc-4.8. But I
think this specific case is still bogus (we tell the backend that
we can access percolateDown from outside the unit even though it
requires access to a function which is only valid in a limited scope)