Skip to content

Insight is screwed for top-level variables with type placeholder and an array new expression initializers #108

@languagelawyer

Description

@languagelawyer
auto p = new int[2];

becomes

int * p = new int[22;

The same happens for the decltype(auto) placeholder.
For multidimensional arrays, each index gets screwed, e.g. [2][3] becomes [22[33.
For index ranges > 9, e.g. [123][456], only the first digit is doubled: [1123[4456.
Hexadecimal integer literals screw it even more. new int[0x02] becomes new in2.
Octal integer literals in multidimensional array new expressions also result in a very funny output. new int[02][03] becomes new int 2][3.

Also note the additional newline added after every such declaration.

There is no problem with non-array new expressions and with array new expression when variable type is not deduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions