#31 Problems with namespaces and templates

closed-fixed
nobody
None
5
2012-05-03
2012-04-18
No

changeset: 10:a9ea6c97e1d7

I changed the file CppHeaderParser/examples/SmapleClass.h to:
template<class T> TestTemplateClass
{
};

namespace TestNamespace2
{
class TestClass
{
};
}

class SampleClass
{
public:
TestNamespace::TestClass meth(tr1::shared_ptr<TestTemplateClass<TestNamespace::TestClass> >);
};

Output of readSampleClass.py is:
CppHeaderParser view of class TestNamespace2::TestClass
{
public
protected
private
}

class SampleClass
{
public
// Methods
{'static': False, 'rtnType': 'TestNamespace : : TestClass', 'parameters': [{'constant': 0, 'name': '>', 'reference': 0, 'type': 'tr1::shared_ptr<TestTemplateClass<TestNamespace::TestClass>', 'static': 0, 'pointer': 0}], 'namespace': '', 'virtual': False, 'destructor': False, 'returns': 'TestNamespace::TestClass', 'template': False, 'friend': False, 'unresolved_parameters': True, 'returns_class': False, 'extern': False, 'path': 'SampleClass', 'returns_pointer': 0, 'class': None, 'name': 'meth', 'pure_virtual': False, 'explicit': False, 'returns_fundamental': False, 'constructor': False, 'debug': 'TestNamespace : : TestClass meth ( tr1 : : shared_ptr <TestTemplateClass <TestNamespace : : TestClass > > ) ;', 'inline': False}
protected
private
}

Notice the wrong parsing of the parameter and the additional spaces because of the namespace in the debug field.
Also the rtnType for the method is "TestNamespace : : TestClass".

Discussion

  • Jashua Cloutier

    Jashua Cloutier - 2012-05-03

    Fixed in commit 73:21f0f760cae5

     
  • Jashua Cloutier

    Jashua Cloutier - 2012-05-03
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks