www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22267] New: ImportC: typedef-ed variable initialization with

https://issues.dlang.org/show_bug.cgi?id=22267

          Issue ID: 22267
           Summary: ImportC: typedef-ed variable initialization with RHS
                    in parenthesis doesn't parse
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxhaton gmail.com

---
typedef signed int int32_t;

int32_t func_1(void)
{
    int32_t l_954 = (10);
    return l_954;
}
---

Yields:

red.c(5): Error: found `=` when expecting `;` or `=`, did you mean `int32_t
l_954 = (`?
red.c(5): Error: found `=` instead of statement

Experimentation: 

Eliminating the typedef gets rid of the error, and so does the eliminating the
parenthesis.

--
Sep 02 2021