https://llvm.org/bugs/show_bug.cgi?id=28284
Bug ID: 28284 Summary: Clang crashes when creating a this expression during template instantiation Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: rtr...@google.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified template <typename T> struct Foo { void (*function)() = [this]() -> void { auto x = s1.s2.ptr; }; struct S1 { struct S2 { int* ptr; }; S2 s2; }; S1 s1; }; void run() { new Foo<int>(); } >From lib/Sema/TreeTransform.h: template<typename Derived> ExprResult TreeTransform<Derived>::TransformCXXThisExpr(CXXThisExpr *E) { QualType T = getSema().getCurrentThisType(); if (!getDerived().AlwaysRebuild() && T == E->getType()) { // Make sure that we capture 'this'. getSema().CheckCXXThisCapture(E->getLocStart()); return E; } return getDerived().RebuildCXXThisExpr(E->getLocStart(), T, E->isImplicit()); } In TransformCXXThisExpr, getSema().getCurrentType() returns a empty QualType. This is passed to function RebuildCXXThisExpr, which expects the QualType to be a valid Type. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs