This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/109: Re: g++ 2.95.2 can't handle dependent friend member functions
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/109: Re: g++ 2.95.2 can't handle dependent friend member functions
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 15 Mar 2000 09:58:36 +0100
- References: <LGKPIJCIBKKBNAAA@my-deja.com>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, sebor at my-Deja dot com
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>Number: 109
>Category: c++
>Synopsis: g++ 2.95.2 can't handle dependent friend member functions
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: analyzed
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Mar 15 01:06:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: " " <sebor@my-Deja.com>
>Release: 2.95.2
>Organization:
My Deja Email (http://www.my-deja.com:80)
>Environment:
>Description:
Date: Fri, 24 Dec 1999 12:44:10 -0800
Original-Message-ID: <LGKPIJCIBKKBNAAA@my-deja.com>
Hi,
the program below doesn't compile with g++ 2.95.2. I can't find anything
in 11.4 or in 14.5.3 that would indicate that the code is not legal. It
compiles fine with edg 2.42. Am I missing something or is this a g++
bug?
Thanks
Martin
$ cat test.cpp
struct B
{
static void foo () { }
};
template <class T>
struct A
{
friend void T::foo (); // <-- error
friend void B::foo (); // <-- ok
};
int main ()
{
A<B> a;
}
$ g++ -v test.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix
-D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386)
-Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__
-D__pentiumpro -D__pentiumpro__
/build/sebor/dev/stdlib2/tests/regress/src/test.cpp /tmp/ccWfj4o0.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search
path:
End of omitted list.
/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus /tmp/ccWfj4o0.ii
-quiet -dumpbase test.cc -version -o /tmp/ccofIB0P.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled
by GNU C version 2.95.2 19991024 (release).
test.cpp:12: `T::foo' is not a valid declarator
test.cpp:12: perhaps you want `typename T::foo' to make it a type
test.cpp: In instantiation of `A<B>':
test.cpp:18: instantiated from here
test.cpp:5: confused by earlier errors, bailing out
--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: