jdoerfert added a comment.

In D71241#1783362 <https://reviews.llvm.org/D71241#1783362>, @ABataev wrote:

> >>> - Take https://godbolt.org/z/2evvtN which shows that the alias solution 
> >>> is incompatible with linking.
> >> 
> >> Undefined behavior according to the standard.
> > 
> > I don't think so. If you do, please reference the rules this would violate.
>
> Page 59, 25-27.


OpenMP 5.0, Page 59, 25-27:

> • If the function has any declarations, then the declare variant directives 
> for any declarations that have one must be equivalent. If the function 
> definition has a declare variant, it must also be equivalent. Otherwise, the 
> result is unspecified.

In the example (https://godbolt.org/z/2evvtN), all `declare variant` directives 
on declarations *that have one* are equivalent, since only on declaration has a 
`declare variant`. Since the function definition does not have a `declare 
variant`, the second restriction is also fulfilled.

To summarize, this example is broken in the current scheme and valid according 
to the spec.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71241/new/

https://reviews.llvm.org/D71241



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to