https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118791
--- Comment #15 from sandra at gcc dot gnu.org --- See also PR115076. I think the low-level implementation of "declare variant" is all wrong, it needs to be tracked in the lexical scope by each front end instead of attached as a global property of the decl for use by the middle end. Call sites would expand into some sort of variant construct similar to OMP_METADIRECTIVE that contains CALL_EXPRs for all the alternatives that cannot be statically resolved in the front end. In that case we'd have the actual arguments available for overload resolution and template expansion in C++.