diff options
author | Przemyslaw Gorszkowski <pgorszkowski@gmail.com> | 2013-04-13 08:40:54 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-04-17 14:10:32 +0200 |
commit | 17cd161a9d265db12ba763e090111f0fb27fbab9 (patch) | |
tree | 2250bab97309e0a4e5013e904356d0816e2946cd /src/libs/3rdparty | |
parent | b55961d22583257cf6e4901e71dfc7d8226a515e (diff) |
C++: fix cloning of templates
Fix instantiation of templates(by cloning original symbols). Assigning of scope
for cloned symbol is taken from the symbol which is used to instantiate.
Task-number: QTCREATORBUG-9098
Change-Id: I066cc8b5f69333fabdaf2d4466b205baf08bd3f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/libs/3rdparty')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Symbol.cpp | 7 | ||||
-rw-r--r-- | src/libs/3rdparty/cplusplus/Symbol.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbol.cpp b/src/libs/3rdparty/cplusplus/Symbol.cpp index cd8ec1ffdd7..0510117f8b6 100644 --- a/src/libs/3rdparty/cplusplus/Symbol.cpp +++ b/src/libs/3rdparty/cplusplus/Symbol.cpp @@ -105,7 +105,7 @@ Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const Symbol::Symbol(Clone *clone, Subst *subst, Symbol *original) : _name(clone->name(original->_name, subst)), - _scope(original->_scope), + _scope(0), _next(0), _fileId(clone->control()->stringLiteral(original->fileName(), original->fileNameLength())), _sourceLocation(original->_sourceLocation), @@ -296,6 +296,11 @@ Block *Symbol::enclosingBlock() const return 0; } +Scope *Symbol::scope() const +{ + return _scope; +} + unsigned Symbol::index() const { return _index; } diff --git a/src/libs/3rdparty/cplusplus/Symbol.h b/src/libs/3rdparty/cplusplus/Symbol.h index a995f436312..30cd28797b7 100644 --- a/src/libs/3rdparty/cplusplus/Symbol.h +++ b/src/libs/3rdparty/cplusplus/Symbol.h @@ -290,6 +290,7 @@ public: /// Returns the enclosing Block scope. Block *enclosingBlock() const; + Scope *scope() const; void setScope(Scope *enclosingScope); // ### make me private void resetScope(); // ### make me private void setSourceLocation(unsigned sourceLocation, TranslationUnit *translationUnit); // ### make me private |