From 5c06dedf7c9350f21eeec37b088ad84097abc4d5 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Thu, 24 Sep 2015 10:30:25 +0200 Subject: [PATCH] data: Fixed inheritance parsing for tests --- bin/test/data/log/test_log.txt | 68 ++++++++++++++++++++++++++ src/lib/data/parser/cxx/ASTVisitor.cpp | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/bin/test/data/log/test_log.txt b/bin/test/data/log/test_log.txt index 8cdb1410..ad041933 100644 --- a/bin/test/data/log/test_log.txt +++ b/bin/test/data/log/test_log.txt @@ -234,6 +234,74 @@ ConfigManager.cpp WARNING: value Int is not present in config. ConfigManager.cpp WARNING: value Float is not present in config. ConfigManager.cpp WARNING: value String is not present in config. ConfigManager.cpp WARNING: value NewBool is not present in config. +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: typedef: type -> int +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: class: Class +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: struct: Struct +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: global: Global +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: global: Global +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: field: m_field +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: field: Struct::m_field +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: function: isTrue +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: method: isMethod +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: method: Class::isMethod +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: namespace: utility +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: enum: Category +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: enum: Class::Category +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: enum constant: VALUE +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: class: ClassA +Storage.cpp INFO: class: ClassB +Storage.cpp INFO: inheritance: ClassB : ClassA +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: struct: StructA +Storage.cpp INFO: struct: StructB +Storage.cpp INFO: inheritance: StructB : StructA +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: method: A::isMethod +Storage.cpp INFO: method: B::isMethod +Storage.cpp INFO: override: A::isMethod -> B::isMethod +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: function: isTrue +Storage.cpp INFO: function: func +Storage.cpp INFO: call: isTrue -> func +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: global: global +Storage.cpp INFO: function: isTrue +Storage.cpp INFO: call: global -> isTrue +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: function: isTrue +Storage.cpp INFO: field: Foo::m_field +Storage.cpp INFO: field usage: isTrue -> Foo::m_field +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: function: isTrue +Storage.cpp INFO: global: global +Storage.cpp INFO: global usage: isTrue -> global +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: function: isTrue +Storage.cpp INFO: struct: Struct +Storage.cpp INFO: type usage: isTrue -> Struct +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: file: file.h < 0:0 0:0> +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: file: file.h < 0:0 0:0> +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: include: file.h +Storage.cpp INFO: file: file.cpp < 0:0 0:0> +Storage.cpp INFO: file: file.h < 0:0 0:0> TextAccess.cpp WARNING: Index 'firstLine' has to be lower or equal index 'lastLine', is 3 > 2 TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8 TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8 diff --git a/src/lib/data/parser/cxx/ASTVisitor.cpp b/src/lib/data/parser/cxx/ASTVisitor.cpp index 0e5b1286..00ce2cca 100644 --- a/src/lib/data/parser/cxx/ASTVisitor.cpp +++ b/src/lib/data/parser/cxx/ASTVisitor.cpp @@ -74,7 +74,7 @@ bool ASTVisitor::VisitCXXRecordDecl(clang::CXXRecordDecl* declaration) } if ((declaration->isClass() || declaration->isStruct()) && - declaration->hasBody() && declaration->hasDefinition() && declaration->getNumBases()) + declaration->hasDefinition() && declaration->getDefinition() == declaration && declaration->getNumBases()) { for (const clang::CXXBaseSpecifier& it : declaration->bases()) {