https://gcc.gnu.org/g:876a521a198130bac638d682444e908b331c1185

commit r15-8961-g876a521a198130bac638d682444e908b331c1185
Author: Sandra Loosemore <sloosem...@baylibre.com>
Date:   Thu Mar 27 00:59:37 2025 +0000

    OpenMP: Fix declaration in append-args-interop.c test case
    
    I ran into this while backporting my declare variant/dispatch/interop
    patch f016ee89955ab4da5fe7ef89368e9437bb5ffb13 to the og14 development
    branch.  In C dialects prior to C23 (the default on mainline),
    functions declared "float f()" and "float g(void)" aren't considered
    equivalent for the purpose of the C front end code that checks whether
    a type of a variant matches the base function after accounting for the
    added interop arguments.  Using "(void)" instead of "()" works in all
    C dialects as well as C++, so do that.
    
    gcc/testsuite/ChangeLog
            * c-c++-common/gomp/append-args-interop.c: Fix declaration of base
            function to be correct for pre-C23 dialects.

Diff:
---
 gcc/testsuite/c-c++-common/gomp/append-args-interop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/gomp/append-args-interop.c 
b/gcc/testsuite/c-c++-common/gomp/append-args-interop.c
index 9494625cbbbc..1211450ce63e 100644
--- a/gcc/testsuite/c-c++-common/gomp/append-args-interop.c
+++ b/gcc/testsuite/c-c++-common/gomp/append-args-interop.c
@@ -23,7 +23,7 @@ typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM
 float repl1(omp_interop_t, omp_interop_t, omp_interop_t);
 
 #pragma omp declare variant(repl1) match(construct={dispatch}) 
append_args(interop(target), interop(targetsync), interop (target))
-float base1();
+float base1(void);
 
 float
 test (int *a, int *b)

Reply via email to