Thread overview
[Issue 22876] importC: expression parsing affected by parentheses that should do nothing
Mar 11, 2022
duser@neet.fi
Mar 14, 2022
Walter Bright
Mar 18, 2022
Dlang Bot
Mar 20, 2022
Dlang Bot
March 11, 2022
https://issues.dlang.org/show_bug.cgi?id=22876

duser@neet.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|importC: ambiguous cast     |importC: expression parsing
                   |affects expression parsing  |affected by parentheses
                   |                            |that should do nothing

--- Comment #1 from duser@neet.fi ---
one more example that i forgot to add:

void fn()
{
        int *p;
        // Error: `p` is not of integral type, it is a `int*`
        // Error: `cast(int*)1` is not of integral type, it is a `int*`
        // works if parentheses around (p) are removed
        unsigned x = (unsigned)(p) & 1;
}

there's no ambiguous cast in this one so i've changed the issue title to something that should apply to all the examples

--
March 14, 2022
https://issues.dlang.org/show_bug.cgi?id=22876

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ImportC
                 CC|                            |bugzilla@digitalmars.com

--
March 18, 2022
https://issues.dlang.org/show_bug.cgi?id=22876

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #13831 "fix Issue 22876 - importC: expression parsing affected by parentheses…" fixing this issue:

- fix Issue 22876 - importC: expression parsing affected by parentheses that should do nothing

https://github.com/dlang/dmd/pull/13831

--
March 20, 2022
https://issues.dlang.org/show_bug.cgi?id=22876

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13831 "fix Issue 22876 - importC: expression parsing affected by parentheses…" was merged into master:

- b25875b21fdd855b403a2254feb29b1b3385a795 by Walter Bright:
  fix Issue 22876 - importC: expression parsing affected by parentheses that
should do nothing

https://github.com/dlang/dmd/pull/13831

--