[LLVMbugs] [Bug 19876] New: Generic lambdas used within NSDMI's cause crash when they capture 'this'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 27 22:17:47 PDT 2014


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

            Bug ID: 19876
           Summary: Generic lambdas used within NSDMI's cause crash when
                    they capture 'this'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++1y
          Assignee: unassignedclangbugs at nondot.org
          Reporter: faisalv at yahoo.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following C++1y code results in a crash:

struct X {
  int m = 10;
  int n = [this](auto) { return m; }(20);
};

This is because when implicitly instantiating the generic lambda's call
operator specialization body, Sema gets confused and is unable to determine the
current 'this' type when transforming the MemberExpr 'm'.
That is SemaExprCXX.cpp:Sema::getCurrentThisType() is unable to calculate that
the this type should be X* since it looks for the nearest enclosing
FunctionDeclDC - which is obviously null.

-- 
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/20140528/3033c032/attachment.html>


More information about the llvm-bugs mailing list