https://gcc.gnu.org/g:8cc54434862dfa95b8ec2fa258b7e5bd56b7220d

commit 8cc54434862dfa95b8ec2fa258b7e5bd56b7220d
Author: Waffl3x <[email protected]>
Date:   Tue May 5 09:01:55 2026 -0600

    OpenMP/C: Change repetitive allocator clause diagnostic wording
    
    This is specifically for an allocator clause in an allocate directive.
    
    The old text, 'allocator' clause allocator expression, does not flow very
    well. This patch removes the redundant second allocator from the diagnostic.
    This case reads poorly because the two words are the same, but there are
    other diagnostics that use the same pattern that we could consider changing
    as well. For example, 'allocate' clause allocator expression, despite being
    two different words still feels rather redundant.
    
    gcc/c/ChangeLog:
    
            * c-parser.cc (c_parser_omp_allocate): Change diagnostic.
    
    gcc/testsuite/ChangeLog:
    
            * c-c++-common/gomp/allocate-5.c: Match new diagnostic.
    
    Signed-off-by: Waffl3x <[email protected]>

Diff:
---
 gcc/c/c-parser.cc                            | 2 +-
 gcc/testsuite/c-c++-common/gomp/allocate-5.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index ed9f67bd8479..bcaefd463289 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -23805,7 +23805,7 @@ c_parser_omp_allocate (c_parser *parser)
                 != get_identifier ("omp_allocator_handle_t"))
            {
              error_at (expr_loc,
-                       "%<allocator%> clause allocator expression has type "
+                       "%<allocator%> clause expression has type "
                        "%qT rather than %<omp_allocator_handle_t%>",
                        TREE_TYPE (allocator));
              allocator = NULL_TREE;
diff --git a/gcc/testsuite/c-c++-common/gomp/allocate-5.c 
b/gcc/testsuite/c-c++-common/gomp/allocate-5.c
index 2ca4786264ff..09c8e4342f0a 100644
--- a/gcc/testsuite/c-c++-common/gomp/allocate-5.c
+++ b/gcc/testsuite/c-c++-common/gomp/allocate-5.c
@@ -40,7 +40,7 @@ bar ()
 #pragma omp allocate(a) foo(my_allocator) /* { dg-error "expected 'allocator'" 
} */
   /* { dg-error "expected end of line before '\\(' token" "" { target *-*-* } 
.-1 } */
   /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet 
supported" "" { target c++ } .-2 } */
-#pragma omp allocate(a2) allocator(b)  /* { dg-error "'allocator' clause 
allocator expression has type 'int' rather than 'omp_allocator_handle_t'" 
"todo: cp/semantics.c" { xfail c++ } } */
+#pragma omp allocate(a2) allocator(b)  /* { dg-error "'allocator' clause 
expression has type 'int' rather than 'omp_allocator_handle_t'" "todo: 
cp/semantics.c" { xfail c++ } } */
   /* { dg-message "sorry, unimplemented: '#pragma omp allocate' not yet 
supported" "" { target c++ } .-1 } */
 }

Reply via email to