In case of incurable, chronic mania or dementia of either spouse having existed for five years or more, while under confinement by order of a court of record or of the Board of Mental Illness as provided by law, the court may in its discretion grant a divorce.
SDCL 25-4-18