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

    <tr>
        <th>Summary</th>
        <td>
            [OpenMP] overloading resolution issue involving namespace
        </td>
    </tr>

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

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

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

<pre>
    In the following example:

https://godbolt.org/z/eo1hx3a6W

```
#pragma omp begin declare variant match(device = {arch(amdgcn)})
  int foo() { return 1;}
#pragma omp end declare variant

//int foo() { return 2;}

namespace FOAM {
    int foo() { return 3;}
}


int main(){
    using namespace FOAM;
    return foo();
}
```
when resolving foo in main, device variant should not be considered candidate. However, when FOAM::foo is introduced, device variant becomes a candidate, which cause ambiguity. This should not happen.

@jhuber6
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8k8FuuzgQxp_GXEb_yJgEwoFDulG0e6i6h5X2PLYn4MrYyDZJu0-_MknTUnVXQoOwZ37f2B-DMZreEXVs98R2xwLnNPjQvb9FHK2ZC-n1e_eHgzQQnL21_mpcD_SG42SJVQfGj4zf45DSFPOaODFx6r2W3qaNDz0Tp3-YOJEvh7cK67-_FrGa35_bp6imgP2I4McJJPXGgSZlMRBcMBh0CUZMamBir-liFAGrjsCaJwzLIo66V46JljXHHBcqgHEJzt4zsWeizekQKM3BQcmqp5z6gzo5_V171flyzP8EixV4iQ5HihMqgtPL4Tknf7T3Pw1WK84aeItmuRPjbrUr6hyzXWvdzHsk3EUeyo_NT6W1QdeBHASK3l4y-uw9GHeX_w3ulnw4FQc_Ww3OJ5AEyrtoNAXSoNBpozHRBn73V7pQyNUL-9bigVWHhR3zzQSvZ0X6BwVJyo8UAT-RN5JRAyicIwGO0vSzSe8b-Gsw8WtTA04Tuc3qSrf8dZglhbrQXaXbqsWCurLh-7Zu25YXQyc06kbUHEXbynrf6F2lGlSyLvlZ7Hd1YTrBxZYLUZfNrir5RjSS01mW5bbFvdhJtuU0orEbay9jnpDCxDhTt6_4tiwsSrJxmUghHF1h2WRC5AENXa75Jec-si23Jqb4SUkm2WWUXyZyz3-y3RH8hYL1qLNZi21zMt7dkGDc5e7j4xcp5mC7b5Ns0jDLjfIjE6esdX_9moJ_JZXyFGRcZOK0nODfAAAA__-xxFNS">