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

            Bug ID: 43293
           Summary: C++17 Lambda-expression with implicit capture fails to
                    compile.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++17
          Assignee: unassignedclangb...@nondot.org
          Reporter: chackz0...@gmail.com
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Created attachment 22489
  --> https://bugs.llvm.org/attachment.cgi?id=22489&action=edit
reproducible

Good day,

I believe I may have discovered a bug in TOT clang. When compiling the attached
reproducible with the following command:

clang ./repro.cpp -g -O2 -std=gnu++17

I get the following error message:

./repro.cpp:9:19: error: variable 'myFoo' cannot be implicitly captured in a
lambda with no capture-default specified
    static_assert(myFoo);

I've checked cpp reference and done a, albeit shallow, dive into the spec and I
can't find any contrary definitions that state the repro shouldn't compile.

The test compiles fine with GCC 9.2 on godbolt and also with clang 8.0.

The change in behaviour was introduced in r363086,
715f7a1bd058c64a39cc4773114dfb46ae8cc8a3 (monorepo).

can anyone confirm the following.

1. the test is either well formed or not.
2. is this a genuine bug.

Thank you for your valuable time.

Tom W

-- 
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