https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90253
Bug ID: 90253 Summary: no warning for cv-qualified selectors in _Generic Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- Controlling expression in _Generic undergoes lvalue conversion, so it will have const/volatile qualifiers stripped. Therefore, a qualified selector cannot possibly match, and it might make sense to warn when a user writes one. In the following example the function returns 0, even though the user might have expected to distinguish 'char' vs. 'const char': int f(const char *c) { return _Generic(*c, const char: 1, char: 0); }