c++: Check constraints before instantiation from mark_used [PR95132]