Re: [PATCH] D24639: [Sema] Warn when returning a lambda that captures a local variable by reference

2016-09-16 Thread Alexey Bataev via cfe-commits
ABataev added a subscriber: ABataev. Comment at: lib/Sema/SemaChecking.cpp:6588 @@ -6587,2 +6587,3 @@ stackE = EvalAddr(RetValExp, refVars, /*ParentDecl=*/nullptr); + } else if (lhsType->isReferenceType()) { Remove empty line Comment at:

Re: [PATCH] D24639: [Sema] Warn when returning a lambda that captures a local variable by reference

2016-09-15 Thread Richard Smith via cfe-commits
rsmith added a comment. > But not here, because we would have to verify that the pointer in lam wasn't > mutated in a previous call of the lambda: Isn't that guaranteed, because the lambda is not marked `mutable`? Comment at: lib/Sema/SemaChecking.cpp:6594 @@ -6590,1 +6593,3