[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#492079: marked as done ([g++-4.3] following code don't compile, g++ can't see inherited variable)



Your message dated Tue, 2 Dec 2008 02:54:01 +0100
with message-id <18740.38201.465345.157330@gargle.gargle.HOWL>
and subject line Re: Bug#492079: [g++-4.3] following code don't compile, g++ can't see inherited variable
has caused the Debian Bug report #492079,
regarding [g++-4.3] following code don't compile, g++ can't see inherited variable
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
492079: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492079
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: g++-4.3
Version: 4.3.1-2
Severity: normal

--- Please enter the report below this line. ---

The following code can't be compiled, workaround is to use "this" pointer:
//////////////////////////////////////////
class A {
protected:
    int len;
};

template <int N>
class B : public A {
protected:
    char buf[N];
};

template <int N>
class C : public B<N> {
public:
    int do_workaround_len() { return this->len; }
    int do_someting_len() { return len; }
};

int main() {
//    C<500> c;
    return 0;
}

/////////////////////////////////////////
g++ test.cpp

test.cpp: In member function ‘int C<N>::do_someting_len()’:
test.cpp:17: error: ‘len’ was not declared in this scope

same result using g++ version 4.1, 4.2, 4.3


--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.25-2-686

Debian Release: lenny/sid
   90 unstable        www.debian-multimedia.org 
   90 unstable        ftp.debian-unofficial.org 
   90 unstable        ftp.bg.debian.org 
   90 unstable        apt.byteme.org.uk 
   80 experimental    ftp.bg.debian.org 
  500 testing         www.debian-multimedia.org 
  500 testing         security.debian.org 
  500 testing         ftp.debian-unofficial.org 
  500 testing         ftp.bg.debian.org 
  500 any             apt.jenslody.de 

--- Package information. ---
Depends                  (Version) | Installed
==================================-+-============
gcc-4.3-base           (= 4.3.1-2) | 4.3.1-2
gcc-4.3                (= 4.3.1-2) | 4.3.1-2
libstdc++6-4.3-dev     (= 4.3.1-2) | 4.3.1-2
libc6                   (>= 2.7-1) | 2.7-10
libgmp3c2                          | 2:4.2.2+dfsg-3
libmpfr1ldbl                       | 2.3.1.dfsg.1-2





--- End Message ---
--- Begin Message ---
> No bug. This are the template name lookup rules.
> 
> Bastian

closing


--- End Message ---

Reply to: