[llvm-bugs] [Bug 39066] New: Clang should warn on returning a lambda which captures locals by reference.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 24 14:26:13 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39066

            Bug ID: 39066
           Summary: Clang should warn on returning a lambda which captures
                    locals by reference.
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chandlerc at gmail.com
                CC: llvm-bugs at lists.llvm.org, rtrieu at google.com

consider: https://gcc.godbolt.org/z/uB6Xar

Clang should warn on returning a lambda with a local captured by reference.
This seems ... really unlikely to be correct (although technically possible).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180924/9c586839/attachment-0001.html>


More information about the llvm-bugs mailing list