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

    <tr>
        <th>Summary</th>
        <td>
            Clang crash when using stdc++ features in OpenMP offloaded regions
        </td>
    </tr>

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

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

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

<pre>
    To be clear, this code is not expected to compile, but the appropriate error message would be for the linker to complain of missing symbols, as it rightfully does when stripping a bit the content of `gen_cpp`.

```
fatal error: error in backend: Copy one register into another with a different width
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 21.0.0git (https://github.com/llvm/llvm-project 1b455df780ed1d578b63f969c636fe78b2eb6014)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /archive/shared/apps/cross-clang/install3/usr/local/bin
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/main-sm_86-e545ff.cpp
clang++: note: diagnostic msg: /tmp/main-016287.cpp
clang++: note: diagnostic msg: /tmp/main-sm_86-e545ff.sh
clang++: note: diagnostic msg: 
```

The code responsible is
```
    #pragma omp target 
    {
 SDF_Sphere.gen_cpp(std::cout);
    }
```
Which internally expects to operate on an ostream. 
The error message is not stable, in the sense that small variations in code, location and context led to a different one yesterday. I no longer have records of that, but it was something about the compiler being unable to relax a type, or something of that sort.

[2025-03-20-bug-report.zip](https://github.com/user-attachments/files/19394305/2025-03-20-bug-report.zip)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykld-P2zYMx_8a5YVI4Mix4zzkIffD7WG33aF3Qx8PskXbWmXJEOXcZX_9QDvp2m4rthUQ4ECivhQZ8kNFZFqHuBfZlchuFmqMnQ_7n1QY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