Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
4eb40af9
Commit
4eb40af9
authored
Aug 17, 2010
by
Roberto Raggi
Browse files
Skip constructors and destructors when searching for the canonical symbol.
parent
9c1fc97a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
4eb40af9
...
...
@@ -344,17 +344,23 @@ struct CanonicalSymbol
for
(
int
i
=
results
.
size
()
-
1
;
i
!=
-
1
;
--
i
)
{
const
LookupItem
&
r
=
results
.
at
(
i
);
Symbol
*
decl
=
r
.
declaration
();
if
(
!
r
.
declaration
())
break
;
else
if
(
!
r
.
declaration
()
->
scope
())
break
;
else
if
(
!
r
.
declaration
()
->
scope
()
->
isClass
())
if
(
!
(
decl
&&
decl
->
scope
()))
break
;
if
(
Function
*
funTy
=
r
.
declaration
()
->
type
()
->
asFunctionType
())
if
(
funTy
->
isVirtual
())
return
r
.
declaration
();
if
(
Class
*
classScope
=
r
.
declaration
()
->
scope
()
->
asClass
())
{
const
Identifier
*
declId
=
decl
->
identifier
();
const
Identifier
*
classId
=
classScope
->
identifier
();
if
(
classId
&&
classId
->
isEqualTo
(
declId
))
continue
;
// skip it, it's a ctor or a dtor.
else
if
(
Function
*
funTy
=
r
.
declaration
()
->
type
()
->
asFunctionType
())
{
if
(
funTy
->
isVirtual
())
return
r
.
declaration
();
}
}
}
for
(
int
i
=
0
;
i
<
results
.
size
();
++
i
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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