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
Marco Bubke
flatpak-qt-creator
Commits
89cc8993
Commit
89cc8993
authored
Jul 20, 2010
by
Roberto Raggi
Browse files
Handle shadow declarations.
parent
33b19f02
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppquickfix.cpp
View file @
89cc8993
...
...
@@ -1513,7 +1513,20 @@ public:
if
(
binary
->
left_expression
&&
binary
->
right_expression
&&
tokenAt
(
binary
->
binary_op_token
).
is
(
T_EQUAL
))
{
if
(
isCursorOn
(
binary
->
left_expression
)
&&
binary
->
left_expression
->
asSimpleName
()
!=
0
)
{
SimpleNameAST
*
nameAST
=
binary
->
left_expression
->
asSimpleName
();
if
(
context
().
lookup
(
nameAST
->
name
,
scopeAt
(
nameAST
->
firstToken
())).
isEmpty
())
{
const
QList
<
LookupItem
>
results
=
context
().
lookup
(
nameAST
->
name
,
scopeAt
(
nameAST
->
firstToken
()));
Declaration
*
decl
=
0
;
foreach
(
const
LookupItem
&
r
,
results
)
{
if
(
!
r
.
declaration
())
continue
;
else
if
(
Declaration
*
d
=
r
.
declaration
()
->
asDeclaration
())
{
if
(
!
d
->
type
()
->
isFunctionType
())
{
decl
=
d
;
break
;
}
}
}
if
(
!
decl
)
{
binaryAST
=
binary
;
typeOfExpression
.
init
(
document
(),
snapshot
(),
context
().
bindings
());
return
index
;
...
...
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