seanm wrote:

Another compiler error after transformation:

It made this constexpr:

```c++
        PUGI_IMPL_FN constexpr bool is_nan(double value)
        {
        #if defined(PUGI_IMPL_MSVC_CRT_VERSION) || defined(__BORLANDC__)
                return !!_isnan(value);
        #elif defined(fpclassify) && defined(FP_NAN)
                return fpclassify(value) == FP_NAN;
        #else
                // fallback
                const volatile double v = value;
                return v != v;
        #endif
        }
```

But then:

```
/Users/sean/external/VTK/ThirdParty/pugixml/vtkpugixml/src/pugixml.cpp:8413:30: 
error: constexpr function never produces a constant expression 
[-Winvalid-constexpr]
 8413 |         PUGI_IMPL_FN constexpr bool is_nan(double value)
      |                                     ^~~~~~
/Users/sean/external/VTK/ThirdParty/pugixml/vtkpugixml/src/pugixml.cpp:8422:15: 
note: read of volatile-qualified type 'const volatile double' is not allowed in 
a constant expression
 8422 |                 return v != v;
      |                             ^
```

https://github.com/llvm/llvm-project/pull/146553
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to