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

    <tr>
        <th>Summary</th>
        <td>
            Incorrect Runtime Result with Function Overloading (Correct with gcc)
        </td>
    </tr>

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

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

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

<pre>
    # Title: Incorrect Runtime Result with Function Overloading (Correct with gcc)

When compiling with llvm, the runtime result is incorrect. The minimal code example is as follows:

```cpp
// main.cpp
#include <iostream>
#include <stdio.h>
#include "file.h"
int abc(char* a, char* b, bool c){
return 1;
}
int abc(bool a, bool b, char* c){
return 2;
}
int main(){
printf("%d\n",abc("his" ,"sophic"));
return 0;
}

// file.h
int abc(char* a, char* b, bool c=false);
int abc(bool a, bool b, char* c="his");
```
The build commands are as follows:
For llvm: `clang++ -o llvm_output main.cpp`
For gcc: `g++ -o gcc_output main.cpp`

When compiling with gcc, the runtime result is correct,result is 1, but clang result is 2.
It seems there is a problem with llvm's handling of function overloading that leads to incorrect runtime behavior compared to gcc. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVF2r4zYQ_TXjl-EaexzbyYMfnGQD-1RYFvpYZEm2VWTJSPK97b8vUnKTtOlCCwuGZDRz5kvniHmvJiNlB_UR6nPGtjBb1-lRmqncZYMVf3ZAFX5XQUuoevxquHVO8oDfNhPUIvGb9JsO-KHCjJfN8KCswV_epdOWCWUmBNqfbpgUNHEOdICih6L_dZYGuV1WpWNo8mv9vgCdMMwS3a2IuxZRHtVnAzl-nyUuyqiFaeRWSJR_sGXVMoYxj6PV2n54qPprLWiK68fXNZp0AbrgwpTJP08qZbjehESoTsr64CRboPry4vNBKJvPry6iUWmZz0AERa9MQDZwoD2fmQPqkcXBPo0hGoO1GtNC2iMUvZNhcwZLqKIF7flvaVIwu8OG52wvOeifOeKoQPt73OqUCWM6IaBaQH0y6e_pWg2IZuWBCIFOQOTtOiueIg7xq56KFc_FHtu9beN_raI6j0x7ea_wX8evzveG79j7nUPRR7oMm9IiEm5hRnhkTr4w5WLdlYJVj5EsmpkJ6Ah0xDebPL_ZLaxbeFAnpY-4SO0r7Akycf7viB_wP-njR_S_kR--XOB4gv3p4SnTXraAqeMnCOVQ9F8DeikXH9O6q0JwdXbQcnlWXetxZkakZuyI46ee7ZOew8wCasmEx2Aferw3O8iZvSvr0lzMSRHDJs5zzERXiUN1YJnsyraipmwOZZvNndhJOjStrJumaZhkfGzGuub74SDKsR6bTHVU0K4sqSkL2ldtzhuSe8GaQtSCi3EHu0IuTOk8zpFbN2XK-012Zdk2hzbTbJDap1eOyMgPTN7IlPqcuS6C3oZt8rArtPLBP9KE-PJ1P-3ZyzanuzmENbEtiWRSYd6GnNsF6HK9hvTztjr7e7xruqRuPdDlNs57R38FAAD__4ovzO8">