From: Jakub Jelinek Date: Mon, 15 Dec 2025 12:44:20 +0000 (+0100) Subject: openmp: Fix next variable initialization in cp_parser_omp_clause_linear [PR123128] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e10dc8fa17ac633dfeca38cadfe0ba974af7e5a3;p=thirdparty%2Fgcc.git openmp: Fix next variable initialization in cp_parser_omp_clause_linear [PR123128] 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. 2025-12-15 Jakub Jelinek PR c++/123128 * parser.cc (cp_parser_omp_clause_linear): Initialize next to NULL rather than UNKNOWN_LOCATION. --- diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 214dababeb5..d6e3298c144 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -43084,7 +43084,7 @@ cp_parser_omp_clause_linear (cp_parser *parser, tree list, 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)) {