Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
5bee5dea
Commit
5bee5dea
authored
Oct 13, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check the scope of class and fwd-class declarations
parent
b07c1be5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
src/plugins/cpptools/cppfindreferences.cpp
src/plugins/cpptools/cppfindreferences.cpp
+22
-2
src/shared/cplusplus/Symbol.cpp
src/shared/cplusplus/Symbol.cpp
+8
-0
src/shared/cplusplus/Symbol.h
src/shared/cplusplus/Symbol.h
+2
-0
No files found.
src/plugins/cpptools/cppfindreferences.cpp
View file @
5bee5dea
...
...
@@ -166,6 +166,26 @@ protected:
return
false
;
}
bool
checkScope
(
Symbol
*
symbol
,
Symbol
*
otherSymbol
)
const
{
if
(
!
(
symbol
&&
otherSymbol
))
return
false
;
else
if
(
symbol
->
scope
()
==
otherSymbol
->
scope
())
return
true
;
else
if
(
symbol
->
name
()
&&
otherSymbol
->
name
())
{
if
(
!
symbol
->
name
()
->
isEqualTo
(
otherSymbol
->
name
()))
return
false
;
}
else
if
(
symbol
->
name
()
!=
otherSymbol
->
name
())
{
return
false
;
}
return
checkScope
(
symbol
->
enclosingSymbol
(),
otherSymbol
->
enclosingSymbol
());
}
bool
isDeclSymbol
(
Symbol
*
symbol
)
const
{
if
(
!
symbol
)
...
...
@@ -180,11 +200,11 @@ protected:
}
else
if
(
symbol
->
isForwardClassDeclaration
()
&&
(
_declSymbol
->
isClass
()
||
_declSymbol
->
isForwardClassDeclaration
()))
{
return
true
;
return
checkScope
(
symbol
,
_declSymbol
)
;
}
else
if
(
_declSymbol
->
isForwardClassDeclaration
()
&&
(
symbol
->
isClass
()
||
symbol
->
isForwardClassDeclaration
()))
{
return
true
;
return
checkScope
(
symbol
,
_declSymbol
)
;
}
return
false
;
...
...
src/shared/cplusplus/Symbol.cpp
View file @
5bee5dea
...
...
@@ -314,6 +314,14 @@ void Symbol::setScope(Scope *scope)
_scope
=
scope
;
}
Symbol
*
Symbol
::
enclosingSymbol
()
const
{
if
(
!
_scope
)
return
0
;
return
_scope
->
owner
();
}
Scope
*
Symbol
::
enclosingNamespaceScope
()
const
{
if
(
!
_scope
)
...
...
src/shared/cplusplus/Symbol.h
View file @
5bee5dea
...
...
@@ -281,6 +281,8 @@ public:
bool
isGenerated
()
const
;
Symbol
*
enclosingSymbol
()
const
;
/// Returns the eclosing namespace scope.
Scope
*
enclosingNamespaceScope
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment