[llvm-bugs] [Bug 47893] New: Rewritten comparison expression is not checked for SFINAE

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 18 11:29:41 PDT 2020


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

            Bug ID: 47893
           Summary: Rewritten comparison expression is not checked for
                    SFINAE
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: igor.akhmetov at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

https://gcc.godbolt.org/z/zsbc1Y
Clang fails to substitute foo here, while it should have picked the second
overload because of SFINAE:

#include <compare>

struct X
{
    void operator <=>(X const &) const {}
};

template<typename T, typename = decltype(T{} < T{})>
void foo(T t) {}

template<typename>
void foo(...);

void test()
{
    foo<X>(X{});
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201018/488d6198/attachment.html>


More information about the llvm-bugs mailing list