[Issue 22758] New: ImportC: complex parenthesized expression mistakes variable as type.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 10 11:03:35 UTC 2022


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 at puremagic.com
          Reporter: dave287091 at 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

--


More information about the Digitalmars-d-bugs mailing list