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

    <tr>
        <th>Summary</th>
        <td>
            [clang-cl] __FUNCTION__ used in templated function is not returning the same string than MSVC.
        </td>
    </tr>

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

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

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

<pre>
    __FUNCTION__ in clang is not returning the same string than MS for templated functions.

See https://godbolt.org/z/88n1rGs3b

For this test case MSVC is returning:
function: TestClass<**class** UnitTestNative>::TestClass
func: TestClass

I have looked at it briefly. It looks like a fix can be implemented in PredefinedExpr::ComputeName by adding a case for IK==PredefinedExpr::Function? However, I couldn't find a way to stick the "class" keyword in front of the class name. May be some policy argument should be used to print the function?
Unless everything should be computed in PredefinedExpr::ComputeName using some string manipulation (meaning getting the string from printQualifiedName and manipulating it to get the "class" keyword?
 
@RIscRIpt I think you have been working on MS compatibility. I am wondering if you are currently working on this or if you might have some suggestion on the fix I am about to work on?
Thanks.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVEFv4zYT_TX0ZRDDouTEPujgz159NYqk7SbZazCSRhJrihTIUbzaX1-QytreYgvsJbHAmTfzHh8feq9aQ5SL9f_E-rDAkTvr8m_YKYfYL0pbT_nbW_H6tH85_vH09gbKQKXRtKA8GMvgiEdnlGmBOwKPPYFnN3-jgcdnaKwDpn7QyFRDM5qKlTV-KVYHsdrNf5-JoGMevEh3QhZCFq2tS6t5aV0rZPFNyGKzMYn7v0_L28YigHfKA5NnqNATPD5_2YftLpsFzFj8fbZId_BCnvcavRfpXsidkLsqfsWf8GoUh4onZPVOIv0UMNLdtemC9yPWzWZH6PCdQFt7ohqQQTGUTlGjpyUcOR540OpEgNCor1ChgZJA9YOmnkwQSxn401FNjTJUf_o6uHmNve2HkekpiF1OgHUd9MaZfpD7-LtIDyI9_Ky5uIhQwG_2TO_khNzDESo76toI-cDQKFMDwhknYAueVXWK1yuk_FBJwomms3Vxx8ZZw2CbWBMLwGBPS3jEKVDyticYrFbVBOjaMbAD34V54Xj0VIc5g1OGI8b1oopZzFejyXsIy07cBbbX9mpW45fUGn3stVeX9mjUMGoM40DITU8Y3dwS88XVc2njbD8v-deIWjWK6giKpr6BCU-DA52W-L9Eu_CCD8dkq89HX30-DgzH4GdzgsmOs4NKIgNn604B2sYnFSgjq1JpxcFNgD2crakp7qma2IyOoBqdI8N6ugWI78W673W9ajueR83CjG1LPuoRiym6M87A0o6RW0CDm_t56dCc_HJR52m9Tbe4oDy532brdLvZpIsuv2-oxOYhuU8ok5SV27rJyqpOqiZ7kFVVLVQuVzJdbROZPKSJTJfZeoMPaVOn67JJtrIU2Yp6VHqp9XsfUmGhvB8pv79PkmyhsSTtY4pJaegM8VBIGULN5aHnrhxbL7KVVp79FYUV6xh_MdXuKi3WB_gh8aI9lflJhv1yBn7ZLxej0_m_Ik5xN5bLyvZCFmGhj393g7N_U8VCFpGGF7KINP8JAAD__8kN68Q">