This is an archive of the discontinued LLVM Phabricator instance.

FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations
ClosedPublic

Authored by lvoufo on Jul 15 2013, 3:41 PM.

Details

Reviewers
rsmith
Summary

This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info.

Diff Detail

Event Timeline

rsmith added inline comments.Jul 17 2013, 5:35 PM
lib/Sema/SemaOverload.cpp
551

More indentation please.

8411

Please add a comment to this function explaining what it's form

8440

Less indentation please.

8447

Maybe use three overloads for the OverloadCandidate*, FunctionDecl*, and Decl* cases, rather than an explicit specialization here? And perhaps fold the Decl* and FunctionDecl* cases together, with an assertion that the decl is in fact a FunctionDecl.

8492–8496

How are we guaranteed that this is not reached when diagnosing a bad deduction due to substitution failure in a TemplateSpecCandidateSet?

8502–8504

It looks like this is unreachable: getDescribedTemplate is only used from DiagnoseBadDeduction, where TemplatedDecl is either FunctionDecl (for the overload set case) or Decl (for the template deduction case).

Maybe replace this function with one that takes a Decl*, and dispatches on whether it's a function/class?

8510–8512

Less indentation please.

lib/Sema/SemaTemplateDeduction.cpp
4152–4153

Remove this FIXME now that you've fixed it :)

lvoufo updated this revision to Unknown Object (????).Jul 19 2013, 1:11 PM

Updated as per previous comments...

rsmith accepted this revision.Jul 19 2013, 1:31 PM

LGTM

lib/Sema/SemaOverload.cpp
8448

"*" on the right.

8493–8495

Likewise.

Eugene.Zelenko closed this revision.Oct 5 2016, 1:15 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL186727.