<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJzNVdtu3DYQ_Rrty8CCVrfdfdgHrx2jBhqkSJu2rxQ5kthQpExSe_HXd0Zaw3FQIAn6EoC6UORczjnDUePUZZ9Uh99xEElxS-NBnz8c0RsnFKqHycqonf2ILXq0EpPqPsm3fYxj4O35A41Ox35qUukGmhhzfHncjN79gzLStDGuocd2V4uqLHCTt6oQTVaWWJdqvS4zUWzkpi23m7qVmzVtlUbYjh1pNpzTWx4vyaVyHJO8-HVdZZs6yXdw6ilFOCEExAGiA-lRRAQB5ijMhHCP0hCQd-fRA0Hm7T8jnPW2ZDjNFCH2aGEQnxnE6ELQjblAUmefrPCXDyN6EZ2n-U8Np84ITgqPEKYwUkBCJSjqJoB1EfDM31Al-R3oFnSEkwgLcJLSIiqW0uPJ-c_8meEv0edqfa3bw6SNuhLDlJx6LXvAI9o4CUO8SbqHr8y5Fpa3OyOI3_byOIzm1bwXswUtoaectzr89vFPLiZ6J1Q8igNtSOEPSg3PgqwRiNnOiwF0oFeM8QLR66MWhuLAV-o41TgTU-eZzme62raRFp-e3yfZfZLdXu_VgQPcJfmBBvyXzogm1YG1WTYpL1oWlwj26ej1kGoiuXgiMm4qCOISZiFmTq0YEFxLVWadvQlRRC1hwKFBD-21BTAaYV_O0izVLCLbOy5Fq2YXFpK8ZjWDA2eRaLcgfEc2czgi6xsdhsinUEmee931FCOHubTJI4eYS4DWsJuM8LwqncJRxJ6tTt7ZLv2SuV_ciWrAszmbtvrM-zqnbceF1SA8TZq6RC-8gkVtLoprOWgpODnOiebTgF-QRkvYOX8B5XCpZcoDmQW7rDsb8RyZlClgCn9RZ-rdZBTXRyP4KOvOOu5ZLy6JeasokbDow3gJIeXMOL-LufmsxMlbFsIvWrEboeiaXTz-_f4d76SE8Q1TUnJ5JmX2fOmccVrBSu0LtSt2YiWm2Du_P3ZHpsXgcTV5s__hRqOJQ-QarYpdtV31e1WKusqaUlXbaodllu3KKt-VuC6aXOSyWBnRoAn8hyIKOucUKehDhNkTfWJd6XHtR2-nxW3rWQOreKW6X_3_jPU-z_J5rLOCfjxpW5dN0Wxlg80GayGJPupI2qTsh0_1yu9nl83UBVo0OsTwushsdtTkZoCUYdTR4P6bDQqWhhRgPpZvWtJqzng_p_svmPmJ-A>53958</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang::Expr::ClassifyImpl asserts on isPRValue()
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            clang,
            clang:frontend
      </td>
    </tr>

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

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

<pre>
    [Sema::FixOverloadedFunctionReference](https://github.com/llvm/llvm-project/blob/896a543e72fd3ab044e64d1140a37c7f4876fc71/clang/lib/Sema/SemaOverload.cpp#L15076) where we seem to create a lvalue DeclRefExpr [here](https://github.com/llvm/llvm-project/blob/896a543e72fd3ab044e64d1140a37c7f4876fc71/clang/lib/Sema/SemaOverload.cpp#L15184) but then make a possibly `UnaryOperator` [here](https://github.com/llvm/llvm-project/blob/896a543e72fd3ab044e64d1140a37c7f4876fc71/clang/lib/Sema/SemaOverload.cpp#L15160). I suspect that's not expected, if it was then we need to rework the `clang::Sema::BuildUnaryOp` which eventually calls `clang::Expr::ClassifyImpl` which has `assert(isPRValue());`. The example program is pretty trivial: https://godbolt.org/z/ffbcneqzM

[The C++ ](https://eel.is/c++draft/expr.prim.id#qual-5 says that the name of a non-static member function is an lvalue if it's the operand of an &, so one can argue that `FixOverloadedFunctionReference` is "right" here, and the "regular" codepath is wrong.

However, the fix is going to be quite hard as `ExprClassification` assumes that the category does not depend on the context of use. We should probably ignore what the standards says and "fix" `FixOverloadedFunctionReference` to return an rvalue and add a `FIXME` note.

cc: @zygoloid 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNVcmO3DgM_R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