As concerns dating, it doesn't matter (at least not as far as the law is concerned, although it might matter as a matter of departmental policy, as explained by "cdwjava"). If sex happens, then it might matter for the reason explained. I didn't look up Illinois's statutory rape laws, but some states have provisions in their statutory rape laws that make otherwise consensual sex a crime if the older person is in a position of authority relative to the younger person.
@tigercat
Are you talking about hanging out or hanging out and having sex from time to time? It really does make a difference.
Y'all are really not getting what I'm saying here. And yes, as a matter of fact, Illinois is one of the states pg1067 mentioned, (I did look it up). But the question the OP asked at least implies a belief that a cop is somehow not allowed to have relationships.
OF COURSE there's a problem if he's using the power of his position to obtain sexual favors, or whatever. That's so obvious I didn't think it needed to be said, and it's a sad thing that the world is such that anyone else did. But there is not a legal problem SIMPLY BECAUSE HE IS A COP AND FOR NO OTHER REASON. Which is the question the OP asked. Or at least how I interpreted the question as he asked it.