Skip to content

[Clang] Global closure types are never handled by ASTConsumer #157101

@zwuis

Description

@zwuis

Part of function body of void clang::ParseAST(Sema &S, bool PrintStats, bool SkipFunctionBodies):

for (bool AtEOF = P.ParseFirstTopLevelDecl(ADecl, ImportState); !AtEOF; AtEOF = P.ParseTopLevelDecl(ADecl, ImportState)) { // If we got a null return and something *was* parsed, ignore it. This // is due to a top-level semicolon, an action override, or a parse error // skipping something. if (ADecl && !Consumer->HandleTopLevelDecl(ADecl.get())) return; }

If declarations introduce closure types in global scope, these types never appear in ADecl. As a result, Consumer never handles global closure types.

auto L = [] { // no Clang-Static-Analyzer-generated warning no matter what you write };

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"lambdaC++11 lambda expressions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions