public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19868] error for legal friend statement ?
  2005-02-10  0:35 [Bug c++/19868] New: error for legal friend statement ? dcb314 at hotmail dot com
@ 2005-02-10  0:35 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-10  0:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-09 20:13 -------
Nope the code is invalid and looks like most compilers get it wrong also then.
This is a dup of bug 7809.

This was also DR 209.

*** This bug has been marked as a duplicate of 7809 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19868


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

* [Bug c++/19868] New: error for legal friend statement ?
@ 2005-02-10  0:35 dcb314 at hotmail dot com
  2005-02-10  0:35 ` [Bug c++/19868] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: dcb314 at hotmail dot com @ 2005-02-10  0:35 UTC (permalink / raw)
  To: gcc-bugs

Hello there,

Give the following C++ code

class A
{
private:
	void f();
};

class B
{
private:
	friend void A :: f();
};

then g++ 3.4.2 and g++ 3.4 snapshot 20050128 say

[dcb@localhost Alphasrc]$ ~/gnu/20050128/results/bin/g++ -c friend2.cc
friend2.cc:5: error: `void A::f()' is private
friend2.cc:11: error: within this context

I checked a couple of other C++ compilers, and they were happy with
the code.

I checked Stroustrup 3, section 11.5, page 279 in my copy. He has similar
code, and he appears to claim that the code should be ok.

Would I be correct in thinking that the definition of the language has
recently changed in this area ?

-- 
           Summary: error for legal friend statement ?
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: linux-i686-pc-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19868


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

end of thread, other threads:[~2005-02-09 20:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-10  0:35 [Bug c++/19868] New: error for legal friend statement ? dcb314 at hotmail dot com
2005-02-10  0:35 ` [Bug c++/19868] " pinskia at gcc dot gnu dot 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).