This is an archive of the discontinued LLVM Phabricator instance.

Bugs in SemaOverload.cpp
Needs ReviewPublic

Authored by dbabokin on Jul 1 2014, 4:56 AM.

Details

Reviewers
rsmith
Summary

I've noticed that GetConversionCategory(), GetConversionRank() and GetImplicitConversionName() from lib/Sema/SemaOverload.cpp have a bunch of bugs, namely:

  • GetConversionCategory() is missing cases for ICK_TransparentUnionConversion, ICK_Writeback_Conversion and ICK_Zero_Event_Conversion cases (ok to not handle ICK_Num_Conversion_Kinds, though would be good to report an error);
  • GetConversionRank() is missing the case for ICK_Zero_Event_Conversion;
  • GetImplicitConversionName() doesn't have a comma after "Transparent Union Conversion";

I think it's better to rewrite these functions using switch, so adding new ICKs would trigger a warning or an error if it's not handled in these functions.

Except style changes and typo fix (missing comma), the changes add case for missing records, please verify that they've got correct values.

I have no commit rights, so I would appreciate if reviewer commits the patch. Thanks!

Diff Detail

Event Timeline

dbabokin updated this revision to Diff 10994.Jul 1 2014, 4:56 AM
dbabokin retitled this revision from to Bugs in SemaOverload.cpp.
dbabokin updated this object.
dbabokin edited the test plan for this revision. (Show Details)
dbabokin added a reviewer: rsmith.
dbabokin added a subscriber: Unknown Object (MLST).