diff options
author | Flex Ferrum <flexferrum@gmail.com> | 2012-01-28 22:58:08 +0400 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2012-01-31 10:03:36 +0100 |
commit | c6fc0be8ae15e43abb765323d7edaf7741405878 (patch) | |
tree | 28be4293dd50e455c4507f3f9646e4db91f0aca5 /src/libs/3rdparty/cplusplus/Symbols.h | |
parent | 0651e28d04933647740b92322fe8f7f279cb6954 (diff) |
C++: Type deduction for auto-declared variables implemented
Handled to major cases of 'auto' variable declaration:
1. auto var = someInitializer;
2. Q_FOREACH(auto item, collection) or foreach(auto item, collection)
In first case type deducted directly from initializer. If variable has no initializer then corresponded error reported. In second case type deducted from '*collection.begin()' expression.
Change-Id: Ie930add1648b99440281ae04d973fd6904bc9e46
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Symbols.h')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Symbols.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbols.h b/src/libs/3rdparty/cplusplus/Symbols.h index 9de640ff2a..ec65e926f7 100644 --- a/src/libs/3rdparty/cplusplus/Symbols.h +++ b/src/libs/3rdparty/cplusplus/Symbols.h @@ -104,9 +104,11 @@ public: virtual ~Declaration(); void setType(const FullySpecifiedType &type); + void setInitializer(StringLiteral const* initializer); // Symbol's interface virtual FullySpecifiedType type() const; + const StringLiteral *getInitializer() const; virtual const Declaration *asDeclaration() const { return this; } @@ -125,6 +127,7 @@ protected: private: FullySpecifiedType _type; + const StringLiteral *_initializer; }; class CPLUSPLUS_EXPORT EnumeratorDeclaration: public Declaration |