This is an archive of the discontinued LLVM Phabricator instance.

[SemaTemplate] Fix uncorrected typos after pack expansion
ClosedPublic

Authored by sammccall on Jul 12 2019, 4:12 PM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Jul 12 2019, 4:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2019, 4:13 PM
kadircet added inline comments.Jul 15 2019, 2:22 AM
clang/lib/Sema/SemaTemplateVariadic.cpp
622 ↗(On Diff #209631)

why not directly return CorrectDelayedTyposInExpr(Pattern); ?

lebedev.ri edited subscribers, added: cfe-commits; removed: llvm-commits.Jul 15 2019, 2:44 AM
sammccall marked an inline comment as done.Jul 15 2019, 3:04 AM
sammccall added inline comments.
clang/lib/Sema/SemaTemplateVariadic.cpp
622 ↗(On Diff #209631)

Because the error isn't that Pattern is invalid per se (in a way that CorrectDelayedTyposInExpr can see), but rather that there's no pack to expand.

So even if CorrectDelayedTyposInExpr returns something valid, we still want to return ExprError(). We call it for its side-effects of flushing typos and emitting diagnostics.

kadircet accepted this revision.Jul 15 2019, 3:05 AM
This revision is now accepted and ready to land.Jul 15 2019, 3:05 AM
This revision was automatically updated to reflect the committed changes.