http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46507
Marc Glisse <glisse at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|std::tuple missed |std::get and |optimization |devirtualization on | |non-automatic variables --- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> --- I just read this comment in ipa-prop.c: "only for automatically allocated objects but at the moment we devirtualize only these". And indeed, if we define an automatic variable of type A and call arg_tuple_test on it (and that call is inlined), then the call to f is devirtualized. So this is a known limitation of the current devirtualization code. I don't think there is anything we can do at the library level.