mikaelholmen wrote:
> > > Is this expected and wanted?
> >
> >
> > Good catch! I would not expect that diagnostic; we should silence the
> > diagnostic if it's used in a `#ifdef`, `#elifdef`, or `defined` because the
> > value isn't necessary. Perhaps we should also silence something like
>
zahiraam wrote:
> > Is this expected and wanted?
>
> Good catch! I would not expect that diagnostic; we should silence the
> diagnostic if it's used in a `#ifdef`, `#elifdef`, or `defined` because the
> value isn't necessary. Perhaps we should also silence something like
> `sizeof(INFINITY)`
@@ -0,0 +1,181 @@
+// Use of NAN macro will trigger a warning "infinity defined in macro" because
+// on Windows the NAN macro is defined using INFINITY. See below.
+
+// RUN: %clang_cc1 -x c++ -verify=no-inf-no-nan -triple
powerpc64le-unknown-unknown %s \
+// RUN:
https://github.com/AaronBallman approved this pull request.
The changes LGTM aside from some minor improvements to the tests.
https://github.com/llvm/llvm-project/pull/76873
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -2835,6 +2835,9 @@ class Preprocessor {
if (Identifier.getIdentifierInfo()->isRestrictExpansion() &&
!SourceMgr.isInMainFile(Identifier.getLocation()))
emitRestrictExpansionWarning(Identifier);
+
+if (Identifier.getIdentifierInfo()->getName() ==
@@ -13861,6 +13897,36 @@ Sema::CheckReturnValExpr(Expr *RetValExp, QualType
lhsType,
CheckPPCMMAType(RetValExp->getType(), ReturnLoc);
}
+/// Diagnose comparison to NAN or INFINITY in fast math modes.
+/// The comparison to NaN or INFINITY is always false in
+/// fast