https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121739

            Bug ID: 121739
           Summary: Unicode character constants are not allowed to have
                    multiple characters in C23
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

The following code is incorrectly accepted by GCC:

int main(){
    u'ab';
}

This code violates the following constraint:

> A UTF-8, UTF-16, or UTF-32 character constant shall not contain more than one
> character.
Section 6.4.4.5 "Character constants" Paragraph 9 ISO/IEC 9899:2024

Before C23 no such constraint existed so it should still be valid there. Also
worth nothing that L'ab' is still valid in C despite being removed from C++.

Reply via email to