public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4029: constructor doesn't see base class' members
@ 2002-02-26 14:10 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-02-26 14:10 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, khlebnikov, nobody

Synopsis: constructor doesn't see base class' members

State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Tue Feb 26 14:07:55 2002
State-Changed-Why:
    not a bug. members of a base class cannot be initialized in
    a derrived constructor

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4029


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

* c++/4029: constructor doesn't see base class' members
@ 2001-08-15  3:06 khlebnikov
  0 siblings, 0 replies; 2+ messages in thread
From: khlebnikov @ 2001-08-15  3:06 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4029
>Category:       c++
>Synopsis:       constructor doesn't see base class' members
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 15 03:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     g++
>Release:        3.0.1pre20010801, 3.0 release, 2.95.4pre20010319
>Organization:
>Environment:
Intel Pentium II 233
Progeny Debian Linux 1.0
Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.1/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.0.1 20010801 (Debian prerelease)
>Description:
Constructor does not see base class' member variables
in "var (value)"-style initialization.
>How-To-Repeat:
template <class _TTW>
struct SGBb 
{
	typedef _TTW _TW;
	_TW   sy;
	void* st;
	
	SGBb <_TW> (_TW _sy, void* _st)
		: sy (_sy), st (_st) {}
};

template <class _TW, class _TTWO>
struct SGBMb : public SGBb <_TW> 
{
	typedef _TTWO _TWO;
	_TWO osy;
	
	SGBMb <_TW, _TWO> (_TW _sy, _TWO _osy, void* _st)
		: sy (_sy), osy (_osy), st (_st) {}
};
>Fix:
template <class _TTW>
struct SGBb 
{
	typedef _TTW _TW;
	_TW   sy;
	void* st;
	
	SGBb <_TW> (_TW _sy, void* _st)
		: sy (_sy), st (_st) {}
};

template <class _TW, class _TTWO>
struct SGBMb : public SGBb <_TW> 
{
	typedef _TTWO _TWO;
	_TWO osy;
	
	SGBMb <_TW, _TWO> (_TW _sy, _TWO _osy, void* _st)
		: osy (_osy)
	{
		sy = _sy;
		st = _st;
	}
};
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="error.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="error.cpp"

dGVtcGxhdGUgPGNsYXNzIF9UVFc+CnN0cnVjdCBTR0JiIAp7Cgl0eXBlZGVmIF9UVFcgX1RXOwoJ
X1RXICAgc3k7Cgl2b2lkKiBzdDsKCQoJU0dCYiA8X1RXPiAoX1RXIF9zeSwgdm9pZCogX3N0KQoJ
CTogc3kgKF9zeSksIHN0IChfc3QpIHt9Cn07Cgp0ZW1wbGF0ZSA8Y2xhc3MgX1RXLCBjbGFzcyBf
VFRXTz4Kc3RydWN0IFNHQk1iIDogcHVibGljIFNHQmIgPF9UVz4gCnsKCXR5cGVkZWYgX1RUV08g
X1RXTzsKCV9UV08gb3N5OwoJCglTR0JNYiA8X1RXLCBfVFdPPiAoX1RXIF9zeSwgX1RXTyBfb3N5
LCB2b2lkKiBfc3QpCgkJOiBzeSAoX3N5KSwgb3N5IChfb3N5KSwgc3QgKF9zdCkge30KfTsK


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

end of thread, other threads:[~2002-02-26 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-26 14:10 c++/4029: constructor doesn't see base class' members nathan
  -- strict thread matches above, loose matches on Subject: below --
2001-08-15  3:06 khlebnikov

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