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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
https://gcc.gnu.org/g:b200f4d92f1d75aa36623dad71e5970a4a819acf                  

commit r17-3020-gb200f4d92f1d75aa36623dad71e5970a4a819acf                       
Author: Jakub Jelinek <[email protected]>                                        
Date:   Thu Aug 6 11:41:21 2026 +0200                                           

    libcpp: Implement C++29 P3658R1 - Adjust identifier following new Unicode
recommendations                                                                 

    The following patch attempts to implement the C++29                         
    P3658R1 - Adjust identifier following new Unicode recommendations           
    paper as a DR (for all C++ versions back to C++98, like P1949R7             
    has been applied as well).                                                  
    Now, unfortunately C23/C2Y use xid_identifier as well and I'm not           
    aware of a similar paper and even if there is one later on for C2Y,         
    not sure if it would be voted in as a DR against C23.                       
    So, this patch adds a bit to differentiate XID_Start+XID_Continue           
    or XID_Continue from ID_Compat_Math_Start+ID_Compat_Math_Continue           
    or ID_Compat_Math_Continue and makes C++ 98-26 accept union of              
    those (pedantic and non-pedantic), while for C23/C2Y it accepts             
    the union of those only for non-pedantic and for pedantic it still          
    rejects those.                                                              
    I've included a patch against the generated ucnid.h as attachment           
    because otherwise the patch was too large for mailing list limits.          

    2026-08-06  Jakub Jelinek  <[email protected]>                               

    contrib/                                                                    
            * unicode/README: Add another argument to makeucnid                 
            invocation.                                                         
    gcc/testsuite/                                                              
            * g++.dg/cpp23/ucnid-3-utf8.C: New test.                            
            * g++.dg/cpp23/ucnid-4-utf8.C: New test.                            
            * gcc.dg/cpp/ucnid-16-utf8.c: New test.                             
    libcpp/                                                                     
            * makeucnid.cc: Implement C++29 P3658R1 - Adjust identifier         
            following new Unicode recommendations as a DR.  Adjust invocation   
            in the toplevel comment.                                            
            (NONC): Add another enumerator to the unnamed enum, or it into      
            all_languages, renumber the rest of enumerators.                    
            (read_proplist): New function.                                      
            (write_table): Print also NONC bit.                                 
            (main): Expect 6 arguments rather than 5.  Call read_proplist.      
            * charset.cc (NONC): Add another enumerator to the unnamed enum.    
            (cpp_check_xid_property): Return 0 if NONC bit is set.              
            (ucn_valid_in_identifier): If pedantic xid_identifiers in C,        
            return 0 if NONC bit is set.                                        
            * ucnid.h: Regenerate.                                              

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to