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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to