sepavloff added a comment. I don't think the constant evaluator is a right place for such warnings. The option `-ffast-math` is a hint to the compiler, which, in particular, tells that no operation on Nans/Infs take place. It allows a compiler to generate better code. None is pertinent for the constant evaluator, as it already has all information necessary for the evaluation and it does not generate any code. It does not make sense to add a new mode for constant evaluation as well. To make the warnings useful you probably need to check if a constant value is an operand of an arithmetic operation.
================ Comment at: clang/test/AST/warn-fp-values.c:49 +double neg_zero_literal() { + return -0.0; // shows warning if compile continues with -emit-llvm +} ---------------- `-ffast-math` does not prohibit using negative zero, it only treat it identically to positive zero. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109925/new/ https://reviews.llvm.org/D109925 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits