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

Bug#638461: marked as done (g++-4.4: friend declaration of template class-member fail)



Your message dated Sun, 05 Jul 2015 16:18:22 +0000
with message-id <E1ZBmcY-0006gk-9d@franck.debian.org>
and subject line Bug#707276: Removed package(s) from unstable
has caused the Debian Bug report #638461,
regarding g++-4.4: friend declaration of template class-member fail
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.)


-- 
638461: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638461
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: g++-4.4
Version: 4.4.5-8
Severity: normal


when i try to compile the following code in test.cpp:

template<class A,class B> class X {
public:
  template<class C> X<C,B>& operator[]( const C& );
};

template<class A,class B,class C> class Y : public X<C,B> {
  friend X<C,B>& X<A,B>::template operator[]<C>( const C& );
private:
  Y( X<A,B>& object , const C& index ) : X<C,B>() {};
};

template<class A,class B> template<class C> X<C,B>& X<A,B>::operator[]( const C& index ) {
  return *( new Y<A,B,C>( *this , index ) );
}

void test() {
  X<int,void> x;
  X<int,void>& y = x[2];
}

with the command
  g++ -c test.cpp -o test.o
g++ outputs:
  ./test.cpp: In instantiation of ‘Y<int, void, int>’:
  ./test.cpp:14:   instantiated from ‘X<C, B>& X<A,B>::operator[](const C&) [with C = int, A = int, B = void]’
  ./test.cpp:19:   instantiated from here
  ./test.cpp:8: error: ‘operator[]’ not defined
  ./test.cpp: In member function ‘X<C, B>& X<A, B>::operator[](const C&) [with C = int, A = int, B = void]’:
  ./test.cpp:19:   instantiated from here
  ./test.cpp:10: error: ‘Y<A, B, C>::Y(X<A, B>&, const C&) [with A = int, B = void, C = int]’ is private
  ./test.cpp:14: error: within this context

It is unable to tell that 'operator[]' exist and is declared as a
friend class-method. So then it fail when there is a call to the
private constructor. I asked on the internet and seems that the friend
declaration is correct so I tryed whit 'clang' and it does not report
anything. This seems a g++ bug so I am sending a report in the Debian
bug tracking system and also in the gcc bug tracking system.

-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages g++-4.4 depends on:
ii  gcc-4.4                   4.4.5-8        The GNU C compiler
ii  gcc-4.4-base              4.4.5-8        The GNU Compiler Collection (base 
ii  libc6                     2.11.2-10      Embedded GNU C Library: Shared lib
ii  libgmp3c2                 2:4.3.2+dfsg-1 Multiprecision arithmetic library
ii  libmpfr4                  3.0.0-2        multiple precision floating-point 
ii  libstdc++6-4.4-dev        4.4.5-8        The GNU Standard C++ Library v3 (d

g++-4.4 recommends no packages.

Versions of packages g++-4.4 suggests:
pn  g++-4.4-multilib              <none>     (no description available)
pn  gcc-4.4-doc                   <none>     (no description available)
pn  libstdc++6-4.4-dbg            <none>     (no description available)

-- no debconf information



--- End Message ---
--- Begin Message ---
Version: 1:4.4.7-8+rm

Dear submitter,

as the package gcc-4.4 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/707276

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Luca Falavigna (the ftpmaster behind the curtain)

--- End Message ---

Reply to: