This is an archive of the discontinued LLVM Phabricator instance.

[cxx1z-constexpr-lambda] Make a lambda's closure type a literal type in C++1z.
ClosedPublic

Authored by faisalv on Jul 21 2016, 8:01 PM.

Details

Summary

One more step towards implementing constexpr lambdas.

In passing, also fix it so that when we emit a diagnostic referencing a lambda, instead of using the nameless CXXRecordDecl, use its type.

All regressions pass.

Diff Detail

Event Timeline

faisalv updated this revision to Diff 65021.Jul 21 2016, 8:01 PM
faisalv retitled this revision from to [cxx1z-constexpr-lambda] Make a lambda's closure type a literal type in C++1z..
faisalv updated this object.
faisalv added a project: Restricted Project.
faisalv added a subscriber: cfe-commits.
faisalv removed a project: Restricted Project.Jul 21 2016, 8:06 PM
faisalv updated this revision to Diff 65026.Jul 21 2016, 8:55 PM

Factor out the diagnostic builder RAII creation (through Sema.Diag) and reduce repetition.

rsmith edited edge metadata.Jul 21 2016, 11:48 PM

Everything other than the diagnostics change LGTM; can we handle the diagnostics change as a central patch and put this fallback logic directly into the diagnostics formatting code, so it applies everywhere we try to print the name of an unnamed class?

lib/Sema/SemaType.cpp
7168–7176

This seems like something that would be better handled centrally by the diagnostics machinery.

faisalv accepted this revision.Jul 22 2016, 9:17 PM
faisalv added a reviewer: faisalv.

Thanks Richard. Your request to separate out and centralize the diagnostic portion of the patch certainly seems like a good idea - and I shall do so separately.

The approved portion of this small patch is committed as: r276514.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160718/165670.html

Thanks!

This revision is now accepted and ready to land.Jul 22 2016, 9:17 PM
faisalv closed this revision.Jul 22 2016, 9:17 PM