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

    <tr>
        <th>Summary</th>
        <td>
            [feature request] add reference to clang as an extension
        </td>
    </tr>

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

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

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

<pre>
    I'd like to propose adding reference to C as an clang extension. The same one C++ has.

> A reference, like a pointer, stores the address of an object that is located elsewhere in memory. Unlike a pointer, a reference after it's initialized can't be made to refer to a different object or set to null. There are two kinds of references: *lvalue* references, which refer to a named variable and *rvalue* references, which refer to a [temporary object](https://learn.microsoft.com/en-us/cpp/cpp/temporary-objects?view=msvc-170). The `&` operator signifies an lvalue reference and the `&&` operator signifies either an rvalue reference, or a universal reference (either rvalue or lvalue) depending on the context.
> https://learn.microsoft.com/en-us/cpp/cpp/references-cpp

```c
int main() {
   int i; // Declare the object.
   int& ref = i; // Declare and initialize the reference.

   ref = 5;

   printf("%i\n", i); // "5"
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVF2PqzYQ_TXDyygIhphsHnjIRyP1vf0BBobgXmNT22Tv9tdXNrlJdttK1ZUiQjw5Z45nzoz0Xl0NcwPiCOKcySWM1jVW8yQ_lqy1_UfzK9CuR62-MQaLs7Oz9Yyy75W5ouOBHZsuxU4oPUqDnZbmivw9sPHKmhx_Gxm9nBitYTwBHYGOOEqfQ3GG4nB_Vr_g4UkIdFqTSpytMoFdPPHBOvYYxqTAsfdoh5jTtn9wFzCMMqDyqG0nA_fI2vP7yI5RGZx4su4jx9_NP4nly1XkENihCkA7j8qooKRWf3GPnTRAu4At4yT7dOeEii8SezUkhvBDjHXoOcSgWbROZXCM0jGGd4vflOmT-kdiD9UBgQ76JvXCQIfXEJ3wfVTd-JrRyIl7vEmnZKsZpekj3P1fOIhj4Gm2TrqPu2YQZ6C3MYQ5igG6AF00S2fySXXOejuEvLMT0IXNZvFAl26eH88H22Zl81BdborfoTpP_tZtyl0BtF_9AHUBVENdoJ3ZyRCLpa5GDYqTidYivHbF9Knvd-B_YlmFkV2kcF8oYhGsQ4mLUTd2XuoXeqC3O_IOsw5_NGKPPc9skuOtSSo6awJ_D_nTuz9btGeTNvHgdSLqYv10629lAk5SGaC3qAl2x_UcEWNIQXXENTueudPJaCPfO5u__heojldHqM7_Cou1fho_sTxkfhpaxAePgOr4JTQ7ZcKQ5BKQUCBOJr2eUAHtXxIDkYiRFb87fylA1jdVv6_2MuOm3FVUbLf7SmRjM1Qk6pJ2bSmo4G4gIdp6y1TLQbRDSZlqqKBtWZb7cl-JSuQd11zWu7ctV7ITVQfbgiepdK71bcqtu2bK-4Wbsqzfasq0bFn7tB-J0mKLMsU5c00EbNrl6mFbaOWDf1IEFXRaqgPLsLhYvT8X9nG84t76vDbXdbmuzsfSzBanm8-WuqowLu3dSTHV_WszO5tmly5JejTYXf2tob8DAAD___GK4cM">