D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 23029 - ImportC: _Generic treats pointer to const and regular pointers as the same type
Summary: ImportC: _Generic treats pointer to const and regular pointers as the same type
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ImportC, pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2022-04-17 07:11 UTC by dave287091
Modified: 2022-04-19 13:59 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description dave287091 2022-04-17 07:11:09 UTC
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");
}
Comment 1 Dlang Bot 2022-04-19 07:21:47 UTC
@WalterBright created dlang/dmd pull request #14014 "fix Issue 23029 - ImportC: _Generic treats pointer to const and regul…" fixing this issue:

- fix Issue 23029 - ImportC: _Generic treats pointer to const and regular pointers as the same type

https://github.com/dlang/dmd/pull/14014
Comment 2 Dlang Bot 2022-04-19 13:59:16 UTC
dlang/dmd pull request #14014 "fix Issue 23029 - ImportC: _Generic treats pointer to const and regul…" was merged into master:

- 2debd946c8d5c24e47436f657d49bb3257daf1fc by Walter Bright:
  fix Issue 23029 - ImportC: _Generic treats pointer to const and regular pointers as the same type

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