[LLVMbugs] [Bug 20717] New: assertion failure assigning to immutable generic lambda init-capture

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 20 18:57:12 PDT 2014


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

            Bug ID: 20717
           Summary: assertion failure assigning to immutable generic
                    lambda init-capture
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++1y
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This testcase:

  auto x = [i = 0](auto n) { return i += n; }(1);

... causes clang to assert in C++14 mode:

clang-3.5: include/llvm/Support/Casting.h:95: static bool
llvm::isa_impl_cl<clang::Decl, const clang::DeclCo
ntext *>::doit(const From *) [To = clang::Decl, From = const clang::DeclContext
*]: Assertion `Val && "isa<> used on a null pointer"' failed.

The bad cast<...> call on a null pointer is here:

#9  0x000000000260cdc5 in clang::DeclContext::getParent (this=0x0)
    at tools/clang/include/clang/AST/DeclBase.h:1090
#10 0x0000000003866b0f in isReferenceToNonConstCapture (S=..., E=0x5c97798)
    at tools/clang/lib/Sema/SemaExpr.cpp:8487
#11 0x00000000037bc06a in CheckForModifiableLvalue (E=0x5c97798, Loc=...,
S=...)
    at tools/clang/lib/Sema/SemaExpr.cpp:8515

-- 
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/20140821/fc5304e3/attachment.html>


More information about the llvm-bugs mailing list