rsmith added a comment.

I would prefer that we use the location of the capture-default as the location 
of all the implicitly captured fields, rather than using an invalid location.



================
Comment at: clang/lib/Sema/SemaDecl.cpp:10689
 
-      S.DiagRuntimeBehavior(DRE->getBeginLoc(), DRE,
+      S.DiagRuntimeBehavior(DRE->getBeginOrDeclLoc(), DRE,
                             S.PDiag(diag)
----------------
I'm a bit surprised you updated this call to `DeclRefExpr::getBeginLoc()` (and 
no others). I think this should be unreachable for a `DeclRefExpr` that refers 
to an implicit lambda capture, because such a lambda-capture cannot refer to 
itself from its own (implicit) initializer.


https://reviews.llvm.org/D50927



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to