From the horse's mouth. Note Article 7 -
Council Directive 79/7/EEC of 19 December 1978 on the progressive implementation of the principle of equal treatment for men and women in matters of social security
Article 1
The purpose of this Directive is the progressive implementation, in the field of social security and other elements of social protection provided for in Article 3, of the principle of equal treatment for men and women in matters of social security, hereinafter referred to as ‘the principle of equal treatment’.
Article 2
This Directive shall apply to the working population — including self-employed persons, workers and self-employed persons whose activity is interrupted by illness, accident or involuntary unemployment and persons seeking employment — and to retired or invalided workers and self-employed persons.
Article 3
1. This Directive shall apply to:
(a) statutory schemes which provide protection against the following risks:
sickness,
invalidity,
old age,
accidents at work and occupational diseases,
unemployment;
(b) social assistance, in so far as it is intended to supplement or replace the schemes referred to in (a).
.-.-.-.-.-.
Article 7
1. This Directive shall be without prejudice to the right of Member States to exclude from its scope:
(a) the determination of pensionable age for the purposes of granting old-age and retirement pensions and the possible consequences thereof for other benefits;
(b) advantages in respect of old-age pension schemes granted to persons who have brought up children; the acquisition of benefit entitlements following periods of interruption of employment due to the bringing up of children;
(c) the granting of old-age or invalidity benefit entitlements by virtue of the derived entitlements of a wife;
(d) the granting of increases of long-term invalidity, old-age, accidents at work and occupational disease benefits for a dependent wife;
(e) the consequences of the exercise, before the adoption of this Directive, of a right of option not to acquire rights or incur obligations under a statutory scheme.
eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A31979L0007