https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85509
Bug ID: 85509 Summary: auto (function pointer) undermining inline expansion with GCC but not LLVM Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: aaron_sami_abassi at hotmail dot com Target Milestone: --- Created attachment 44010 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44010&action=edit This code demonstrates the problem The attached code when compiled with optimizations in LLVM (I'm using 5.0.0) expands the call inline through the auto variables PerformQuickly and PerformSafely. Adding const solves the issue but GCC should be able to determine that the function pointer can never be modified and inline the function invocations as LLVM is doing.