<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56014>56014</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] void is apparently referenceable
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang,
            clang:diagnostics,
            invalid-code-generation
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          cjdb
      </td>
    </tr>
</table>

<pre>
    The following shouldn't be well-formed, but it is in Clang.
```cpp
template<class T>
using with_reference = T&;

template<class T>
concept can_reference = requires {
  typename with_reference<T>;
};

template<class T>
concept dereferenceable = requires(T& t) {
  { *t } -> can_reference;
};

static_assert(dereferenceable<void*>);
```

**Clang invocation:** `clang++ -std=c++20 -pedantic -pedantic-errors file.cpp`

**Version:**
```
clang version 15.0.0 (https://github.com/llvm/llvm-project.git 186a13f647acac623898bcffa4b966624d2358ba)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-trunk/bin
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVE1vozAQ_TXOxQKB-QgcOKTNVtp7tdfK2ANx17FZ2yTpv98xpE1bVbuqZAmbGb_3Zt5Ab-VL93gAOlit7VmZkfqDnbU0hG0D7YGeQetksO4IkrB72s-BKlyeKkPvNTdjSrI9yXakztYlpml9E-A4aR6AFPdCc-_pIyl-rKHZR6azCocnBwM4MAIoKfaYwmpS3F0h_wcjLN6bAhXcfMJx8GdWDjwl2ysYpeFlAsOP8IkXcRfEN9bt_vsKJLzh8V5_1EBYE8uigbD2vR7cUsJ2ATd7miDkxzr-IcgHHpR4QingELX5xI46T1ahXbuok7W3268evQeLaWy3WImenqxAbGtIcQ3QaGkMEnaHiyY-SKxOrEeW0WQCyQ3que0ScM46TwelIY3z8BXjL3D-PdGXEhdmelpTaV6lWZph05pDCJNfrj7gGtHQuU-FPeJB69PrI5mcfQYRUkygeVPzvBjqcssFFzUrmrbpxTDwsm_rumalZEXV9Dw2bOF-5G6EgCT00tRPdZnM5rexZ5NoZeZLMpr5mndwwCU9Wgk6Zk_Wq8sa-mnQKq1B7pWLIdRlJ3TsAaVO2ByXwGXS1oGL72KtSXBIg6demU8d2ciukG3R8k1QQUNHqrvVmGpPo9_xo-TTxHEOgn6hH0ZiMzvdfa9peFTez3F-H6o6y8vNocvEVrI-q2Qu8kpkome8EtWAD9lmTVtvNO9B-yiNMHYdGxb_G2_HYicVH431OCf-FsTJ41rJRGAXkxEMuHUMMaHab1THMsayOi_yqqzyPB3Qu3qAum5LkJXckjKDI1c6jRWk1o0b1y3F9PPoMaiVD_4WxC9HjQaWHkZ8PoeDdZ14lv1mKbpbKv4LRuiOsA">