Consider the following code snippet:
using A = void(*)(int);
A foo(const void* ptr)
{
return reinterpret_cast<A>(ptr);
}
GCC 10 likes this just fine. clang++-10, however, says this is an error!
<source>:5:12: error: reinterpret_cast from 'const void *' to 'A' (aka 'void
(*)(int)') casts away qualifiers
return reinterpret_cast<A>(ptr);
^~~~~~~~~~~~~~~~~~~~~~~~
Functions aren't mutable in C++ (and C), and there are no "const functions". So why is clang++ complaining here?

