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

Reply via email to