[llvm-bugs] [Bug 51793] New: Clang bind non-const lvalue reference to an rvalue in lambda init-capture list

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 8 07:18:13 PDT 2021


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

            Bug ID: 51793
           Summary: Clang bind non-const lvalue reference to an rvalue in
                    lambda init-capture list
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2b
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hewillk at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

struct O {
  constexpr int f() const { return 0; };
} o;

constexpr bool b = [](auto... args) {
  return [&...x = args.f()] {
    return true;
  }();
}(o);


Clang accepts this code.

https://godbolt.org/z/jYfoM7sbx

-- 
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/20210908/5a0155d3/attachment.html>


More information about the llvm-bugs mailing list