<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/111644>111644</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][ExprConst] FloatExprEvaluator assertion when evaluating `binop(_Atomic(float), float)`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
crash-on-valid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
steakhal
</td>
</tr>
</table>
<pre>
The `FloatExprEvaluator` should ignore `_Atomic` types, and only care about the wrapped type.
For example, treat `_Atomic(float)` as a simple `float`.
Clang with assertions would fail on this valid code:
https://compiler-explorer.com/z/ns4KvqT7q
```c++
_Atomic(float) atomicFloat(float f) { return f; }
constexpr float AtomicFloatPlusFloat = atomicFloat(1.0f) + 0.0f;
constexpr float FloatPlusAtomicFloat = 0.0f + atomicFloat(1.0f);
static_assert(AtomicFloatPlusFloat == 1.0f, "");
static_assert(FloatPlusAtomicFloat == 1.0f, "");
```
Affects clang-7 and above, and clang-6 and below rejects `constexpr` so I think they are not interesting.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8lM2O4ygQx58GX0qJMP6IffAhH2NptZc9zH1Utss2OwQ8gJPuffoVONOd3ekeCSWYqvpRFP8CnZOTJmpYcWLFJcHVz8Y2zhN-n1ElnRlem68zASt5qwz6Ly-L_XJDtaI3lpUc3GxWNYCctLHR7dvRm6vsg82_LuSYOAPqAYxWr9CjJcDOrB78THC3uCw0RMc94xfGj62xQC94XRSFSG8J_TNWVGPIg4k67IAOEJwM3sFpM5X8wdp-zwr1BHfpZ0DnyHpptIN7THtEqcBo8LN0cEMlB-jNQCx7xM7eLy58iZaJtjfXRSqyO3pZlLFk9725MtH-w0SrXf7n7cfXw4_H1iXfRs_EKYy4-ushAONKu31uyzAGAzucwJJfrYaRZSdgh8sG6Y12nl4WC5v38Z3wl1pdnADLLv9Dp3u-ccUJeJhnp495b6QncOSFqBj-IfiN5zx62X_bas1E9Vl-AbnFnoEJEcfnlM-y-j3l7RqeBXEcR-q9gz4IY3eI6sTO3OinVDdDGecdKXMHS3_HkHChP8sV1W_gjyAe_T3o-RWCvLXxILUnS85LPe2TocmGOqsxoSY9iCoveZbnydxUVI-joJRXXZpV_EBY1FzgKLBIq66nRDaCizzlvOaHQohsX9RjUfZZnWNZFjgQyzldUaq9Urfr3tgpkc6t1KRpWuZ5orAj5WJvCxEPxbLjaI32pIdYqXMwWHTzzuhd1H9YLi6JbQJy162TYzlX0nn3vomXXsUnY2MWF1acwsNwDqVhxQV-fSreWw_uM2mgzSD1FGraSW0WJqoPmlyc4anhk9Wq5r9NOUk_r92jE0OKj7_dYk24NCbaWBTHRPuoy60R_wYAAP__BpyRhg">