Short version
Yes.
On normal Linux systems that use glibc you will still get the MATH_ERREXCEPT bit (value 2) even when you compile with -fno-trapping-math on either GCC or Clang, so the expression
c
(math_errhandling & MATH_ERREXCEPT)
folds to a non-zero constant (true).
─────────────────────────────────────────────
What the quick test looks like
MATH_ERRNO is 1, MATH_ERREXCEPT is 2, so 3 means both bits are present.
─────────────────────────────────────────────
Why the option doesn’t change the macro
The macro comes from math.h (glibc’s version in this test).
It is completely independent of any GCC/Clang command-line option; it is
decided by the C library headers when they are pre-processed.
-fno-trapping-math only tells the compiler “assume FP exceptions never trap, so feel free to reorder/remove FP operations”.
It does not alter whether the underlying libm functions will actually raise
floating-point status flags, and the macro only reports that capability
(MATH_ERREXCEPT), not whether traps will occur.
If you compile on a system that uses a different C library (musl, newlib,
MSVC, etc.) you might see a different constant:
musl ⇒ math_errhandling == MATH_ERRNO (1)
newlib ⇒ often MATH_ERRNONE (0)
(“no errno, no exceptions”)
So always test on the exact target platform if your code relies on it.
─────────────────────────────────────────────
Bottom line
With current GCC and Clang on glibc-based Linux, -fno-trapping-math
does not affect math_errhandling; the MATH_ERREXCEPT bit stays set, so
the check you asked about evaluates to true.