In reply to Mohamed_TN:
There is no way to dynamically name immediate assertions, nor is there a way to find out the name of a variable passed to a task.
If you are trying to do this to collect coverage information, you could pass the name of the flag as another argument to the task and use a covergroup instead or in addition to the assertion. Each call to the task would create a new covergroup instance that can be given a unique name.
Another option is wrapping the check_flag task as a static method of a parameterized class. You would parametrize the class with the string name of the flag for each call you need to make. Each parameterization of the class creates a new specialization of the class type which would give you a unique name for your assertion.