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
e8fc8503
Commit
e8fc8503
authored
Sep 30, 2009
by
Roberto Raggi
Browse files
Don't search for the canonical symbol in the base classes (at least for now).
parent
bb263645
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/LookupContext.cpp
View file @
e8fc8503
...
...
@@ -504,10 +504,12 @@ void LookupContext::expand(Scope *scope,
Symbol
*
LookupContext
::
canonicalSymbol
(
Symbol
*
symbol
)
{
Symbol
*
canonical
=
symbol
;
for
(;
symbol
;
symbol
=
symbol
->
next
())
{
if
(
symbol
->
name
()
==
canonical
->
name
())
canonical
=
symbol
;
}
return
canonical
;
}
...
...
@@ -516,35 +518,16 @@ Symbol *LookupContext::canonicalSymbol(const QList<Symbol *> &candidates)
if
(
candidates
.
isEmpty
())
return
0
;
Symbol
*
candidate
=
candidates
.
first
();
if
(
candidate
->
scope
()
->
isClassScope
()
&&
candidate
->
type
()
->
isFunctionType
())
{
Function
*
function
=
0
;
for
(
int
i
=
0
;
i
<
candidates
.
size
();
++
i
)
{
Symbol
*
c
=
candidates
.
at
(
i
);
if
(
!
c
->
scope
()
->
isClassScope
())
continue
;
else
if
(
Function
*
f
=
c
->
type
()
->
asFunctionType
())
{
if
(
f
->
isVirtual
())
function
=
f
;
}
}
if
(
function
)
return
canonicalSymbol
(
function
);
}
return
canonicalSymbol
(
candidate
);
return
canonicalSymbol
(
candidates
.
first
());
}
Symbol
*
LookupContext
::
canonicalSymbol
(
const
QList
<
QPair
<
FullySpecifiedType
,
Symbol
*>
>
&
results
)
{
QList
<
Symbol
*>
candidates
;
QPair
<
FullySpecifiedType
,
Symbol
*>
result
;
foreach
(
result
,
results
)
{
foreach
(
result
,
results
)
candidates
.
append
(
result
.
second
);
// ### not exacly.
}
return
canonicalSymbol
(
candidates
);
}
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