[PATCH] Don't crash on reporting lambda diagnostics

Aaron Ballman aaron at aaronballman.com
Fri Apr 10 07:08:32 PDT 2015


PR23021 demonstrates a case where diagnostic reporting on an inner
lambda would crash due to a null pointer dereference. Since captures
happen from calling ParseParameterDeclarationClause, which is before
the semantic lambda object is created, another mechanism is required
to get the lambda introducer location.

This patch addresses it by storing the introducer location into the
scope object directly, and using that location when reporting the
diagnostics. The result is the same, but no longer relies on a lambda
object being created first.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lambda.patch
Type: application/octet-stream
Size: 2649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150410/e6679b53/attachment.obj>


More information about the cfe-commits mailing list