https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767
Martin Uecker <muecker at gwdg dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |muecker at gwdg dot de --- Comment #2 from Martin Uecker <muecker at gwdg dot de> --- I agree the behavior is not ideal. Simplified some more: typedef void MyFunc(void); // the forward decl. suppresses the warning one would otherwise get static const MyFunc my_func; static void my_func() { } #if 1 const MyFunc* g_f = my_func; #else MyFunc* g_f = my_func; #endif int main(int argc, char* argv[]) { g_f(); } https://godbolt.org/z/rcodcqWPn