public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8163: call of template code is rejected as private in this context
@ 2002-10-07 9:56 schnoerr
0 siblings, 0 replies; 2+ messages in thread
From: schnoerr @ 2002-10-07 9:56 UTC (permalink / raw)
To: gcc-gnats
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2692 bytes --]
>Number: 8163
>Category: c++
>Synopsis: call of template code is rejected as private in this context
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Oct 07 09:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Claudius Schnörr
>Release: gcc version 3.2 20020818 (prerelease)
>Organization:
>Environment:
Configured with: /netrel/src/gcc-3.2-1/configure --enable-languages=c,c++,f77,ja
va --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --with
out-included-gettext --enable-interpreter --disable-sjlj-exceptions --disable-ve
rsion-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc
-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr --exec-prefix=/usr
--sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecd
ir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)
>Description:
A method Test<Type,1>::testfkt() is called.
Therein, a method Test<Type,2>::dat_embrace( Test<Type,1> & )
of a local Test<Type,2>-objekt is called, which is rejected as
being private to TopObj<Type,1>.
This is true but in this case, a local TopObj<Type,2> calls it,
which should be allowed to call it.
I think this is incorrect, but I'm not sure.
The error message:
g++ test.cc -o test -Wall
test.cc: In member function `Test<Rank>& Test<Rank>::testfkt() [with short int
Rank = 1]':
test.cc:24: instantiated from here
test.cc:13: `void Test<Rank>::dat_embrace(Test<LowRank>&) [with short int
LowRank = 1, short int Rank = 2]' is private
test.cc:19: within this context
>How-To-Repeat:
>Fix:
Work around:
make corresponding methods public:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"
dGVtcGxhdGUgPHNob3J0IFJhbms+CmNsYXNzIFRlc3QgewpwdWJsaWM6CiAgICBUZXN0KCkge30K
CiAgICBUZXN0PFJhbms+ICYgdGVzdGZrdCgpOwpwcml2YXRlOgogICAgdGVtcGxhdGUgPHNob3J0
IExvd1Jhbms+CiAgICBpbmxpbmUgdm9pZCBkYXRfZW1icmFjZSggVGVzdDxMb3dSYW5rPiAmIGRh
ZCApOwp9OwoKdGVtcGxhdGUgPHNob3J0IFJhbms+IHRlbXBsYXRlIDxzaG9ydCBMb3dSYW5rPgp2
b2lkIFRlc3Q8UmFuaz46OmRhdF9lbWJyYWNlKCBUZXN0PExvd1Jhbms+ICYgdHR0ICkge30KCnRl
bXBsYXRlIDxzaG9ydCBSYW5rPgpUZXN0PFJhbms+ICYgVGVzdDxSYW5rPjo6dGVzdGZrdCgpIHsK
ICAgIFRlc3Q8Mj4gdG8yID0gVGVzdDwyPigpOwogICAgVGVzdDwxPiB0bzEgPSBUZXN0PDE+KCk7
CiAgICB0bzIuZGF0X2VtYnJhY2UoIHRvMSApOwp9CgppbnQgbWFpbiAoKSB7CiAgICBUZXN0PDE+
IHR0dCA9IFRlc3Q8MT4oKTsKICAgIHR0dC50ZXN0Zmt0KCk7Cn0K
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/8163: call of template code is rejected as private in this context
@ 2002-10-24 7:28 lerdsuwa
0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2002-10-24 7:28 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, schnoerr
Synopsis: call of template code is rejected as private in this context
State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Thu Oct 24 07:28:48 2002
State-Changed-Why:
Not a bug. From your code, you are calling
"Test<2>::dat_embrace" from "Test<1>::testfkt".
The type access only permit calling
"Test<1>::dat_embrace" from "Test<1>::testfkt".
or
"Test<2>::dat_embrace" from "Test<2>::testfkt".
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8163
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-10-24 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-07 9:56 c++/8163: call of template code is rejected as private in this context schnoerr
2002-10-24 7:28 lerdsuwa
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).