sys-apps/systemd treats USE=libidn2 as a sub-choice of USE=idn (USE=libidn2 depends on USE=idn being enabled and acts as the choice of implementation instead of as the choice of feature), similar to USE=ssl works in conjunction with USE=libressl and USE=gnutls (selecting the LibreSSL or GnuTLS implementation of SSL instead of the OpenSSL implementation) in many packages. For net-dns/dnsmasq, on the other hand, the choice is exclusive: Both flags cannot be enabled at the same time. Either dnsmasq uses net-dns/libidn (USE=idn) or net-dns/libidn2 (USE=libidn2). It would be great if the semantics of the useflag in both packages could be unified.
I prefer the approach I have taken in the systemd ebuild, and would prefer the dnsmasq ebuild be modified to match it.
commit 06cd85532dc39498e24c0a3364e0fcf689219e3e Author: Patrick McLean <chutzpah@gentoo.org> Date: Tue Aug 1 15:44:58 2017 -0700 net-dns/dnsmasq: Revision bump on 2.77, unify idn/libidn2 USE semantics Make the "libidn2" USE flag a sub-flag of "idn", as described in the bug. Gentoo-Bug: 625616 Package-Manager: Portage-2.3.6, Repoman-2.3.3