[PATCH] D41016: [Sema] Fix crash in unused-lambda-capture warning for VLAs

Dimitry Andric via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 8 11:25:49 PST 2017


dim accepted this revision.
dim added a comment.
This revision is now accepted and ready to land.

For the rest, LGTM.  It fixes the segfault, for both the full original test case, and my reduced version.



================
Comment at: lib/Sema/SemaLambda.cpp:1491
   else
     diag << From.getVariable();
   diag << From.isNonODRUsed();
----------------
Just for sanity's sake, I would still put an assert here, that `getVariable()` does not return `nullptr`.  That might catch similar issues in the future.  (And it is better than a segfault... :) )



Repository:
  rC Clang

https://reviews.llvm.org/D41016





More information about the cfe-commits mailing list