Skip to content

Always disable statement decomposer on C++ "auto" expressions #140

@tiagolascasas

Description

@tiagolascasas

If you apply the statement decomposer to C++ auto expressions, e.g., auto start = high_resolution_clock::now();, it will decompose it into auto start; start = high_resolution_clock::now();, which is not valid C++ code. auto always expects an initialization in the same statement in order to infer the type, and this is broken by detaching the declaration from the initialization.

I think it is not reasonable to expect a developer to filter out these expressions before applying the decomposer, and that instead the decomposer should be the one doing the filtering. A more advanced solution would be to keep the decomposition but replace auto by its intended type, although that would require significant effort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions