From 351fa35ec3dfc1a8c78ee64b842eeed6cce7f703 Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Mon, 11 Dec 2017 10:10:09 +0100 Subject: [PATCH] logic: fixed case where reference to member recorded as usage instead of call --- .../Box2D_Collision_b2BroadPhase.txt | 5 +- .../Box2D_Dynamics_Contacts_b2Contact.txt | 5 +- ...ox2D_Dynamics_Contacts_b2ContactSolver.txt | 5 +- .../Box2D_Dynamics_Joints_b2Joint.txt | 5 +- .../expected_output/Box2D_Dynamics_b2Body.txt | 5 +- .../Box2D_Dynamics_b2ContactManager.txt | 5 +- .../Box2D_Dynamics_b2Fixture.txt | 5 +- .../Box2D_Dynamics_b2Island.txt | 5 +- .../Box2D_Dynamics_b2World.txt | 5 +- src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp | 1 + src/lib_cxx/data/parser/cxx/CxxAstVisitor.h | 1 + .../data/parser/cxx/CxxAstVisitorComponent.h | 2 + .../cxx/CxxAstVisitorComponentContext.h | 40 +++--- .../cxx/CxxAstVisitorComponentDeclRefKind.cpp | 5 + .../cxx/CxxAstVisitorComponentDeclRefKind.h | 52 ++++---- .../cxx/CxxAstVisitorComponentImplicitCode.h | 8 +- .../cxx/CxxAstVisitorComponentIndexer.h | 52 ++++---- .../cxx/CxxAstVisitorComponentTypeRefKind.h | 12 +- src/test/CxxIndexSampleProjectsTestSuite.h | 122 +++++++++--------- src/test/CxxParserTestSuite.h | 21 +++ 20 files changed, 191 insertions(+), 170 deletions(-) diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Collision_b2BroadPhase.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Collision_b2BroadPhase.txt index 295b9137..a5134936 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Collision_b2BroadPhase.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Collision_b2BroadPhase.txt @@ -3197,8 +3197,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -3209,7 +3208,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2Contact.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2Contact.txt index f6ea1ebd..fac478da 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2Contact.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2Contact.txt @@ -6276,8 +6276,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -6288,7 +6287,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2ContactSolver.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2ContactSolver.txt index 2d106ab9..2b04e1ae 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2ContactSolver.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Contacts_b2ContactSolver.txt @@ -5860,8 +5860,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -5872,7 +5871,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Joints_b2Joint.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Joints_b2Joint.txt index 79c845de..4d0f062f 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Joints_b2Joint.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_Joints_b2Joint.txt @@ -7116,8 +7116,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -7128,7 +7127,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Body.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Body.txt index 8cfc629e..7da514f3 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Body.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Body.txt @@ -5241,8 +5241,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -5253,7 +5252,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2ContactManager.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2ContactManager.txt index bd99c700..fed6ae7b 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2ContactManager.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2ContactManager.txt @@ -3828,8 +3828,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -3840,7 +3839,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Fixture.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Fixture.txt index e2a1b675..7360cf91 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Fixture.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Fixture.txt @@ -5668,8 +5668,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -5680,7 +5679,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Island.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Island.txt index dc3ebfef..450f1c2a 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Island.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2Island.txt @@ -5610,8 +5610,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <241:36 241:43>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <241:60 241:63>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] LOCAL_SYMBOL: b2BroadPhase.h<241:36> [b2BroadPhase.h <243:15 243:22>] LOCAL_SYMBOL: b2BroadPhase.h<241:60> [b2BroadPhase.h <243:25 243:28>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] @@ -5622,7 +5621,7 @@ LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <247:38 247:45>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <247:70 247:74>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] LOCAL_SYMBOL: b2BroadPhase.h<247:38> [b2BroadPhase.h <249:17 249:24>] LOCAL_SYMBOL: b2BroadPhase.h<247:70> [b2BroadPhase.h <249:27 249:31>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] diff --git a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2World.txt b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2World.txt index 4a94f509..f97d8bf1 100644 --- a/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2World.txt +++ b/bin/test/data/CxxIndexSampleProjectsTestSuite/Box2D/expected_output/Box2D_Dynamics_b2World.txt @@ -4500,14 +4500,13 @@ SYMBOL_METHOD public void b2BroadPhase::Query(T *, const b2AABB &) c REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> void [b2BroadPhase.h <241:8 241:11>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2BroadPhase::Query::T [b2BroadPhase.h <241:33 241:33>] REFERENCE_TYPE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2AABB [b2BroadPhase.h <241:52 241:57>] -SYMBOL_FUNCTION b2DynamicTree b2BroadPhase::m_tree -REFERENCE_CALL void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] +REFERENCE_USAGE void b2BroadPhase::Query(T *, const b2AABB &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <243:2 243:7>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::Query::T [b2BroadPhase.h <240:20 240:20>] SYMBOL_METHOD public void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const [b2BroadPhase.h <246:1 <247:27 247:33> 250:1>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> void [b2BroadPhase.h <247:8 247:11>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2BroadPhase::RayCast::T [b2BroadPhase.h <247:35 247:35>] REFERENCE_TYPE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2RayCastInput [b2BroadPhase.h <247:54 247:67>] -REFERENCE_CALL void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] +REFERENCE_USAGE void b2BroadPhase::RayCast(T *, const b2RayCastInput &) const -> b2DynamicTree b2BroadPhase::m_tree [b2BroadPhase.h <249:2 249:7>] SYMBOL_TEMPLATE_PARAMETER b2BroadPhase::RayCast::T [b2BroadPhase.h <246:20 246:20>] SYMBOL_METHOD public void b2BroadPhase::ShiftOrigin(const b2Vec2 &) [b2BroadPhase.h <252:1 <252:27 252:37> 255:1>] QUALIFIER: b2BroadPhase [b2BroadPhase.h <252:13 252:24>] diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp b/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp index b8b1584b..ff4fd53c 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitor.cpp @@ -400,6 +400,7 @@ DEF_TRAVERSE_TYPE_PTR(DeclRefExpr, {}, {}) DEF_TRAVERSE_TYPE_PTR(CXXForRangeStmt, {}, {}) DEF_TRAVERSE_TYPE(TemplateSpecializationTypeLoc, {}, {}) DEF_TRAVERSE_TYPE_PTR(UnresolvedLookupExpr, {}, {}) +DEF_TRAVERSE_TYPE_PTR(UnresolvedMemberExpr, {}, {}) bool CxxAstVisitor::TraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) { diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitor.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitor.h index b5cefd2c..32b45311 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitor.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitor.h @@ -87,6 +87,7 @@ public: virtual bool TraverseCXXForRangeStmt(clang::CXXForRangeStmt* s); virtual bool TraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc); virtual bool TraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* s); + virtual bool TraverseUnresolvedMemberExpr(clang::UnresolvedMemberExpr* S); virtual bool TraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); virtual bool TraverseLambdaCapture(clang::LambdaExpr* lambdaExpr, const clang::LambdaCapture* capture, clang::Expr *Init); virtual bool TraverseBinComma(clang::BinaryOperator* s); diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponent.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponent.h index 0e7c3a13..a04ce7d2 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponent.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponent.h @@ -50,6 +50,8 @@ DEF_TRAVERSE_TYPE_PTR(CXXForRangeStmt) DEF_TRAVERSE_TYPE_PTR(UnresolvedLookupExpr) +DEF_TRAVERSE_TYPE_PTR(UnresolvedMemberExpr) + virtual void beginTraverseCallCommonCallee() {} virtual void endTraverseCallCommonCallee() {} diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentContext.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentContext.h index 279397ea..0025c94d 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentContext.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentContext.h @@ -17,35 +17,35 @@ public: NameHierarchy getContextName(const size_t skip = 0); NameHierarchy getContextName(const NameHierarchy& fallback, const size_t skip = 0); - virtual void beginTraverseDecl(clang::Decl* d); - virtual void endTraverseDecl(clang::Decl* d); + virtual void beginTraverseDecl(clang::Decl* d) override; + virtual void endTraverseDecl(clang::Decl* d) override; - virtual void beginTraverseTypeLoc(const clang::TypeLoc& tl); - virtual void endTraverseTypeLoc(const clang::TypeLoc& tl); + virtual void beginTraverseTypeLoc(const clang::TypeLoc& tl) override; + virtual void endTraverseTypeLoc(const clang::TypeLoc& tl) override; - virtual void beginTraverseLambdaExpr(clang::LambdaExpr* s); - virtual void endTraverseLambdaExpr(clang::LambdaExpr* s); + virtual void beginTraverseLambdaExpr(clang::LambdaExpr* s) override; + virtual void endTraverseLambdaExpr(clang::LambdaExpr* s) override; - virtual void beginTraverseFunctionDecl(clang::FunctionDecl* d); - virtual void endTraverseFunctionDecl(clang::FunctionDecl* d); + virtual void beginTraverseFunctionDecl(clang::FunctionDecl* d) override; + virtual void endTraverseFunctionDecl(clang::FunctionDecl* d) override; - virtual void beginTraverseClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl *d); - virtual void endTraverseClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl *d); + virtual void beginTraverseClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl *d) override; + virtual void endTraverseClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl *d) override; - virtual void beginTraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d); - virtual void endTraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d); + virtual void beginTraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d) override; + virtual void endTraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d) override; - virtual void beginTraverseDeclRefExpr(clang::DeclRefExpr* s); - virtual void endTraverseDeclRefExpr(clang::DeclRefExpr* s); + virtual void beginTraverseDeclRefExpr(clang::DeclRefExpr* s) override; + virtual void endTraverseDeclRefExpr(clang::DeclRefExpr* s) override; - virtual void beginTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc); - virtual void endTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc); + virtual void beginTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc) override; + virtual void endTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc) override; - virtual void beginTraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* e); - virtual void endTraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* e); + virtual void beginTraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* e) override; + virtual void endTraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* e) override; - virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); - virtual void endTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); + virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) override; + virtual void endTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) override; private: std::vector> m_contextStack; diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.cpp b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.cpp index e315ceba..80a7e42f 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.cpp @@ -116,6 +116,11 @@ void CxxAstVisitorComponentDeclRefKind::beginTraverseCXXTemporaryObjectExpr(clan m_childRefKind = REFERENCE_USAGE; } +void CxxAstVisitorComponentDeclRefKind::beginTraverseUnresolvedMemberExpr(clang::UnresolvedMemberExpr* s) +{ + m_childRefKind = REFERENCE_USAGE; +} + void CxxAstVisitorComponentDeclRefKind::visitVarDecl(clang::VarDecl* d) { m_childRefKind = REFERENCE_USAGE; diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.h index 8600d602..e2f68e93 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentDeclRefKind.h @@ -19,51 +19,53 @@ public: ReferenceKind getReferenceKind() const; - virtual void beginTraverseDecl(clang::Decl* d); - virtual void endTraverseDecl(clang::Decl* d); + virtual void beginTraverseDecl(clang::Decl* d) override; + virtual void endTraverseDecl(clang::Decl* d) override; - virtual void beginTraverseStmt(clang::Stmt* s); - virtual void endTraverseStmt(clang::Stmt* s); + virtual void beginTraverseStmt(clang::Stmt* s) override; + virtual void endTraverseStmt(clang::Stmt* s) override; - virtual void beginTraverseType(const clang::QualType& t); - virtual void endTraverseType(const clang::QualType& t); + virtual void beginTraverseType(const clang::QualType& t) override; + virtual void endTraverseType(const clang::QualType& t) override; - virtual void beginTraverseTypeLoc(const clang::TypeLoc& tl); - virtual void endTraverseTypeLoc(const clang::TypeLoc& tl); + virtual void beginTraverseTypeLoc(const clang::TypeLoc& tl) override; + virtual void endTraverseTypeLoc(const clang::TypeLoc& tl) override; - virtual void beginTraverseCallCommonCallee(); + virtual void beginTraverseCallCommonCallee() override; - virtual void beginTraverseCallCommonArgument(); + virtual void beginTraverseCallCommonArgument() override; - virtual void beginTraverseBinCommaLhs(); + virtual void beginTraverseBinCommaLhs() override; - virtual void beginTraverseBinCommaRhs(); + virtual void beginTraverseBinCommaRhs() override; - virtual void beginTraverseAssignCommonLhs(); + virtual void beginTraverseAssignCommonLhs() override; - virtual void beginTraverseAssignCommonRhs(); + virtual void beginTraverseAssignCommonRhs() override; - virtual void beginTraverseConstructorInitializer(clang::CXXCtorInitializer* init); + virtual void beginTraverseConstructorInitializer(clang::CXXCtorInitializer* init) override; - virtual void beginTraverseCXXTemporaryObjectExpr(clang::CXXTemporaryObjectExpr* s); + virtual void beginTraverseCXXTemporaryObjectExpr(clang::CXXTemporaryObjectExpr* s) override; - virtual void visitVarDecl(clang::VarDecl* d); + virtual void beginTraverseUnresolvedMemberExpr(clang::UnresolvedMemberExpr* s) override; - virtual void visitCastExpr(clang::CastExpr* s); + virtual void visitVarDecl(clang::VarDecl* d) override; - virtual void visitUnaryAddrOf(clang::UnaryOperator* s); + virtual void visitCastExpr(clang::CastExpr* s) override; - virtual void visitUnaryDeref(clang::UnaryOperator* s); + virtual void visitUnaryAddrOf(clang::UnaryOperator* s) override; - virtual void visitDeclStmt(clang::DeclStmt* s); + virtual void visitUnaryDeref(clang::UnaryOperator* s) override; - virtual void visitReturnStmt(clang::ReturnStmt* s); + virtual void visitDeclStmt(clang::DeclStmt* s) override; - virtual void visitInitListExpr(clang::InitListExpr* s); + virtual void visitReturnStmt(clang::ReturnStmt* s) override; - virtual void visitMemberExpr(clang::MemberExpr* s); + virtual void visitInitListExpr(clang::InitListExpr* s) override; - virtual void visitCXXDependentScopeMemberExpr(clang::CXXDependentScopeMemberExpr* s); + virtual void visitMemberExpr(clang::MemberExpr* s) override; + + virtual void visitCXXDependentScopeMemberExpr(clang::CXXDependentScopeMemberExpr* s) override; private: void saveAll(); diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.h index df18046f..c366592c 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.h @@ -12,11 +12,11 @@ public: bool shouldVisitImplicitCode() const; - virtual void beginTraverseDecl(clang::Decl* d); - virtual void endTraverseDecl(clang::Decl* d); + virtual void beginTraverseDecl(clang::Decl* d) override; + virtual void endTraverseDecl(clang::Decl* d) override; - virtual void beginTraverseCXXForRangeStmt(clang::CXXForRangeStmt* s); - virtual void endTraverseCXXForRangeStmt(clang::CXXForRangeStmt* s); + virtual void beginTraverseCXXForRangeStmt(clang::CXXForRangeStmt* s) override; + virtual void endTraverseCXXForRangeStmt(clang::CXXForRangeStmt* s) override; private: std::vector m_stack; diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.h index c0303d3b..01e52b22 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.h @@ -15,36 +15,36 @@ public: CxxAstVisitorComponentIndexer(CxxAstVisitor* astVisitor, clang::ASTContext* astContext, std::shared_ptr client, std::shared_ptr fileRegister); virtual ~CxxAstVisitorComponentIndexer(); - virtual void beginTraverseNestedNameSpecifierLoc(const clang::NestedNameSpecifierLoc& loc); - virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); - virtual void beginTraverseLambdaCapture(clang::LambdaExpr *lambdaExpr, const clang::LambdaCapture *capture); + virtual void beginTraverseNestedNameSpecifierLoc(const clang::NestedNameSpecifierLoc& loc) override; + virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) override; + virtual void beginTraverseLambdaCapture(clang::LambdaExpr *lambdaExpr, const clang::LambdaCapture *capture) override; - virtual void visitTagDecl(clang::TagDecl* d); - virtual void visitClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl* d); - virtual void visitVarDecl(clang::VarDecl* d); - virtual void visitVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl* d); - virtual void visitFieldDecl(clang::FieldDecl* d); - virtual void visitFunctionDecl(clang::FunctionDecl* d); - virtual void visitCXXMethodDecl(clang::CXXMethodDecl* d); - virtual void visitEnumConstantDecl(clang::EnumConstantDecl* d); - virtual void visitNamespaceDecl(clang::NamespaceDecl* d); - virtual void visitNamespaceAliasDecl(clang::NamespaceAliasDecl* d); - virtual void visitTypedefDecl(clang::TypedefDecl* d); - virtual void visitTypeAliasDecl(clang::TypeAliasDecl* d); - virtual void visitUsingDirectiveDecl(clang::UsingDirectiveDecl* d); - virtual void visitUsingDecl(clang::UsingDecl* d); - virtual void visitNonTypeTemplateParmDecl(clang::NonTypeTemplateParmDecl* d); - virtual void visitTemplateTypeParmDecl(clang::TemplateTypeParmDecl* d); - virtual void visitTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl* d); + virtual void visitTagDecl(clang::TagDecl* d) override; + virtual void visitClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl* d) override; + virtual void visitVarDecl(clang::VarDecl* d) override; + virtual void visitVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl* d) override; + virtual void visitFieldDecl(clang::FieldDecl* d) override; + virtual void visitFunctionDecl(clang::FunctionDecl* d) override; + virtual void visitCXXMethodDecl(clang::CXXMethodDecl* d) override; + virtual void visitEnumConstantDecl(clang::EnumConstantDecl* d) override; + virtual void visitNamespaceDecl(clang::NamespaceDecl* d) override; + virtual void visitNamespaceAliasDecl(clang::NamespaceAliasDecl* d) override; + virtual void visitTypedefDecl(clang::TypedefDecl* d) override; + virtual void visitTypeAliasDecl(clang::TypeAliasDecl* d) override; + virtual void visitUsingDirectiveDecl(clang::UsingDirectiveDecl* d) override; + virtual void visitUsingDecl(clang::UsingDecl* d) override; + virtual void visitNonTypeTemplateParmDecl(clang::NonTypeTemplateParmDecl* d) override; + virtual void visitTemplateTypeParmDecl(clang::TemplateTypeParmDecl* d) override; + virtual void visitTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl* d) override; - virtual void visitTypeLoc(clang::TypeLoc tl); + virtual void visitTypeLoc(clang::TypeLoc tl) override; - virtual void visitDeclRefExpr(clang::DeclRefExpr* s); - virtual void visitMemberExpr(clang::MemberExpr* s); - virtual void visitCXXConstructExpr(clang::CXXConstructExpr* s); - virtual void visitLambdaExpr(clang::LambdaExpr* s); + virtual void visitDeclRefExpr(clang::DeclRefExpr* s) override; + virtual void visitMemberExpr(clang::MemberExpr* s) override; + virtual void visitCXXConstructExpr(clang::CXXConstructExpr* s) override; + virtual void visitLambdaExpr(clang::LambdaExpr* s) override; - virtual void visitConstructorInitializer(clang::CXXCtorInitializer* init); + virtual void visitConstructorInitializer(clang::CXXCtorInitializer* init) override; private: struct FileIdHash diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentTypeRefKind.h b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentTypeRefKind.h index 79299a6a..9c72403c 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentTypeRefKind.h +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentTypeRefKind.h @@ -19,14 +19,14 @@ public: ReferenceKind getReferenceKind() const; - virtual void beginTraverseCXXBaseSpecifier(); - virtual void endTraverseCXXBaseSpecifier(); + virtual void beginTraverseCXXBaseSpecifier() override; + virtual void endTraverseCXXBaseSpecifier() override; - virtual void beginTraverseTemplateDefaultArgumentLoc(); - virtual void endTraverseTemplateDefaultArgumentLoc(); + virtual void beginTraverseTemplateDefaultArgumentLoc() override; + virtual void endTraverseTemplateDefaultArgumentLoc() override; - virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); - virtual void endTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc); + virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) override; + virtual void endTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc) override; private: std::vector m_refKindStack; diff --git a/src/test/CxxIndexSampleProjectsTestSuite.h b/src/test/CxxIndexSampleProjectsTestSuite.h index 44eaeccd..8bda72f2 100644 --- a/src/test/CxxIndexSampleProjectsTestSuite.h +++ b/src/test/CxxIndexSampleProjectsTestSuite.h @@ -15,80 +15,78 @@ class CxxIndexSampleProjectsTestSuite : public CxxTest::TestSuite { public: + static const bool s_updateExpectedOutput = false; + void test_index_box2d_project() { #ifdef _WIN32 - const bool updateExpectedOutput = false; - - processSourceFile("Box2D", FilePath("Box2D/Collision/b2BroadPhase.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollideCircle.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollideEdge.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollidePolygon.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2Collision.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2Distance.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2DynamicTree.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/b2TimeOfImpact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2ChainShape.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2CircleShape.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2EdgeShape.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2PolygonShape.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Common/b2BlockAllocator.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Draw.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Math.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Settings.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Common/b2StackAllocator.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Common/b2Timer.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Body.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2ContactManager.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Fixture.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Island.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2World.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2WorldCallbacks.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2CircleContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2Contact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ContactSolver.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonContact.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2DistanceJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2FrictionJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2GearJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2Joint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2MotorJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2MouseJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2PrismaticJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2PulleyJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2RevoluteJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2RopeJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2WeldJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2WheelJoint.cpp"), updateExpectedOutput); - processSourceFile("Box2D", FilePath("Box2D/Rope/b2Rope.cpp"), updateExpectedOutput); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2BroadPhase.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollideCircle.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollideEdge.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2CollidePolygon.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2Collision.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2Distance.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2DynamicTree.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/b2TimeOfImpact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2ChainShape.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2CircleShape.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2EdgeShape.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Collision/Shapes/b2PolygonShape.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Common/b2BlockAllocator.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Common/b2Draw.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Common/b2Math.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Common/b2Settings.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Common/b2StackAllocator.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Common/b2Timer.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Body.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2ContactManager.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Fixture.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2Island.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2World.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/b2WorldCallbacks.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2CircleContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2Contact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2ContactSolver.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Contacts/b2PolygonContact.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2DistanceJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2FrictionJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2GearJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2Joint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2MotorJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2MouseJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2PrismaticJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2PulleyJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2RevoluteJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2RopeJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2WeldJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Dynamics/Joints/b2WheelJoint.cpp")); + processSourceFile("Box2D", FilePath("Box2D/Rope/b2Rope.cpp")); #endif } void test_index_bullet3_project() { #ifdef _WIN32 - const bool updateExpectedOutput = false; - - processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvhBroadphase.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3CpuNarrowPhase.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Common/b3AlignedAllocator.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Common/b3Logging.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Common/b3Vector3.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Geometry/b3ConvexHullComputer.cpp"), updateExpectedOutput); - processSourceFile("Bullet3", FilePath("Bullet3Geometry/b3GeometryUtil.cpp"), updateExpectedOutput); + processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3DynamicBvhBroadphase.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Collision/BroadPhaseCollision/b3OverlappingPairCache.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Collision/NarrowPhaseCollision/b3CpuNarrowPhase.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Common/b3AlignedAllocator.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Common/b3Logging.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Common/b3Vector3.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Geometry/b3ConvexHullComputer.cpp")); + processSourceFile("Bullet3", FilePath("Bullet3Geometry/b3GeometryUtil.cpp")); #endif } private: - void processSourceFile(const std::string& projectName, const FilePath& sourceFilePath, const bool updateExpectedOutput) + void processSourceFile(const std::string& projectName, const FilePath& sourceFilePath) { const FilePath projectDataRoot = FilePath("data/CxxIndexSampleProjectsTestSuite/" + projectName).absolute(); const FilePath projectDataSrcRoot = projectDataRoot.concat(FilePath("src")); @@ -97,7 +95,7 @@ private: std::shared_ptr output = parseCode(projectDataSrcRoot.concat(sourceFilePath), projectDataSrcRoot); FilePath expectedOutputFilePath = projectDataExpectedOutputRoot.concat(FilePath(utility::replace(sourceFilePath.withoutExtension().str() + ".txt", "/", "_"))); - if (updateExpectedOutput || !expectedOutputFilePath.exists()) + if (s_updateExpectedOutput || !expectedOutputFilePath.exists()) { std::ofstream expectedOutputFile; expectedOutputFile.open(expectedOutputFilePath.str()); diff --git a/src/test/CxxParserTestSuite.h b/src/test/CxxParserTestSuite.h index d768bdb7..83437e02 100644 --- a/src/test/CxxParserTestSuite.h +++ b/src/test/CxxParserTestSuite.h @@ -2239,6 +2239,27 @@ public: )); } + void test_cxx_parser_finds_usage_of_member_in_call_expression_to_unresolved_member_expression() + { + std::shared_ptr client = parseCode( + "class A {" + " template \n" + " T run() { return 5; }\n" + "};\n" + "class B {\n" + " template \n" + " T run() {\n" + " return a.run();\n" + " }\n" + " A a;\n" + "};\n" + ); + + TS_ASSERT(utility::containsElement( + client->usages, "T B::run() -> A B::a <7:10 7:10>" + )); + } + void test_cxx_parser_finds_usage_of_member_in_temporary_object_expression() { std::shared_ptr client = parseCode(