This is an archive of the discontinued LLVM Phabricator instance.

Fix explicit template parameter reporting for narrowing conversions
AbandonedPublic

Authored by erichkeane on Jan 29 2018, 3:07 PM.

Details

Summary

I found that explicit template parameters that caused a
narrowing integer conversion resulted in the incorrect parameter
being mentioned in the note (see test attached). This is because
the argument checking code doesn't check to see if it caused
SFINAE errors when checking the arguments, so instead of giving
up on the first error, it continues through the list. This
makes the error reporting pick up the last template param every time.

This patch checks these parameters on each argument and gives up
if there is an error. The result is that only the required amount
of arguments are checked, and that the 'Converted' array contains
only the successful arguments before the first failure, as the
calls seem to all expect.

Diff Detail

Event Timeline

erichkeane created this revision.Jan 29 2018, 3:07 PM
erichkeane abandoned this revision.May 7 2018, 10:09 AM

Did Review-after-commit, in retrospect this is a pretty tiny change.