<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/142865>142865</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang assert on invalid with is_constant_evaluated in template argument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
efriedma-quic
</td>
</tr>
</table>
<pre>
```
template<typename T, int I = 1/!__builtin_is_constant_evaluated()> class X;
void f(X<int, 1>* x) { x->a; }
```
templateArgumentExpressionsEqual() uses isIntegerConstantExpr(), then EvaluateKnownConstInt()... but they don't agree whether the InConstantContext should be set.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsks-OozwQxJ-mubSCjM2fcOCQZIgUfdfvMLfIQAe8MnYGtzOZt1-RZbRzWMmSDy5X_1pVOgQzOqIGiiMUb4mOPPmlodtiaJj17iOaPun88NVAKbYjDkzz3WomUCf-upPTM-H_IE9oHOMFQb1hBvIMMrteu2gsG3c14dp7F1g7vtJD26iZBpB7kDWoFnurQ8B3UEcQh4c3A95A7t9BnYzj1ToD1YI84BNkjVAd8bkD1WpQR4TqDcThJ-APxsMyxpkct8_7QiEY70L7EbX9MxpjoIAmXBzTSMtpI1zFG5s8IU_ksN2Y_3P-0710lxVs1aRpil3kVfeFg3cgK0Y9LkT4ORFPtKxPeHHf9ifvmJ6MYfLRDtgRBuI0GRo11KrWCTVZldeiyiuRJVNTCcrrosyKfVFnWZ0TUb_vdVndlChUXyamkUIWohS5lKIQIt135U3LrqxvdaWE7iAXNGtjU2sfc-qXMTEhRGqyXO7LIrG6IxteHZCyt9qNIOVah6VZP-y6OAbIhTWBw18LNmypeclRh0ALo3do3ENbM-Cn4Qn_GToah9_poN7iSeJim4n5HkAdXt05j4an2KW9n0Ge16nbtbsv_hf1DPL82iKAPG-LPBr5OwAA__-tY-ey">