-Wcast-qual does not trigger on the following code in Clang, but does in GCC.
const auto i = 42; using T = int*; auto p = T(&i);
The expected behavior is that a functional cast should trigger
the warning the same as the equivalent C cast because
the meaning is the same, and nothing about the functional cast
makes it easier to recognize that a const_cast is occurring.
I would actually like to see each test above replicated for the functional cast. I realize this is a lot of work but we want to be sure that the diagnostic is really doing the equivalent check for both functional and non-functional cast.
I am not sure if we just do them right below each non-functional case of split out the functional cast cases into their own functions.
@aaron.ballman please let me know if you disagree here.