Article 17 TFEU cannot invalidate that conclusion. First, the wording of that provision corresponds, in essence, to that of Declaration No 11 on the status of churches and non-confessional organisations, annexed to the Final Act of the Treaty of Amsterdam. The fact that Declaration No 11 is expressly mentioned in recital 24 of Directive 2000/78 shows that the EU legislature must have taken that declaration into account when adopting the directive, especially Article 4(2) thereof, since that provision refers specifically to national legislation and practices in force on the date of adoption of the directive. Second, while it is true that Article 17 TFEU expresses the neutrality of the European Union towards the organisation by the Member States of their relations with churches and religious associations and communities, that article is not such as to exempt compliance with the criteria set out in Article 4(2) of Directive 2000/78 from effective judicial review (see, to that effect, judgment of 17 April 2018, Egenberger, C‑414/16 , EU:C:2018:257 , paragraphs 56 to 58 ).

Unlike the first subparagraph of Article 4(2) of that directive, the second subparagraph stipulates that one of the occupational requirements that a church or other public or private organisation whose ethos is based on religion or belief can impose on its employees is the requirement that those individuals act in good faith and with loyalty to the ethos of that church or organisation. As is apparent from, inter alia, the clause ‘provided that its provisions are otherwise complied with’, that right must be exercised in a manner consistent with the other provisions of Directive 2000/78 and, in particular, the criteria set out in the first subparagraph of Article 4(2) of the directive, which must, where appropriate, be amenable to effective judicial review, as noted in paragraph 43 of this judgment.

second, that a difference of treatment, as regards a requirement to act in good faith and with loyalty to that ethos, between employees in managerial positions according to the faith or lack of faith of those employees is consistent with that directive only if, bearing in mind the nature of the occupational activities concerned or the context in which they are carried out, the religion or belief constitutes an occupational requirement that is genuine, legitimate and justified in the light of the ethos of the church or organisation concerned and is consistent with the principle of proportionality, which is a matter to be determined by the national courts.

first, that a church or other organisation the ethos of which is based on religion or belief and which manages a hospital in the form of a private limited company cannot decide to subject its employees performing managerial duties to a requirement to act in good faith and with loyalty to that ethos that differs according to the faith or lack of faith of such employees, without that decision being subject, where appropriate, to effective judicial review to ensure that it fulfils the criteria laid down in Article 4(2) of that directive; and

A national court hearing a dispute between two individuals is obliged, where it is not possible for it to interpret the applicable national law in a manner that is consistent with Article 4(2) of Directive 2000/78, to provide, within the limits of its jurisdiction, the legal protection which individuals derive from the general principles of EU law, such as the principle prohibiting discrimination on grounds of religion or belief, now enshrined in Article 21 of the Charter of Fundamental Rights of the European Union, and to guarantee the full effectiveness of the rights that flow from those principles, by disapplying, if need be, any contrary provision of national law.

The Court has held, moreover, that the requirement to interpret national law in a manner that is consistent with EU law includes the obligation for national courts to change their established case-law, where necessary, if it is based on an interpretation of national law that is incompatible with the objectives of a directive (judgment of 17 April 2018, Egenberger, C‑414/16, EU:C:2018:257, paragraph 72 and the case-law cited).

In the event that it is impossible to interpret the national provision at issue in the main proceedings in a manner that is consistent with EU law, it should be noted, first, that Directive 2000/78 does not itself establish the principle of equal treatment in the field of employment and occupation, which originates in various international instruments and constitutional traditions common to the Member States, but has the sole purpose of laying down, in that field, a general framework for combating discrimination on various grounds, including religion and belief, as may be seen from its title and from Article 1 (judgment of 17 April 2018, Egenberger, C‑414/16, EU:C:2018:257, paragraph 75 and the case-law cited).

On the other hand, a national court that finds itself in the situation referred to in the paragraph above is under an obligation to provide, within the limits of its jurisdiction, the legal protection which individuals derive from EU law and to ensure the full effectiveness of that law, disapplying if need be any provision of national legislation contrary to the principle prohibiting discrimination on grounds of religion or belief (see, with regard to the principle prohibiting discrimination on grounds of age, judgment of 19 April 2016, DI, C‑441/14, EU:C:2016:278, paragraph 35).

Before the entry into force of the Treaty of Lisbon, which conferred on the Charter the same legal status as the treaties, that principle derived from the common constitutional traditions of the Member States. The prohibition of all discrimination on grounds of religion or belief, now enshrined in Article 21 of the Charter, is therefore a mandatory general principle of EU law and is sufficient in itself to confer on individuals a right that they may actually rely on in disputes between them in a field covered by EU law (see, to that effect, judgment of 17 April 2018, Egenberger, C‑414/16, EU:C:2018:257, paragraph 76).

(see paras 64, 67-69, 71, operative part 2)