Thread overview
[Issue 21449] PrimaryExp `TypeCtor( Type )( ArgumentList)` is rejected when used alone in a ExpStatement
[Issue 21449] parser reject constructor call to const(SomeStructDecl)
Dec 03, 2020
Basile-z
Dec 03, 2020
Basile-z
Sep 28, 2021
Basile-z
Sep 28, 2021
Basile-z
Dec 17, 2022
Iain Buclaw
Jul 14, 2023
Basile-z
December 03, 2020
https://issues.dlang.org/show_bug.cgi?id=21449

--- Comment #1 from Basile-z <b2.temp@gmx.com> ---
sorry, test case should be

---
struct Foo
{
    static opCall(T)(T t){}
}

void main()
{
    Foo(0);         //OK
    const(Foo)(0);  //NG
}
---

--
December 03, 2020
https://issues.dlang.org/show_bug.cgi?id=21449

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21449

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
in https://dlang.org/spec/expression.html#primary_expressions this is the rule

  TypeCtor ( Type ) ( ArgumentListopt )

The parser takes the path of a declaration, it nevers tries a statement, in this case ExpressionStatement.

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=21449

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|parser reject constructor   |PrimaryExp `TypeCtor( Type
                   |call to                     |)( ArgumentList)` is
                   |const(SomeStructDecl)       |rejected when used alone in
                   |                            |a ExpStatement

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=21449

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
July 14, 2023
https://issues.dlang.org/show_bug.cgi?id=21449

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal

--