public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95536] New: tag name injection doesn't happen for return type of a friend
@ 2020-06-04 16:18 richard-gccbugzilla at metafoo dot co.uk
  2020-06-04 19:31 ` [Bug c++/95536] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2020-06-04 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95536
           Summary: tag name injection doesn't happen for return type of a
                    friend
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk
  Target Milestone: ---

Testcase:

struct A {
    friend struct B *f();
};
B *p;

GCC rejects this saying that 'B' is not declared, which is incorrect -- the
'struct B' introduces the name 'B' into the enclosing non-class scope. GCC gets
this right for

struct A {
    friend void f(struct B *);
};
B *p;

so I'd guess that GCC is incorrectly applying the rules for friend class
declarations (eg, 'friend struct B;' does not make 'B' visible outside the
class).

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

* [Bug c++/95536] tag name injection doesn't happen for return type of a friend
  2020-06-04 16:18 [Bug c++/95536] New: tag name injection doesn't happen for return type of a friend richard-gccbugzilla at metafoo dot co.uk
@ 2020-06-04 19:31 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-04 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-06-04
           Keywords|                            |rejects-valid
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

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

end of thread, other threads:[~2020-06-04 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 16:18 [Bug c++/95536] New: tag name injection doesn't happen for return type of a friend richard-gccbugzilla at metafoo dot co.uk
2020-06-04 19:31 ` [Bug c++/95536] " mpolacek 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).