[llvm-bugs] [Bug 44674] SFINAE leaks through requires expression requirement

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 31 10:51:52 PST 2020


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

Saar Raz <saar at raz.email> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Saar Raz <saar at raz.email> ---
The overload of std::to_address has a deduced return type, so when it is
referenced from the requires expression, even though it is in an unevaluated
context, the body of the function is instantiated in order to deduce the return
type, which triggers the error down the line.

My first comment is incorrect and indeed 
```
template<typename T> int foo() { return T::value; }

template<typename T> concept C = requires { foo<T>(); }

static_assert(!C<int>);
```
Should (and does) not give a hard error.
This should give a hard error and is analogous to the case we see here:
```
template<typename T> auto foo() { return T::value; }

template<typename T> concept C = requires { foo<T>(); }

static_assert(!C<int>);
```

-- 
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/20200131/d4d162bc/attachment.html>


More information about the llvm-bugs mailing list