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

    <tr>
        <th>Summary</th>
        <td>
            `ios_base::sync_with_stdio` doesn't seem to do anything
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            libc++
      </td>
    </tr>

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

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

<pre>
    Here's the implementation for `ios_base::sync_with_stdio`:

```cpp
bool ios_base::sync_with_stdio(bool sync) {
  static bool previous_state = true;
  bool r                     = previous_state;
  previous_state = sync;
  return r;
}
```

As far as I can tell, that's only shuffling the state of a local bool, which tells me that it might not be decoupling iostream from stdio (I can't find any usage of the function to probe the state by the library, and since it's a local variable, it's not affecting anything on a broader level).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMU91u6ygQfhp8M2qEx3ZILnyRtop2nyICPLapMFiAU-XtV-B0T49UHR1rJMP8fPPNh0bGaCZH1LPulXXvldzS7EOvPwZVKT88-n8oEEMRIc0EZlktLeSSTMY7GH0AduTGx5uSkVhzYc0lPpy-fZo032IajGdHnv282JHvpteV8Yvy3sKfi_FUkrKb4RmYeGX8AhAzAQ0ltga6G7_FW3YSsOYdUtiINXtqyQnw05dTf6_-KvoBs1B4hgOlLTgI-52J9--z7aNeIowygIzwL2jpIJG1DN8gzTIVOb2zD4jzNo7WuKmouzfzI0iwXktbuOeiz9nouUBEWKhggEmwmGlO4HwCRTCQ9ttasIyPKZBcYAx-gSIkMDwVIgxFgtG4AaR7wBblVDrm9uPmdHnW5GENXtE3UupRLtaoIMMjc5JugGicJjD7QF-k7zIYqSzlpGcoU5TjSDpletI90pwP3oEEFbwcKIClO1mG50M19M1wbs6yor4WTdtyUXNRzT3X9XjulDgJjUK2jRJDR408d_Wx7XiDlemRY1tjLXjTdlwcmkGprhMKx6M81XJkLadFGnuw9r4cfJgqE-NGfY28FqfKSkU2lk1AVNvEEBm-MURrlGb4WgzzloQ-I7yobYqs5dbEFH9hJpMs9X-xFzB4ivuLRKIl6z74_-WptmD7OaU15nq8MrxOJs2bOmi_MLzmfs_fyxr8B-nE8FoGigyvz5nuPf4XAAD__3roP2Q">