[llvm-bugs] [Bug 45538] New: Type deduction and capture in lambda fails if type is defined far away (?) from the point of deduction

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 14 13:00:01 PDT 2020


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

            Bug ID: 45538
           Summary: Type deduction and capture in lambda fails if type is
                    defined far away (?) from the point of deduction
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sbsbalint14 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 23355
  --> https://bugs.llvm.org/attachment.cgi?id=23355&action=edit
minimal example and the install script for LLVM

The problem presented itself while using the boost unit test framework. It
seems like that it is both a type deduction and a lambda capture issue, which
only happens if the type deduction has to be carried out through many layers of
indirection. Therefore, unfortunately, I couldn't eliminate the boost unit test
framework from the minimal example. 


The error is:
test_true_minimal.cpp:20:30: error: variable 'j' cannot be implicitly captured
in a lambda with no capture-default specified
      g([=](const test_class<j, 3> item) {});


I am using the newest commit from the release/10.x branch
(edbe962459da6e3b7b4168118f93a77847b54e02) I built clang locally, with the
build script install_llvm.sh (attached) inside an archlinux singularity
container. boost has been installed from the arch repos, version 1.72.

I read the guide for regarding bug reports, but I am not sure in this
particular case which files are relevant. Please let me know if you need any
further input.

The original discussion on GitHub might also be useful:
https://github.com/illuhad/hipSYCL/issues/231

-- 
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/20200414/b05a4d2c/attachment.html>


More information about the llvm-bugs mailing list