Hi!

Apparently clang++ emits error on int *p = ((unsigned long) 0); while g++
accepts it without any diagnostics even with -pedantic-errors -W -Wall.
Dunno which is right, anyway, I meant to initialize with NULL, not
UNKNOWN_LOCATION.

Tested on x86_64-linux, committed to trunk.

2025-12-15  Jakub Jelinek  <[email protected]>

        PR c++/123128
        * parser.cc (cp_parser_omp_clause_linear): Initialize next to NULL
        rather than UNKNOWN_LOCATION.

--- gcc/cp/parser.cc.jj 2025-12-13 10:02:47.000000000 +0100
+++ gcc/cp/parser.cc    2025-12-15 13:35:04.414123497 +0100
@@ -43084,7 +43084,7 @@ cp_parser_omp_clause_linear (cp_parser *
   else
     {
       size_t end = cp_parser_skip_balanced_tokens (parser, 1);
-      cp_token *next = UNKNOWN_LOCATION;
+      cp_token *next = NULL;
       if (end > 1
          && cp_lexer_nth_token_is (parser->lexer, end - 1, CPP_CLOSE_PAREN))
        {

        Jakub

Reply via email to