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

            Bug ID: 52136
           Summary: [coroutine] undefined behavior when nested lambda
                    coroutine captures automatic variables by reference
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: bhal...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Reproducer: https://godbolt.org/z/3d37ME161
Since clang 12.0.0 through to current trunk.

Coroutine foo instantiates a coroutine lambda.

When references to automatic variable are passed to the lambda coroutine as
arguments, all is well.

However, when the lambda captures the local variables by reference they seem to
go out of scope and referring to them in the lambda results in undefined
behavior.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to