[PATCH] D119979: [OpenMP] Diagnose bad 'omp declare variant' that references itself

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 17 11:07:54 PST 2022


jdoerfert added a comment.

In D119979#3330343 <https://reviews.llvm.org/D119979#3330343>, @mikerice wrote:

> What's the use case? I wasn't aware of any.  We saw it from someone who did it accidently and caused the compiler to crash in codegen.

If you have N overloads/variants and you want to pick the original in a certain condition. It might be easier to specify the condition as match clause with a high score rather than avoid other match clauses to apply then. Put differently, if you disallow this you cannot have a "catch all" variant with a low score, e.g., one that issues a compile or runtime failure if picked.
Even if we don't use this now, we still need to stick somewhat to the standard or open an issue there if we think the behavior should be forbidden.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119979



More information about the cfe-commits mailing list