BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000714 [uClibc++] Other major always 02-10-06 01:05 05-29-07 17:20
Reporter faye2040 View Status public  
Assigned To gkajmowi
Priority normal Resolution unable to reproduce  
Status closed   Product Version 0.2.0
Summary 0000714: Wrong construction in <utility> for map instantiation
Description Here is my a-little-complicate sample:

#include <map>

using namespace std;

class A {
public:
    A(const char *n): name(n) {}
    A(const A& a): name(a.name) {}

private:
    const char *name;
};

template <typename _T>
struct tS {
    typedef bool (_T::*fn)(void);
    typedef map<A, fn> tSfn;

    void slot(const A& a, fn f) { mp[a] = f; }
private:
    tSfn mp;
};

template <typename _T>
struct tU {
    typedef map<A, tS<_T> > tUtS;

    void slot(const A& a, tS<_T>& m) { mm[a] = m; }
private:
    tUtS mm;
};

struct B {
    bool bb1(void) {}
    bool bb2(void) {}

    tS bMP;
    tU bMM;
};

int main()
{
    A a1("a1"), a2("a2"), a3("a3");
    B b;

    b.bMP.slot(a1, &B::bb1);
    b.bMP.slot(a2, &B::bb2);
    b.bMM.slot(a3, b.bMP);
}
Additional Information The compiling result via MIPS toolchain:
(See the final error reported)

In file included from test.cpp:1:
uClibc++/include/map:130: warning: `typename std::__base_map<Key, T, Compare,
   Allocator>::iterator' is implicitly a typename
uClibc++/include/map:130: warning: implicit typename is deprecated, please see
   the documentation for details
uClibc++/include/map:198: warning: `typename std::__base_map<Key, T, Compare,
   Allocator>::const_iterator' is implicitly a typename
uClibc++/include/map:198: warning: implicit typename is deprecated, please see
   the documentation for details
uClibc++/include/map:529: warning: `typename std::__base_map<Key, T, Compare,
   Allocator>::iterator' is implicitly a typename
uClibc++/include/map:529: warning: implicit typename is deprecated, please see
   the documentation for details
uClibc++/include/map:530: warning: `typename std::__base_map<Key, T, Compare,
   Allocator>::const_iterator' is implicitly a typename
uClibc++/include/map:530: warning: implicit typename is deprecated, please see
   the documentation for details
uClibc++/include/map:853: warning: `typename std::__base_map<Key, T, Compare,
   Allocator>::iterator' is implicitly a typename
uClibc++/include/map:853: warning: implicit typename is deprecated, please see
   the documentation for details
uClibc++/include/map:854: warning: `typename std::__base_map<Key, T, Compare,
   Allocator>::const_iterator' is implicitly a typename
uClibc++/include/map:854: warning: implicit typename is deprecated, please see
   the documentation for details
uClibc++/include/functional: In member function `bool
   std::less<T>::operator()(const T&, const T&) const [with T = A]':
uClibc++/include/map:586: instantiated from `std::pair<std::__base_map<Key, T, Compare, Allocator>::iterator, bool> std::map<Key, T, Compare, Allocator>::insert(std::__base_map<Key, T, Compare, Allocator>::value_type&) [with Key = A, T = bool (B::*)(), Compare = std::less<A>, Allocator = std::allocator<bool (B::*)()>]'
uClibc++/include/map:576: instantiated from `std::__base_map<Key, T, Compare, Allocator>::reference std::map<Key, T, Compare, Allocator>::operator[](std::__base_map<Key, T, Compare, Allocator>::key_type&) [with Key = A, T = bool (B::*)(), Compare = std::less<A>, Allocator = std::allocator<bool (B::*)()>]'
test.cpp:18: instantiated from `void tS<_T>::slot(const A&, bool (_T::*)()) [with _T = B]'
test.cpp:45: instantiated from here
uClibc++/include/functional:145: no match for `const A& < const A&' operator
uClibc++/include/utility: In constructor `std::pair<T1, T2>::pair() [with T1 =
   A, T2 = bool (B::*)()]':
uClibc++/include/deque:437: instantiated from `std::deque<T, Allocator>& std::deque<T, Allocator>::operator=(const std::deque<T, Allocator>&) [with T = std::pair<A, bool (B::*)()>, Allocator = std::allocator<std::pair<A, bool (B::*)()> >]'
uClibc++/include/map:557: instantiated from `std::map<Key, T, Compare, Allocator>& std::map<Key, T, Compare, Allocator>::operator=(const std::map<Key, T, Compare, Allocator>&) [with Key = A, T = bool (B::*)(), Compare = std::less<A>, Allocator = std::allocator<bool (B::*)()>]'
test.cpp:27: instantiated from `void tU<_T>::slot(const A&, tS<_T>&) [with _T = B]'
test.cpp:47: instantiated from here
uClibc++/include/utility:55: no matching function for call to `A::A()'
test.cpp:5: candidates are: A::A(const A&)
test.cpp:7: A::A(const char*)
Attached Files

- Relationships

- Notes
(0001079)
faye2040
02-10-06 01:32

Sorry.... some sample code is mistaken by HTML tag. Here I posted a revised fragment:

struct B {
    bool bb1(void) {}
    bool bb2(void) {}

    tS &lt; B &gt; bMP;
    tU &lt; B &gt; bMM;
};

int main()
{
    A a1("a1"), a2("a2"), a3("a3");
    B b;

    b.bMP.slot(a1, &B::bb1);
    b.bMP.slot(a2, &B::bb2);
    b.bMM.slot(a3, b.bMP);
}
 
(0001102)
faye2040
02-14-06 18:55

I found another way of implementation to prevent from the strange situation:

For your reference only

Here it is:

#include < map >
#include < cstring >

using namespace std;

class A {
public:
    A(const char *n): name(n) {}
    A(const A& a): name(a.name) {}
    bool operator <(const A& a) const { return strcmp(name, a.name); }

private:
 const char *name;
};

template < typename _T >
struct tS {
 typedef bool (_T::*fn)(void);
 typedef map< A, fn > tSfn;

 void slot(const A& a, fn f) { mp[a] = f; }
private:
 tSfn mp;
};

template < typename _T >
struct tU {
 typedef map< A, tS< _T > * > tUtS;

 void slot(const A& a, tS<_T>& m) { mm[a] = &m; }
private:
 tUtS mm;
};

struct B {
 bool bb1(void) {}
 bool bb2(void) {}

 tS< B > bMP;
 tU< B > bMM;
};

int main()
{
 A a1("a1"), a2("a2"), a3("a3");
 B b;

 b.bMP.slot(a1, &B::bb1);
 b.bMP.slot(a2, &B::bb2);
 b.bMM.slot(a3, b.bMP);
}
 
(0001620)
gkajmowi
09-04-06 12:58

Is this still an issue? I've been unable to duplicate this, but I've done a lot of typename cleanup over the past few months.
 
(0002416)
gkajmowi
05-29-07 17:20

I haven't heard anything back in the last 16 months - assuming issue has been addressed.
 

- Issue History
Date Modified Username Field Change
02-10-06 01:05 faye2040 New Issue
02-10-06 01:05 faye2040 Status new => assigned
02-10-06 01:05 faye2040 Assigned To  => gkajmowi
02-10-06 01:32 faye2040 Note Added: 0001079
02-14-06 18:55 faye2040 Note Added: 0001102
09-04-06 12:58 gkajmowi Note Added: 0001620
05-29-07 17:20 gkajmowi Status assigned => closed
05-29-07 17:20 gkajmowi Note Added: 0002416
05-29-07 17:20 gkajmowi Resolution open => unable to reproduce


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker