public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct
@ 2005-04-14 0:14 nick at ilm dot com
2005-04-14 0:16 ` [Bug c++/21012] " nick at ilm dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: nick at ilm dot com @ 2005-04-14 0:14 UTC (permalink / raw)
To: gcc-bugs
> /dept/rnd/vendor/gcc-4.0.0pre1-amd64/bin/g++ -c bug.C -o /dev/null
bug.C: In member function 'int B::Foo::foo()':
bug.C:9: error: 'int B::Foo::Bar::v' is protected
bug.C:12: error: within this context
> /dept/rnd/vendor/gcc-4.0.0pre1-amd64/bin/g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.0.0-20050410/configure --enable-languages=c,c++
--prefix=/dept/rnd/vendor/gcc-4.0.0-20050410-amd64 --enable-threads
Thread model: posix
gcc version 4.0.0 20050410 (prerelease)
> cat bug.C
namespace A { struct Foo {}; }
namespace B {
struct Foo : public A::Foo
{
public:
struct Bar {
friend struct Foo;
protected:
int v;
};
Bar bar;
int foo () { return bar.v; }
};
}
I believe that friend struct Foo should refer to B::Foo
but it seems to instead refer to A::Foo. This code compiles
correctly on gcc-3.4.1.
--
Summary: [4.0 regression] incorrect name lookup from nested
struct
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nick at ilm dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21012
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/21012] [4.0 regression] incorrect name lookup from nested struct
2005-04-14 0:14 [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct nick at ilm dot com
@ 2005-04-14 0:16 ` nick at ilm dot com
2005-04-14 0:19 ` [Bug c++/21012] [4.0/4.1 " pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: nick at ilm dot com @ 2005-04-14 0:16 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21012
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/21012] [4.0/4.1 regression] incorrect name lookup from nested struct
2005-04-14 0:14 [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct nick at ilm dot com
2005-04-14 0:16 ` [Bug c++/21012] " nick at ilm dot com
@ 2005-04-14 0:19 ` pinskia at gcc dot gnu dot org
2005-04-14 0:23 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 0:19 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |lerdsuwa at users dot
| |sourceforge dot net
Summary|[4.0 regression] incorrect |[4.0/4.1 regression]
|name lookup from nested |incorrect name lookup from
|struct |nested struct
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21012
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/21012] [4.0/4.1 regression] incorrect name lookup from nested struct
2005-04-14 0:14 [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct nick at ilm dot com
2005-04-14 0:16 ` [Bug c++/21012] " nick at ilm dot com
2005-04-14 0:19 ` [Bug c++/21012] [4.0/4.1 " pinskia at gcc dot gnu dot org
@ 2005-04-14 0:23 ` pinskia at gcc dot gnu dot org
2005-04-15 5:31 ` bangerth at dealii dot org
2005-04-15 13:30 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 0:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-14 00:22 -------
I don't remember the rules for friend but I do that 4.0.0 has become closer to what the standard says.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21012
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/21012] [4.0/4.1 regression] incorrect name lookup from nested struct
2005-04-14 0:14 [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct nick at ilm dot com
` (2 preceding siblings ...)
2005-04-14 0:23 ` pinskia at gcc dot gnu dot org
@ 2005-04-15 5:31 ` bangerth at dealii dot org
2005-04-15 13:30 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2005-04-15 5:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2005-04-15 05:31 -------
The unqualified name Foo is looked up within the class hierarchy, and finds
the name of the base class.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21012
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/21012] [4.0/4.1 regression] incorrect name lookup from nested struct
2005-04-14 0:14 [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct nick at ilm dot com
` (3 preceding siblings ...)
2005-04-15 5:31 ` bangerth at dealii dot org
@ 2005-04-15 13:30 ` pinskia at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-15 13:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-15 13:30 -------
*** Bug 21043 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |maxime dot fiandino at imag
| |dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21012
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-15 13:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-14 0:14 [Bug c++/21012] New: [4.0 regression] incorrect name lookup from nested struct nick at ilm dot com
2005-04-14 0:16 ` [Bug c++/21012] " nick at ilm dot com
2005-04-14 0:19 ` [Bug c++/21012] [4.0/4.1 " pinskia at gcc dot gnu dot org
2005-04-14 0:23 ` pinskia at gcc dot gnu dot org
2005-04-15 5:31 ` bangerth at dealii dot org
2005-04-15 13:30 ` 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).