www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22758] New: ImportC: complex parenthesized expression

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

          Issue ID: 22758
           Summary: ImportC: complex parenthesized expression mistakes
                    variable as type.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dave287091 gmail.com

A reduced snippet of C code from sqlite:

void foo(unsigned* aData){
    unsigned s = ( (((aData[0])&0x000000FF)<<24) + (((aData[0])&0x0000FF00)<<8)
+ (((aData[0])&0x00FF0000)>>8) + (((aData[0])&0xFF000000)>>24) );
}

ty.c(2): Error: variable `aData` is used as a type                             
                                                                            
ty.c(1):        variable `aData` is declared here                              
                                                                            
ty.c(2): Error: variable `aData` is used as a type                              
ty.c(1):        variable `aData` is declared here                              
                                                                            
ty.c(2): Error: variable `aData` is used as a type                             
                                                                            
ty.c(1):        variable `aData` is declared here                              
                                                                            
ty.c(2): Error: variable `aData` is used as a type                              
ty.c(1):        variable `aData` is declared here

--
Feb 10 2022