public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24090] New: gcc 4.1.0 20050926 - friends not visible outside class
@ 2005-09-27 20:00 jaffe at broad dot mit dot edu
  2005-09-27 20:24 ` [Bug c++/24090] " schwab at suse dot de
  2005-09-27 20:34 ` ian at airs dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jaffe at broad dot mit dot edu @ 2005-09-27 20:00 UTC (permalink / raw)
  To: gcc-bugs

If test.cc is:

class F { 
   friend void global_f() {}
};
class G {
   void member_of_g() { global_f(); }
};

then gcc -c test.cc yields

test.cc: In member function 'void G::member_of_g()':
test.cc:5: error: 'global_f' was not declared in this scope

which appears to be wrong.

% gcc -v
Using built-in specs.
Target: ia64-unknown-linux-gnu
Configured with: ../configure --prefix=/wga1/gcc --enable-checking=release
Thread model: posix
gcc version 4.1.0 20050926 (experimental)

-- 
           Summary: gcc 4.1.0 20050926 - friends not visible outside class
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jaffe at broad dot mit dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ia64-unknown-linux-gnu
  GCC host triplet: ia64-unknown-linux-gnu
GCC target triplet: ia64-unknown-linux-gnu


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


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

* [Bug c++/24090] gcc 4.1.0 20050926 - friends not visible outside class
  2005-09-27 20:00 [Bug c++/24090] New: gcc 4.1.0 20050926 - friends not visible outside class jaffe at broad dot mit dot edu
@ 2005-09-27 20:24 ` schwab at suse dot de
  2005-09-27 20:34 ` ian at airs dot com
  1 sibling, 0 replies; 3+ messages in thread
From: schwab at suse dot de @ 2005-09-27 20:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2005-09-27 20:24 -------
A friend declaration only changes the visibility, it does not declare the 
name. 

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


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


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

* [Bug c++/24090] gcc 4.1.0 20050926 - friends not visible outside class
  2005-09-27 20:00 [Bug c++/24090] New: gcc 4.1.0 20050926 - friends not visible outside class jaffe at broad dot mit dot edu
  2005-09-27 20:24 ` [Bug c++/24090] " schwab at suse dot de
@ 2005-09-27 20:34 ` ian at airs dot com
  1 sibling, 0 replies; 3+ messages in thread
From: ian at airs dot com @ 2005-09-27 20:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ian at airs dot com  2005-09-27 20:34 -------
See PR 7874 (http://gcc.gnu.org/PR7874) for more discussion.  Basically gcc now
conforms to the ISO C++ standard in this regard.  This is a change from earlier
releases, and is documented at http://gcc.gnu.org/gcc-4.1/changes.html.  The old
behaviour was declared to be deprecated in http://gcc.gnu.org/gcc-3.4/changes.html.

-- 


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


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-27 20:00 [Bug c++/24090] New: gcc 4.1.0 20050926 - friends not visible outside class jaffe at broad dot mit dot edu
2005-09-27 20:24 ` [Bug c++/24090] " schwab at suse dot de
2005-09-27 20:34 ` ian at airs dot com

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