On Tue, Oct 17, 2023 at 03:12:46PM +0200, Tobias Burnus wrote: > C++11 (and C23) attribute do not seem to be properly handled: > > [[omp::decl (declare target,indirect(1))]] > int foo(void) { return 5; } > [[omp::decl (declare target indirect)]] > int bar(void) { return 8; }
Isn't that correct? Declare target directive has the forms declare target (list) declare target declare target clauses The first form is essentially equivalent to declare target enter (list), the second to begin declare target with no clauses. Now, [[omp::decl (declare target)]] int v; matches the first form and so enter (v) clause is implied. But say [[omp::decl (declare target, device_type (any))]] int v; is the third type and so nothing is implied, so it is equivalent to int v; #pragma omp declare target device_type (any) Don't remember if that is supposed to be an error or just not do anything because there is no enter or to or link clause. So, I think if you want to make foo indirect, the above would have to be: [[omp::decl (declare target,enter,indirect(1))]] int foo(void) { return 5; } [[omp::decl (declare target indirect enter)]] int bar(void) { return 8; } or so (or to instead of enter, but guess that is either deprecated or removed but we should support that anyway). Jakub