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

    <tr>
        <th>Summary</th>
        <td>
            Clang rejects valid program involving point of instantiaion at end of file
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    The following valid program(afaik) is rejected by clang in c++20. [Demo](https://godbolt.org/z/sWfT97TPz)

```
#include <algorithm>
#include <vector>

struct Foo
{
};

struct FooArray
{
    std::vector<Foo> a;
};

bool operator<(const FooArray& a, const FooArray& b)
{
    return std::lexicographical_compare(std::begin(a.a), std::end(a.a), std::begin(b.a), std::end(b.a));
}

bool operator<(const Foo& a, const Foo& b)
{
    return false;
}
```

Note that clang in c++17 accepts this but in c+20 rejects it. A regression maybe?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMlE2PmzwQgH-NuYw2gjEJ4cAhH8vx1XtYqcdqMBNwa2xkm7TZX1-RTZrdTapWQgPMpx97xhSC7ixzJZZbsdwnNMXe-cqTJbLOjUnj2lP10jMcnDHuh7YdHMnoFkbvOk-DwDUdSH8XWIIO4Pkbq8gtNCdQhmwH2oISuBW4xXQBYrnd8-DEci9w3cc4BiE3AmuBdefaxpm4cL4TWL8KrMOXw0tZvPz_KrAU6V6km4tcpZfn7ReltspMLYOQOzKd8zr2g5DPj-xHVtH5m_EsQ_STilA7d9EW2-vHXsjtY9eN93T65A8AEGI7Q8nNtdRuziufgW6p7tI2zhlwI3t6CxG4Vs6Gd4VwBSRwB_fq5rY_79fhOU7e3pZj-KdW86GNvVZkvio3jORZ4Pq3S8OdtvORLmjOibtbNNv2seEa0_wp5mooP-D_I_s99t-JD2QCPyj2qW3O8j8XGWJP8a5dswJIKR5jgNjrAM0Ur1ZML40eQMcFbMBz5zkE7SwMdGpYyDppK9mWsqSEq6xAzLP1Mi-SvipUtiKSq1Lm-TovigLLQ7vOuWyyvJGsEl1hinlayCwt5TIvFmpZFrnM22KVNsxZKvKUB9JmYcxxmOcl0SFMXGVpJrMsMdSwCeeJRjxTCcR5uH01Bzw1UxdEnhodYriliDoarnbnTbjCfZh00PbozHG-AUanbQR3AG1DJBs1zeQUgW07qw_acDJ5U32acB37qVkoNwis58KX19Po3VxQYH0GCQLrC8uxwl8BAAD__8M6YF8">