<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106852>106852</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
failed static_assert still fires even if in constexpr if(false)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MohammedAhmed381
</td>
</tr>
</table>
<pre>
`constexpr auto Func()
{
if constexpr(true)
return 14;
else
static_assert(false);
}`
this results into compilation error of
`1>------ Build started: Project: Test1, Configuration: Debug x64 ------
1>FileName.cpp(15,19): error : static assertion failed
1>FileName.cpp(31,18): warning : unused variable 'asd' [-Wunused-variable]
1>Done building project "Test1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 5:06 PM and took 07.525 seconds ==========
`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU02P4zYM_TX0hXAg0Z85-JCZbIAC3WIPBXosZItO1FUsQx_Z6b8vZGdn2kMXaxgwLZKP7xF6KgRzXZgHaF6gORcqxZvzw2d3U_c769PtzrrqZTE6_fcArZjcEiK_rR5Vig4vaZmAeqAjiDOIE3Qve4BoZnwvBuqjT_xehojoOSa_oKyheu9hG_gZh6iimf5UIbCPQP2sco6O79XQnaEVexxvJqDnkGwMaJbocHL31VgVjVuQvXce3fzsa4WE6lO5PfiSjNV5mI-soTrhF-_-4inm8HcOUQK94qtbZnNNfoPLmTOP6YpvbY07zI6cYS_G8m_qzodpXYF62QC9yuPG-_QkkqNdHe7qMsdZGcv6f3GqzEP2T5xvyi9muW5IaUmBNT6UN2q0jECdChqoQ2heyj_2dPk9Dc35Y8bZLYxjXkAGW3fhCESb8MNjestnQIRliZfTL79-Oh-eO6zOP3j3pWZyAkOaJmbNOu9RfpdJrygwrWV0pVaR9__w1awra_wx-M8T2O6A5cgaVcQGqpNo8ctnVIvG6NxXFN2hoQYDT27R4efmtqLQQ6WP1VEVPMiOGimrqhHFbej6keRM7bETgqZa8qSkHGchmNWoSRdmIEG16Cspa3EUx0PXzF091bNq1SRZ9VALvitjD9Y-7gfnr4UJIfEgRds3VFg1sg2bU4kW_oZbFoiycf2Qm8oxXQPUwpoQwwdMNNHysC__v87CEI21OBvPAfnBS_atWT6si2b-l_uK5O1wi3ENUJ2ALkCXq4m3NB4mdwe65InPT_m8UECXjWcAujyFPAb6JwAA__8fv1Ls">