Skip to content
GitLab
Menu
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
65a1c129
Commit
65a1c129
authored
Aug 11, 2010
by
Roberto Raggi
Browse files
Look only at template classes.
parent
97d93ed3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppchecksymbols.cpp
View file @
65a1c129
...
...
@@ -845,6 +845,19 @@ void CheckSymbols::addType(ClassOrNamespace *b, NameAST *ast)
//qDebug() << "added use" << oo(ast->name) << line << column << length;
}
bool
CheckSymbols
::
isTemplateClass
(
Symbol
*
symbol
)
const
{
if
(
symbol
)
{
if
(
Template
*
templ
=
symbol
->
asTemplate
())
{
if
(
Symbol
*
declaration
=
templ
->
declaration
())
{
if
(
declaration
->
isClass
())
return
true
;
}
}
}
return
false
;
}
void
CheckSymbols
::
addTypeOrStatic
(
const
QList
<
LookupItem
>
&
candidates
,
NameAST
*
ast
)
{
unsigned
startToken
=
ast
->
firstToken
();
...
...
@@ -862,7 +875,7 @@ void CheckSymbols::addTypeOrStatic(const QList<LookupItem> &candidates, NameAST
else
if
(
c
->
isUsingNamespaceDirective
())
// ... and using namespace directives.
continue
;
else
if
(
c
->
isTypedef
()
||
c
->
isNamespace
()
||
c
->
isClass
()
||
c
->
isEnum
()
||
c
->
isTemplate
(
)
||
c
->
isClass
()
||
c
->
isEnum
()
||
isTemplate
Class
(
c
)
||
c
->
isForwardClassDeclaration
()
||
c
->
isTypenameArgument
()
||
c
->
enclosingEnum
()
!=
0
)
{
unsigned
line
,
column
;
...
...
src/plugins/cppeditor/cppchecksymbols.h
View file @
65a1c129
...
...
@@ -117,6 +117,8 @@ protected:
void
addClassMember
(
const
QList
<
LookupItem
>
&
candidates
,
NameAST
*
ast
);
void
addVirtualMethod
(
const
QList
<
LookupItem
>
&
candidates
,
NameAST
*
ast
,
unsigned
argumentCount
);
bool
isTemplateClass
(
Symbol
*
s
)
const
;
Scope
*
enclosingScope
()
const
;
FunctionDefinitionAST
*
enclosingFunctionDefinition
()
const
;
TemplateDeclarationAST
*
enclosingTemplateDeclaration
()
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