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

    <tr>
        <th>Summary</th>
        <td>
            Question: the option name "-fgpu-exclude-wrong-side-overloads" is confusing
        </td>
    </tr>

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

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

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

<pre>
    ```
  // [CUDA] HD->H or HD->D calls are technically not allowed by CUDA but
  // are accepted by both clang and NVCC. However, during a particular
  // compilation mode only one call variant is viable. We need to
  // exclude non-viable overload candidates from consideration based
  // only on their host/device attributes. Specifically, if one
  // candidate call is WrongSide and the other is SameSide, we ignore
  // the WrongSide candidate.
  // We only need to remove wrong-sided candidates here if
  // -fgpu-exclude-wrong-side-overloads is off. When
  // -fgpu-exclude-wrong-side-overloads is on, all candidates are compared
  // uniformly in isBetterOverloadCandidate.
  if (S.getLangOpts().CUDA && !S.getLangOpts().GPUExcludeWrongSideOverloads) {
    const FunctionDecl *Caller = S.getCurFunctionDecl(/*AllowLambda=*/true);
```
https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaOverload.cpp#L10597-L10609

The option name is "gpu-exclude-wrong-side-overloads", but the comment said candidates need to be removed only when it is off.
And the condition in the below if-stmt also check if the option is off.

It seems that the option name is incorrect, should it be "gpu-include-wrong-side-overloads" ?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVVGP4jYQ_jXmZUQUHCDkIQ8sXLqVVr1W2-s-O_YkmatjR7YDpb--cgi3u2zVU09CMeCZb7755hsQ3lNrEEu2eWCb40KMobOu_LujM9LX1aK26lKybTq_0iNL9wCMV4xXwDYPhy_HPdsc4fG4ZNmnR7BufnsEKbT2IBxCQNkZip8vYGwAobU9o4L6AjEf6jHcIccsISUO4RpW29CB1MK0IIyCX_44HB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