diff options
| author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-06-18 14:21:28 +0200 |
|---|---|---|
| committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-06-18 14:22:06 +0200 |
| commit | 9a8e724f15a8a323299130e90c867f835cbf8ff8 (patch) | |
| tree | 546dc855c8246d15074c9503a24303456bcf91d7 /src/plugins/cpptools/cppmodelmanager.cpp | |
| parent | 44aa96fcf5f7f9ff88d8eeaba0d64e3d7e228b6f (diff) | |
| download | qt-creator-9a8e724f15a8a323299130e90c867f835cbf8ff8.tar.gz | |
Don't search for undefined symbols in ambiguous typeof expressions.
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
| -rw-r--r-- | src/plugins/cpptools/cppmodelmanager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index b1ed719a36..cf7403953f 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -552,6 +552,24 @@ protected: return true; } + virtual bool visit(SizeofExpressionAST *ast) + { + if (ast->lparen_token && ast->expression && ast->rparen_token) { + if (TypeIdAST *type_id = ast->expression->asTypeId()) { + SpecifierAST *type_specifier = type_id->type_specifier; + if (! type_id->declarator && type_specifier && ! type_specifier->next && + type_specifier->asNamedTypeSpecifier()) { + // this sizeof expression is ambiguos, e.g. + // sizeof (a) + // `a' can be a typeid or a nested-expression. + return false; + } + } + } + + return true; + } + LookupContext lookupContext(unsigned line, unsigned column) const; private: |
