[Bug tree-optimization/95769] Constant expression in inline function not optimized

gcc at mailinator dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 19 15:45:59 GMT 2020


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

--- Comment #2 from John Simon <gcc at mailinator dot com> ---
(In reply to Jakub Jelinek from comment #1)
> If you want to ensure a function is evaluated at compile time, it needs to
> be either C++20 consteval, or you need to evaluate it in constant expression
> context, e.g. constexpr auto x = expensive_function(10000);

in this case, doing that will make the `other_function` consteval too, so I
can't call it with non-constant values.


More information about the Gcc-bugs mailing list