[llvm-bugs] [Bug 42454] New: The std::function call throws std::exception for unclear reason

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 29 23:07:43 PDT 2019


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

            Bug ID: 42454
           Summary: The std::function call throws std::exception for
                    unclear reason
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22171
  --> https://bugs.llvm.org/attachment.cgi?id=22171&action=edit
testcase-std::function.cpp

The attached testcase calls std::function<void(const std::string&)> twice.

The second invocation throws std::exception when compiled with .

When it is compiled with gcc8 it throws bad_function_call.

It's not clear why should any exception be thrown at all. Why can't it call the
same function again from the lambda function?

FreeBSD 12. Tried clang8, clang7, clang6.

-- 
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/20190630/1c6ab7de/attachment.html>


More information about the llvm-bugs mailing list