This is a rework of the https://reviews.llvm.org/D41416 to work on master.
Fix provided by Jonas - https://github.com/root-project/root/pull/13139
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
Co-authored by: Jonas Hahnfeld <hahnjo@hahnjo.de>
@v.g.vassilev Can you please verify this?