https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111281
--- Comment #4 from Frank Heckenbach <f.heckenb...@fh-soft.de> --- FWIW, as stated, the lack of context in the message made it hard to find the actual location of the bug in my code -- in the end even harder than I had expected since it was well hidden. Fortunately I was able use concepts to the rescue. Otherwise it would have been pure guesswork. Here's what I did if anyone cares: #include <iostream> template <typename T> concept IsFunction = std::is_function_v <T> || (std::is_pointer_v <T> && std::is_function_v <std::remove_pointer_t<T>>); template <typename T> concept Outputtable = !IsFunction <std::remove_cvref_t <T>> || std::is_same_v <T, std::ios_base & (std::ios_base &)>; // the latter part is for std::left etc. void f (const Outputtable auto &v) { std::cout << v; } int t (); int main () { f (t); }