[Webkit-unassigned] [Bug 88721] New: Compile error: 'bool std::isinf(float)' is not 'constexpr'

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 9 18:23:46 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=88721

           Summary: Compile error: 'bool std::isinf(float)' is not
                    'constexpr'
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bos at je-eigen-domein.nl


Compile error:

==
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h: In function 'bool std::wtf_isinf(float)':
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h:292:63: error: 'bool std::isinf(float)' is not 'constexpr'
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h: In function 'bool std::wtf_isinf(double)':
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h:293:64: error: 'bool std::isinf(double)' is not 'constexpr'
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h: In function 'bool std::wtf_isnan(float)':
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h:294:63: error: 'bool std::isnan(float)' is not 'constexpr'
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h: In function 'bool std::wtf_isnan(double)':
[...]/WebKit-r119255/Source/WTF/wtf/MathExtras.h:295:64: error: 'bool std::isnan(double)' is not 'constexpr'
==


Concerns the following code:

==
#if COMPILER_QUIRK(GCC11_GLOBAL_ISINF_ISNAN)
// A workaround to avoid conflicting declarations of isinf and isnan when compiling with GCC in C++11 mode.
namespace std {
    constexpr bool wtf_isinf(float f) { return std::isinf(f); }
    constexpr bool wtf_isinf(double d) { return std::isinf(d); }
    constexpr bool wtf_isnan(float f) { return std::isnan(f); }
    constexpr bool wtf_isnan(double d) { return std::isnan(d); }
};

using std::wtf_isinf;
using std::wtf_isnan;

#define isinf(x) wtf_isinf(x)
#define isnan(x) wtf_isnan(x)
#endif
==

Seems that with the gcc 4.6.3 the function std::isinf() is not marked constexpr, so wtf_isinf() may not be that either.
After replacing "constexpr" with "inline" it does compile.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list