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

    <tr>
        <th>Summary</th>
        <td>
            [clang-repl] "Duplicate Definition of Symbol" for out of line definition for virtual function
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          Vipul-Cariappa
      </td>
    </tr>
</table>

<pre>
    clang-repl raises "Duplicate Definition of Symbol", when creating an object with an out-of-line virtual function.
```c++
clang-repl> struct Klass { virtual int get_value(); };
clang-repl> int Klass::get_value() { return 0; }
clang-repl> auto x1 = Klass();
error: Duplicate definition of symbol '_ZTV5Klass'
clang-repl> %quit
```
But if the virtual function in defined within the class, it does not raise the error:
```c++
clang-repl> struct Klass { virtual int get_value() { return 0; } };
clang-repl> auto x1 = Klass();
clang-repl> %quit
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysk02PmzAQhn_NcBklMjaGcuBAlubSY6s99LIyYMCVY1N_ZLv_vsLJdrebfh0qWYrC2M_MvDOv8F7NRsoG-AF4l4kYFuuae7VGvbsTTol1FVlvx6dm0MLMOydXjU4oLz0CpV1ctRpEkNjJSRkVlDVoJ_z4dOqtBkqB3uHjIg0OToqgzIzCoO2_yCHgowpL-hvDzk47rYzEs3IhCo1TNMMG2wNpoSSXMwA9bIe0L8UAe48-uDgE_KCF9wjV4QdFmYCzDA9noaME-g5oDeyAUHXAbjHb7cQA1gJr3zxMYCdDdAbJM-UtQsRg8VuOwLor6jkpkFY6Zx2wFl9UG39SzSfVEGj18PnTPb8CqpssQPnXqMJraYC0hxhQTRiWWxVRmUsqOSbVlUnXhkuCO1QBRys9Ghsuw03h53r_9wh-peTvZvJHQf-qSjY2bKxZLTLZ5FVR1Xlelyxbmmmqes5LXrCCMzYUVHKSj1UpOeOTJDRTDSWUE05pnpOSsD0hnFcTz6dy7Iup5FAQeRJK77U-n_bWzZnyPsomL3LC6kyLXmqfbEWpkY-YopsheJe5Znu06-PsoSBa-eBfMEEFnfz4qjve_ZPZcLJuc9P2Mbnp1XptobdrkUWnmyWENW08PQI9ziossd8P9gT0uNV0_dmtzm6mBXpMnXigx2ur54Z-DwAA__9yp1pv">