[umbrello] [Bug 397664] New: C++ importer does not correctly detect generalization in template classes

Thomas Jansen bugzilla_noreply at kde.org
Mon Aug 20 17:08:10 BST 2018


            Bug ID: 397664
           Summary: C++ importer does not correctly detect generalization
                    in template classes
           Product: umbrello
           Version: Git
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: umbrello-devel at kde.org
          Reporter: mithi at mithi.net
  Target Milestone: ---

Created attachment 114517
  --> https://bugs.kde.org/attachment.cgi?id=114517&action=edit
Initial patch

Umbrello does not correctly parse existing C++ code that uses template classes
when trying to detect a generalization. I debugged the code and found that in
CppTree2Uml::parseBaseClause the baseName contains the template parameters as 
part of the name which does not match the name of the class (that has only the
name of the class without any template parameters).

By stripping the template parameters from baseName the generalization is

The attached patch works for my needs and can be used as a starting point.

Test Cases:

Generalization detection works when not using template classes:
class u1 {
  u1() {}
  ~u1() {}

class u2: public u1 {
  u2() {}
  ~u2() {}

It does not work when using template classes:
template <class T>
class t1 {
  t1() {}
  ~t1() {}

template <class T>
class t2: public t1<T> {
  t2() {}
  ~t2() {}

You are receiving this mail because:
You are the assignee for the bug.

More information about the umbrello-devel mailing list