<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/Modules/self-referencing-lambda.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Modules] Update test to mention it requires C++14.</title>
<updated>2018-03-23T00:16:06+00:00</updated>
<author>
<name>Volodymyr Sapsai</name>
<email>vsapsai@apple.com</email>
</author>
<published>2018-03-23T00:16:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=932d45ce4d32e413916ed9200b5b57dca9ab9acc'/>
<id>932d45ce4d32e413916ed9200b5b57dca9ab9acc</id>
<content type='text'>
llvm-svn: 328283
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 328283
</pre>
</div>
</content>
</entry>
<entry>
<title>[Modules] Fix creating fake definition data for lambdas.</title>
<updated>2018-03-21T21:28:54+00:00</updated>
<author>
<name>Volodymyr Sapsai</name>
<email>vsapsai@apple.com</email>
</author>
<published>2018-03-21T21:28:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8a5943f5691920cd1c2dfde975dc1951f7d8e5b4'/>
<id>8a5943f5691920cd1c2dfde975dc1951f7d8e5b4</id>
<content type='text'>
During reading C++ definition data for lambda we can access
CXXRecordDecl representing lambda before we finished reading the
definition data. This can happen by reading a captured variable which is
VarDecl, then reading its decl context which is CXXMethodDecl `operator()`,
then trying to merge redeclarable methods and accessing
enclosing CXXRecordDecl. The call stack looks roughly like

    VisitCXXRecordDecl
      ReadCXXRecordDefinition
        VisitVarDecl
          VisitCXXMethodDecl
            mergeRedeclarable
              getPrimaryContextForMerging

If we add fake definition data at this point, later we'll hit the assertion

    Assertion failed: (!DD.IsLambda &amp;&amp; !MergeDD.IsLambda &amp;&amp; "faked up lambda definition?"), function MergeDefinitionData, file clang/lib/Serialization/ASTReaderDecl.cpp, line 1675.

The fix is to assign definition data before reading it. Fixes PR32556.

rdar://problem/37461072

Reviewers: rsmith, bruno

Reviewed By: rsmith

Subscribers: cfe-commits, jkorous-apple, aprantl

Differential Revision: https://reviews.llvm.org/D43494

llvm-svn: 328153
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During reading C++ definition data for lambda we can access
CXXRecordDecl representing lambda before we finished reading the
definition data. This can happen by reading a captured variable which is
VarDecl, then reading its decl context which is CXXMethodDecl `operator()`,
then trying to merge redeclarable methods and accessing
enclosing CXXRecordDecl. The call stack looks roughly like

    VisitCXXRecordDecl
      ReadCXXRecordDefinition
        VisitVarDecl
          VisitCXXMethodDecl
            mergeRedeclarable
              getPrimaryContextForMerging

If we add fake definition data at this point, later we'll hit the assertion

    Assertion failed: (!DD.IsLambda &amp;&amp; !MergeDD.IsLambda &amp;&amp; "faked up lambda definition?"), function MergeDefinitionData, file clang/lib/Serialization/ASTReaderDecl.cpp, line 1675.

The fix is to assign definition data before reading it. Fixes PR32556.

rdar://problem/37461072

Reviewers: rsmith, bruno

Reviewed By: rsmith

Subscribers: cfe-commits, jkorous-apple, aprantl

Differential Revision: https://reviews.llvm.org/D43494

llvm-svn: 328153
</pre>
</div>
</content>
</entry>
</feed>
