public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107624] New: Wrong code with static operator ()
@ 2022-11-10 21:42 jakub at gcc dot gnu.org
  2022-11-10 21:45 ` [Bug c++/107624] [c++23] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-10 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107624
           Summary: Wrong code with static operator ()
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

In:
struct S {
  static void operator() (int);
  static void baz (int);
};
S &foo (int);

void
bar ()
{
  foo (0) (0);
  foo (1).baz (1);
}
we transform the latter into *foo (1), S::baz (1), but the former into just
S::operator() (0) - the side-effects on the postfix-expression are gone.
Shouldn't we add that somewhere as COMPOUND_EXPR when we select a static
operator() (ditto for static operator[])?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-28 22:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 21:42 [Bug c++/107624] New: Wrong code with static operator () jakub at gcc dot gnu.org
2022-11-10 21:45 ` [Bug c++/107624] [c++23] " pinskia at gcc dot gnu.org
2022-11-16 13:44 ` cvs-commit at gcc dot gnu.org
2022-11-16 14:01 ` jakub at gcc dot gnu.org
2022-11-28 22:23 ` pinskia at gcc dot gnu.org

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).