[LLVMbugs] [Bug 20121] New: -Wreturn-type fails to diagnose when a lambda contains a noreturn destructor temporary

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 24 18:01:24 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20121

            Bug ID: 20121
           Summary: -Wreturn-type fails to diagnose when a lambda contains
                    a noreturn destructor temporary
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider:

#include <functional>
struct NoReturnDtor {
  __attribute__((noreturn)) ~NoReturnDtor();
};
int foo() {
  std::function<void()> foo = []() { NoReturnDtor(); };
}  // expected-warning

We fail to warn about falling out of foo without returning a value.

I haven't been able to reduce away std::function by inspection yet.

-- 
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/20140625/9926445b/attachment.html>


More information about the llvm-bugs mailing list