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
90efa0f1
Commit
90efa0f1
authored
Jun 04, 2009
by
Roberto Raggi
Browse files
Check nested name specifiers.
parent
45fb9726
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppmodelmanager.cpp
View file @
90efa0f1
...
...
@@ -256,6 +256,7 @@ class Process;
class
CheckUndefinedSymbols
:
protected
ASTVisitor
{
QSet
<
QByteArray
>
_types
;
QSet
<
QByteArray
>
_namespaceNames
;
public:
CheckUndefinedSymbols
(
Document
::
Ptr
doc
)
...
...
@@ -313,6 +314,10 @@ protected:
if
(
!
processed
->
contains
(
binding
))
{
processed
->
insert
(
binding
);
if
(
Identifier
*
id
=
binding
->
identifier
())
{
_namespaceNames
.
insert
(
QByteArray
(
id
->
chars
(),
id
->
size
()));
}
foreach
(
Namespace
*
ns
,
binding
->
symbols
)
{
for
(
unsigned
i
=
0
;
i
<
ns
->
memberCount
();
++
i
)
{
Symbol
*
member
=
ns
->
memberAt
(
i
);
...
...
@@ -504,6 +509,26 @@ protected:
return
true
;
}
virtual
bool
visit
(
QualifiedNameAST
*
ast
)
{
if
(
ast
->
name
)
{
QualifiedNameId
*
q
=
ast
->
name
->
asQualifiedNameId
();
for
(
unsigned
i
=
0
;
i
<
q
->
nameCount
()
-
1
;
++
i
)
{
Name
*
name
=
q
->
nameAt
(
i
);
if
(
Identifier
*
id
=
name
->
identifier
())
{
const
QByteArray
spell
=
QByteArray
::
fromRawData
(
id
->
chars
(),
id
->
size
());
if
(
!
(
_namespaceNames
.
contains
(
spell
)
||
_types
.
contains
(
spell
)))
{
translationUnit
()
->
warning
(
ast
->
firstToken
(),
"`%s' is not a namespace or class name"
,
spell
.
constData
());
}
}
}
}
return
true
;
}
LookupContext
lookupContext
(
unsigned
line
,
unsigned
column
)
const
;
private:
...
...
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