public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sandra at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/113904] [OpenMP][5.0][5.1] Dynamic context selector 'user={condition(expr)}' not handled
Date: Thu, 11 Apr 2024 04:51:44 +0000	[thread overview]
Message-ID: <bug-113904-4-wha3EmXNs6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113904-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113904

--- Comment #5 from sandra at gcc dot gnu.org ---
Per TR12, these are the rules for the scoping/evaluation of these expressions:

"For the match clause of a declare variant directive, any argument of the base
function that is referenced in an expression that appears in the context
selector is treated as a reference to the expression that is passed into that
argument at the call to the base function. Otherwise, a variable or procedure
reference in an expression that appears in a context selector is a reference to
the variable or procedure of that name that is visible at the location of the
directive on which the context selector appears."

C: "Any expressions in the match clause are interpreted as if they appeared in
the scope of arguments of the base function."

C++: "any expressions in the match clause are interpreted as if they appeared
at the scope of the trailing return type of the base function."

Plus, confusingly, it also says:

"All variables referenced by these expressions are considered to be referenced
at the call site."

"All variables that are referenced in an expression that appears in the context
selector of a match clause must be accessible at each call site to the base
function according to the base language rules."

So maybe the intent is that the variables be parsed in the scope of the
directive but then the expressions be inserted inline at the call site, rather
than wrapping them with an internal function?  :-S

  parent reply	other threads:[~2024-04-11  4:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 11:26 [Bug middle-end/113904] New: " burnus at gcc dot gnu.org
2024-02-13 17:32 ` [Bug middle-end/113904] " burnus at gcc dot gnu.org
2024-02-13 19:56 ` cvs-commit at gcc dot gnu.org
2024-02-13 20:29 ` burnus at gcc dot gnu.org
2024-02-13 21:06 ` sandra at gcc dot gnu.org
2024-04-11  4:51 ` sandra at gcc dot gnu.org [this message]
2024-04-12  3:00 ` sandra at gcc dot gnu.org
2024-05-14  0:44 ` sandra at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113904-4-wha3EmXNs6@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).