Splitting cbrt and fma off from D39611, so we can deal with complex.h separately.
I've also gone ahead with a 'fix' for the fma case in CodeGenFunction::EmitBuiltinExpr(). But as noted previously, there's no test change because we were ignoring the const-ness of something that might have been non-const. Now, we're correctly checking that attribute even though there's no way it can be non-const. So if we change our minds about the fma decision, we'll do it in the right place. :)
Copying from D39611:
- Cube root
We're going to dismiss POSIX language like this:
"On successful completion, cbrt() returns the cube root of x. If x is NaN, cbrt() returns NaN and errno may be set to [EDOM]. "
And favor an interpretation based on the C standard that says:
"Functions with a NaN argument return a NaN result and raise no floating-point exception, except where stated otherwise."
- Floating multiply-add
The C standard is silent?
http://pubs.opengroup.org/onlinepubs/9699919799/functions/fma.html - clearly says "...then errno shall be set..."
https://linux.die.net/man/3/fma - "These functions do not set errno."
Let's opt for the - hopefully common - implementation where errno is not set. Note that there's no test change because as noted in the earlier discussion, we're ignoring the const attr in CodeGenFunction::EmitBuiltinExpr(). I'll look at what needs fixing in that function next.