[LLVMbugs] [Bug 16708] New: Clang crashes on lambda with multiple return statements

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 25 15:55:07 PDT 2013


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

            Bug ID: 16708
           Summary: Clang crashes on lambda with multiple return
                    statements
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rtrieu at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Repro:

int Foo;
int Bar;
void test () {
  auto L = []() {
    auto ret = Foo;
    return ret;
    return Bar;
  };
}

Command line:
clang -cc1 -std=c++11 test.cc

>From clang/lib/Sema/SemaStmt.cpp:2550, attempting to call getDeducedType() on
NewAT, which is null.

2548      if (AT->isDeduced() && !FD->isInvalidDecl()) {
2549        AutoType *NewAT = Deduced->getContainedAutoType();
2550        if (!Context.hasSameType(AT->getDeducedType(),
NewAT->getDeducedType())) {
2551          Diag(ReturnLoc, diag::err_auto_fn_different_deductions)
2552            << (AT->isDecltypeAuto() ? 1 : 0)
2553            << NewAT->getDeducedType() << AT->getDeducedType();
2554          return true;
(gdb) p NewAT
$2 = (clang::AutoType *) 0x0

-- 
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/20130725/7e798e8c/attachment.html>


More information about the llvm-bugs mailing list