[Issue 23029] New: ImportC: _Generic treats pointer to const and regular pointers as the same type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 17 07:11:09 UTC 2022


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

          Issue ID: 23029
           Summary: ImportC: _Generic treats pointer to const and regular
                    pointers as the same 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

void print_const(const char*);
void print(char*);
int main(){
    (void)_Generic("",  // Error: generic association type `char*` can only
appear once
            char*: print, 
            const char*: print_const
        )("hello");
}

--


More information about the Digitalmars-d-bugs mailing list