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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] `FunctionDecl::getFunctionTypeLoc` returns None when function attributes present
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    ### Use case

I try to add a custom Function Attribute that implies the function returns an int. In the case of the user using void as return type, I would like to add at least a fix-it hint to replace void by int. Unfortunately, the current implementation won't try to walk the AttributedTypeLoc chain and returns an empty FunctionTypeLoc. Thus `getReturnTypeLoc` returns None too.

### Discussion

I don't know if it is an acceptable behavior to make it go through the AttributeTypeLoc chain to extract the final FunctionTypeLoc. If it is, I would like to submit a few-lines patch.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk99q4zoQxp9GvhkSZDlpmgtf5DQEAodzcWhhd-_G8tjWRpaMNEqat1_sOOl2u2CwYP59v_kYjNG0jqgU63_Eep9h4s6H8izz-tv3H1nl62spVHH74C0SaIwk5E7I3RE4XIE9YF0Dgk6RfQ-H5DQb72DHHEyVmIA7ZDD9YA1F4I6guecE4hRcBHRgHC_h6Kb4OAN8M71TpAApGtfC2ZsaMM5VwNeBhHqBI1x8sjVYc6KHHAZLGBkQGvO-MAydcTxGAw0WNd2aVdfb3DfX-MDJIZO9jj0nFSkEcjfl1JNjnDRfvBNqw3f4C9rTlP7grV-vA_3rNegOjQN09e-c1A98fWxpTl3Ca5ciiCfZEv8_Jc8R8SQf1f95NwL65W3_H77sTdQpRuPd3Zl6Fnly_gKmAcNgpvGoNQ2MlSWoqMOz8WGk6PFEY1LrgbvgU9t9ZvqMxB7onQNqvtlpHNqvSMd57N88iqnqzeQOXRbWOIowIOtuRsvqsqi3xRYzKvNNUeSrdSFl1pVqrUnnz6qui3xVrZ7qvKLnTb1uaFVsaKszUyqpVrmSKi_ytZRLWWwa2hZ5s1FFlUsUK0k9Gru09twvfWgzE2OiMs-f1VZmFiuycToHpbRF1wqlxssI5ViwqFIbxUpaEzl-tGDDdrqhl6livR-tvC9kT9qKYieKXUv8x5a-2HvpyH3cB973H2EIFMlxloItO-Yhji3VQahDa7hL1VL7XqjDKGn-LYbgf5JmoQ4TYhTqMFOeS_UrAAD__5u1WTY">