[Fix][TIRx] Fix MSVC build of IndexDataTypeNormalizer - #20098
Merged
Conversation
MSVC rejects the class-qualified call with C2352 ("a call of a non-static
member function requires an object"). StmtExprMutator derives from both
ExprMutator and StmtMutator and re-exports the name via
`using ExprMutator::VisitPrimExpr;`. MSVC resolves the qualified
IndexDataTypeNormalizer::VisitPrimExpr down to ExprMutator::VisitPrimExpr
and then fails to form the implicit object conversion. GCC and Clang accept
the same expression, so only the Windows build broke.
Call it through this instead, matching every other VisitPrimExpr call site
in this file. VisitPrimExpr is a non-virtual inline helper, so the
qualification was suppressing nothing and behavior is unchanged. The other
class-qualified call sites in the tree name StmtExprMutator directly, which
is where the using-declaration lives, so they resolve fine.
Port of apache#20096, which landed on the v0.26.0 release branch first to unblock
the v0.26.0.rc0 Windows wheel.
tlopex
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of #20096, which landed on the
v0.26.0release branch first to unblock thev0.26.0.rc0Windows wheel.mainhas the same breakage.MSVC fails to compile the class-qualified call:
StmtExprMutatorderives from bothExprMutatorandStmtMutatorand re-exports the name viausing ExprMutator::VisitPrimExpr;. MSVC resolves the qualifiedIndexDataTypeNormalizer::VisitPrimExprdown toExprMutator::VisitPrimExprand then fails to form the implicit object conversion. GCC and Clang accept the same expression, so only the Windows leg broke — macOS and both Linux wheels built fine.The fix calls it through
this, matching every otherVisitPrimExprcall site in this file.VisitPrimExpris a non-virtual inline helper, so the qualification was suppressing nothing and behavior is unchanged. The other class-qualified call sites in the tree nameStmtExprMutatordirectly — that is where the using-declaration lives, so they resolve fine and are left alone.The call was introduced in #19931, which changed
IndexDataTypeNormalizer::VisitExprtoIndexDataTypeNormalizer::VisitPrimExpr; the former resolved unambiguously.Original failing job: https://github.com/apache/tvm/actions/runs/31033249253/job/92400739674