<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - SFINAE leaks through requires expression requirement"
   href="https://bugs.llvm.org/show_bug.cgi?id=44674">44674</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SFINAE leaks through requires expression requirement
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++2a
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cjdb.ns@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23063" name="attach_23063" title="Initial preprocessed file">attachment 23063</a> <a href="attachment.cgi?id=23063&action=edit" title="Initial preprocessed file">[details]</a></span>
Initial preprocessed file

# Description

[iterator.concept.contiguous] depends on `std::to_address`, which (correctly)
fails in the "minimal" repro below. Unfortunately, the requirement seems to
leak an instantiation error, instead of SFINAEing out the overload and the
concept evaluating as false.

# LLVM configuration

```
cmake -GNinja  ../llvm-project/llvm/                                           
     \
   -DCMAKE_C_COMPILER=/usr/bin/clang-9                                         
     \
   -DCMAKE_CXX_COMPILER=/usr/bin/clang++-9                                     
     \
   -DCMAKE_BUILD_TYPE=Release                                                  
     \
   -DLLVM_TARGETS_TO_BUILD=X86                                                 
     \
  
-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;lld'
\
   -DLLVM_ENABLE_LLD=On                                                        
     \
   -DLLVM_ENABLE_LTO=Off                                                       
     \
   -DPYTHON_EXECUTABLE=/usr/bin/python3                                        
     \
   -DLLVM_ENABLE_LIBCXX=On                                                     
     \
   -DLLVM_ENABLE_BINDINGS=Off
```

# Sample code built with

```
-std=c++2a -stdlib=libc++ -save-temps
```

# "Minimal" repo

```
#include <memory>

struct dummy {};

struct iterator {
        using element_type = dummy;
        int* operator->() const;
};

template<typename I>
concept passing = requires(I const& i) {
    std::to_address(i);
};

static_assert(not passing<iterator>);
```</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>