https://llvm.org/bugs/show_bug.cgi?id=23276

            Bug ID: 23276
           Summary: Template version of std::pow fails to compile
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

I came up with a compile error when using emscripten 1.30 on windows, which
uses libcxx as it's c++ library.
When I peeked into the headers to find out what exactly caused it, I determined
that this static assert was causing it to fail, the relevant lines are below.

typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value && is_same<_A2,
__result_type>::value)), "");

Essentially, the two is_same queries are being inverted, so if both are true
then false is being passed to static_assert. According to MSDN, static_assert
fails if it's false. Unless I am mistaken, it should work correctly without the
invert operator.

For reference, compiling with std::pow<float>(1.0f, 2.0f) was able to get this
error.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to