<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in pr36536.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>b2da0861 - Push a function scope when parsing function bodies without a declaration</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/SemaCXX/pr36536.cpp#b2da0861</link>
        <description>Push a function scope when parsing function bodies without a declarationSummary:This is PR36536.There are a few ways to reach Sema::ActOnStartOfFunctionDef with a nullDecl. Currently, the parser continues on to attempt to parse thestatements in the function body without pushing a function scope ordeclaration context. However, lots of statement parsing logic relies ongetCurFunction() returning something reasonable. It turns out thatgetCurFunction() will never return null today because of an optimizationwhere Sema pre-allocates one FunctionScopeInfo and reuses it whenpossible. This goes wrong when something inside the function body causesus to push another function scope, such as requiring an implicitdefinition of a special member function. Reusing the state clears itout, which will lead to bugs. In PR36536, we found that the SwitchStackgets unbalanced, because we push a switch, clear out the stack, and thentry to pop a switch that isn&apos;t there.As a follow-up, I plan to move the pre-allocated FunctionScopeInfo outof the FunctionScopes stack. This means the FunctionScopes stack willoften be empty, and callers of getCurFunction() will need to check fornull.Reviewers: thakisSubscribers: cfe-commitsDifferential Revision: https://reviews.llvm.org/D43980llvm-svn: 326926

            List of files:
            /llvm-project-15.0.7/clang/test/SemaCXX/pr36536.cpp</description>
        <pubDate>Wed, 07 Mar 2018 18:55:10 +0000</pubDate>
        <dc:creator>Reid Kleckner &lt;rnk@google.com&gt;</dc:creator>
    </item>
</channel>
</rss>
