[PATCH] D39462: [Sema] Implement -Wmaybe-tautological-constant-compare for when the tautologicalness is data model dependent

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 12 14:22:32 PST 2017

rjmccall added a comment.

That's the template type-propagation problem: the template was invoked with a size_t, but that's erased down to the canonical type by the template machinery.  That can't be fixed within the template, but at use sites, we could theoretically recognize that e.g. the result of the callee was originally spelled T and then look for how T was determined; here it comes from an explicit template argument, whose spelling can just be propagated into the sugared type of the call expression.  But that's the sort of analysis I think you'd need to do a good job with in order to make this adjustment successful.



More information about the cfe-commits mailing list