Author Topic: Typedefs of templated classes  (Read 12727 times)

Offline childinsilence

  • Multiple posting newcomer
  • *
  • Posts: 10
Typedefs of templated classes
« on: September 28, 2010, 02:04:30 pm »
I tried the branch on Ubuntu 10.04 with boost 1.40. On my system (don't know if it should work) the cc fails to detect boost filesystems wpath. This is a typedef of a templated class:

Code
typedef basic_path< std::wstring, wpath_traits > wpath;

Here is an example:

Code
#include <boost/filesystem.hpp>

namespace bfs = boost::filesystem;

int main(void)
{
    boost::filesystem::wpath a; // not detected by cc, but "Find declaration of: wpath" hits the right line on 10.05.
    bfs::wpath b; // not detected by cc
    return 0;
}

As in the comment. On 10.05 the find declaration command of the current release detects wpath.

Greets

EDIT: It's revision 6650.
« Last Edit: September 28, 2010, 03:54:12 pm by childinsilence »

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Typedefs of templated classes
« Reply #1 on: September 28, 2010, 04:27:35 pm »
Fixed! thanks!!

Offline childinsilence

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Typedefs of templated classes
« Reply #2 on: September 28, 2010, 05:00:26 pm »
You're welcome.

Another example. Maybe another bug. Again boost 1.40 on Ubuntu 10.04 with revision 6650:

Code
#include <boost/shared_ptr.hpp>

class Dummy
{
    Dummy();
    int m_dummy;
};
typedef boost::shared_ptr<Dummy> DummyPtr;

int main(void)
{
    DummyPtr ptrDummy = DummyPtr(new Dummy());
    ptrDummy->m_dummy; // Does not work. Shows members of boost::shared_ptr instead of Dummy.
    ptrDummy.get(); // Does the right.
    return 0;
}

Cc returns a list of all symbols of boost::shared_ptr, but not m_dummy on the "->" operator. The dot operator does the right.

Code
template<typename T> class shared_ptr;

Cheers!
« Last Edit: September 29, 2010, 10:58:47 am by childinsilence »

Offline childinsilence

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Typedefs of templated classes
« Reply #3 on: September 29, 2010, 10:58:58 am »
Applied the patch and found wpath. Thank you. Still didn't found m_dummy.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Typedefs of templated classes
« Reply #4 on: September 30, 2010, 07:14:31 am »
Applied the patch and found wpath. Thank you. Still didn't found m_dummy.
I will look into it. :)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: Typedefs of templated classes
« Reply #5 on: September 30, 2010, 09:44:03 am »
You're welcome.

Another example. Maybe another bug. Again boost 1.40 on Ubuntu 10.04 with revision 6650:

Code
#include <boost/shared_ptr.hpp>

class Dummy
{
    Dummy();
    int m_dummy;
};
typedef boost::shared_ptr<Dummy> DummyPtr;

int main(void)
{
    DummyPtr ptrDummy = DummyPtr(new Dummy());
    ptrDummy->m_dummy; // Does not work. Shows members of boost::shared_ptr instead of Dummy.
    ptrDummy.get(); // Does the right.
    return 0;
}

Cc returns a list of all symbols of boost::shared_ptr, but not m_dummy on the "->" operator. The dot operator does the right.

Code
template<typename T> class shared_ptr;

Cheers!

should be fixed  in the next nightly build 8)
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline childinsilence

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Typedefs of templated classes
« Reply #6 on: October 11, 2010, 09:41:56 am »
"ptrDummy->m_dummy" isn't fixed in rev. 6701, which subsequents nightly build of rev. 6688.
May this be a consequence of overloading the "->" operator in boost::shared_ptr?

Offline Borr

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Typedefs of templated classes
« Reply #7 on: October 15, 2010, 07:14:06 am »
May this be a consequence of overloading the "->" operator in boost::shared_ptr?

I think for this reason Codecombletion does not work for the IBPP
http://forums.codeblocks.org/index.php/topic,13338.msg90045.html#msg90045

Offline childinsilence

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Typedefs of templated classes
« Reply #8 on: January 05, 2011, 06:54:42 am »
"ptrDummy->m_dummy" isn't fixed in rev. 6701, which subsequents nightly build of rev. 6688.
May this be a consequence of overloading the "->" operator in boost::shared_ptr?

Isn't fixed in 6906.