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

    <tr>
        <th>Summary</th>
        <td>
            Incorrect overload resolution with volatile ref conversion operator
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```
void test(const int&); // 1
void test(volatile int&); // 2

struct X {
    operator volatile int&() const;
};

void func(const X& x) {
    test(x);
}
```

I don't believe `1` should ever be considered viable during overload resolution, yet Clang will error, claiming that overloads `1` and `2` are both viable candidates.  Deleting `2` causes the compiler to correctly reject `1` as it would lose qualifiers.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUsFu4yAQ_Rp8Ga1l48SODz40jVbqH_SKYZJQEZOFIWn-fgc7aVS1FsbPzJs3b4DRm9sg2uo-qp2oXi7eGiCMJORG-ykS2IlxK2Qvmi0I-ZcH1D_JF-8UWYe_8uXCX-ZIIWmCdxDddlkBfvwZgyIf4IfQhrVg9sKKd6Fu98RPK_s06S_f75wMnzn3W5273c_F4FNuAd83Y5nfwPhJyI5gRGfxgsCEml-IR5-cAV4KHJs9WoMBDVysGrkFk4KdDuCZ4LwyEDB6l8hmvVe4IcGrU0y4WucAQ_Ahr2un7Cnn0VHRV3L8Kqsmk7GccUAYPR0fFTUHrVHcZQmwQ4eUhR5srVLEyLrZ7OnMuxyAPOMQUJO7scEPBs9KESzBde7S-YjwLyln9xZDLAszNKZvelWQJYfD23SX-a1d7jB7fBxtwH3eLebFHHycfZGCG45E5yial-XqHDgvjSW75R_nLo_Pn3Pw2Sr_2hgTRgbrtq1WxXHoGt2tukahkVXfaW0QN_3IS3pV77u9Lpzik4yDWG-FlBNeYZZgLNa7wg6ykrLq6r6q1m3dlbXqZW2aZlONqhuxFasKT8q6MvsofTgUYZgtjekQOehspPgMqhjtYUKcy7G-SnT0YYiUr40fx2IuPszm_wPsdR3M">