aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expression.h
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-03-21 20:55:33 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:01:29 -0700
commitabae88c8e3ae1a4493805bd8b471bb77f472fd37 (patch)
tree4d5de714bf87dcd2b4ed273b6d8247d1a37a99dc /expression.h
parent98b73504f18aff42a673943f61ad62e05e1f8342 (diff)
downloadsparse-dev-abae88c8e3ae1a4493805bd8b471bb77f472fd37.tar.gz
Use the "look up multiple namespaces" facility
to look up types. This makes up get the proper nesting characteristics in case you mix typedefs and regular symbols with the same name.
Diffstat (limited to 'expression.h')
-rw-r--r--expression.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/expression.h b/expression.h
index 935d23ac..8516ff82 100644
--- a/expression.h
+++ b/expression.h
@@ -151,8 +151,10 @@ struct token *typename(struct token *, struct symbol **);
static inline int lookup_type(struct token *token)
{
- if (token->pos.type == TOKEN_IDENT)
- return lookup_symbol(token->ident, NS_TYPEDEF) != NULL;
+ if (token->pos.type == TOKEN_IDENT) {
+ struct symbol *sym = lookup_symbol(token->ident, NS_SYMBOL | NS_TYPEDEF);
+ return sym && sym->namespace == NS_TYPEDEF;
+ }
return 0;
}