https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127829
--- Comment #1 from Gabriel Ravier <gabravier at gmail dot com> ---
These also fail, I believe for the same reason:
int vi ();
#pragma omp declare variant (vi) match (construct={dispatch})
int fi ();
int &g ();
void t ()
{
#pragma omp dispatch
g () = fi ();
}
gets:
<source>: In function 'void t()':
<source>:9:7: error: expected ';' before '=' token
9 | g () = fi ();
| ^~
| ;
and:
double vd ();
#pragma omp declare variant (vd) match (construct={dispatch})
double fd ();
int vi ();
#pragma omp declare variant (vi) match (construct={dispatch})
int fi ();
void t ()
{
int i;
long l;
bool bb;
#pragma omp dispatch
i = fd ();
#pragma omp dispatch
l = fi ();
#pragma omp dispatch
bb = fi ();
}
gets:
<source>: In function 'void t()':
<source>:14:11: internal compiler error: in get_callee_fndecl, at tree.cc:8851
14 | #pragma omp dispatch
| ^~~
0x2c5b2b8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x2c4fefb internal_error(char const*, ...)
???:0
0xb9d350 fancy_abort(char const*, int, char const*)
???:0
0x12912b3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x1293aba gimplify_stmt(tree_node**, gimple**)
???:0
0x129084b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x1293aba gimplify_stmt(tree_node**, gimple**)
???:0
0x1290d20 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0x129cd06 gimplify_body(tree_node*, bool)
???:0
0x129d1cc gimplify_function_tree(tree_node*)
???:0
0x1063a47 cgraph_node::analyze()
???:0
0x1066f16 symbol_table::finalize_compilation_unit()
???:0
/cefs/59/59b1013b64ba01a4f1ea4290_gcc-trunk-20261011/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1plus
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/59/59b1013b64ba01a4f1ea4290_gcc-trunk-20261011/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
-D_GNU_SOURCE -D_REENTRANT <source> -quiet -dumpdir /app/ -dumpbase output.cpp
-dumpbase-ext .cpp -masm=intel -mtune=generic -march=x86-64 -g -O2
-pedantic-errors -std=c++29 -fdiagnostics-color=always -fno-verbose-asm
-fchecking -fopenmp -fopenacc -o /app/output.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.