[Bug libstdc++/94960] extern template prevents inlining of standard library objects

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 5 21:08:31 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94960

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-05-05
     Ever confirmed|0                           |1
           Keywords|                            |missed-optimization

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please provide complete testcases, not just URLs, as required by
https://gcc.gnu.org/bugs

#include <string>

int main()
{
    std::string(size_t(0), 0);
}


I still think it's wrong for GCC to treat the 'inline' specifier as an inlining
hint. The compiler should be a better judge of inlining decisions than the
developer.

(In reply to Andrew Pinski from comment #1)
> g:1a289fa36294627c252492e4c18d7877a7c80dc1 changed that.

Well that commit just meant that the explicit instantiations are declared for
C++17 as well, where previously they were only declared for < C++17. It didn't
add the explicit instantiations.


More information about the Gcc-bugs mailing list