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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Fix breaking change in 20.1.0 by automatically falling back to Cpp formatting if C formatting fails
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sean-mcmanus
      </td>
    </tr>
</table>

<pre>
    @owenca The PR at https://github.com/llvm/llvm-project/pull/128287 broke the case where a .c file is formatted in a folder with a .clang-format with Language: Cpp.

Can you make it not be a breaking change by automatically falling back to formatting with Cpp if no C language block is specified in .clang-format instead of giving an error?

Or do you recommend a higher level tooling layer detect the failure and change use --assume-filename=file.cpp instead of file.c as a workaround or what?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk0-PmzwQhz-NuYyCjA0Je-CQNytOr9Sq6hcYzABujI38J2m-fWXS1e6qh6onYDCeZ348xhD0bIk61vzHmtcCU1yc7wKhPaxqRZtCMbjx0bGauztZhfB9Ifj6DTDCEuMWmDwz0TPRzzouaSiVW5nojbm9XQ6bdz9IRSb6LRnDRF-JVrQnGLy7EsSFQGEguC_kCRBKBZM2BDrA5PyKMdII2gLC5MxIHu46Lvs6g3Y-PNc8i_-jnRPOxOQZLttWMn5m_HxBCw-XYMUrgY5gXYQhdxo84VXbGdSCdiYYHoApuhWjVmjMAyY0Jr8fUF0hujeeXNr7XbYN9ATWwQXM794wGKeumT5spPSkn_SfabUNkXAEN8Gsb3k_tEDeO89k_6T-4mF0O7cn5daV7AgIi54X8mDoRgaiczuewQd5GCmSinueE2qTcph2fJstBYLDAUNIKx1yvhZXYvI135Yqz_GO9KwBBkC4O39F75IdwXm4LxiZ7Iuxk-OLfMGCuupUi7apeNsWSydPWJMUw4s8ttPxSM3EFR_pqFQ7VGPbFLoTXDRcilpUVctPZX2ajgNXvG7phEJWrOa0ojZlVqd0fi50CIm6SopWisLgQCbstgrxMVImRPbXd7tyQ5oDq7nRIYb3naKOZjf904fNK_T65x8yaAuCl1XJ_65F1uCDGnqCy8fn_DdCkbzp_vnA7LOHfGSe49868SsAAP__9X4_2g">