forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Roberto Raggi
parent
0651e28d04
commit
c6fc0be8ae
3
src/libs/3rdparty/cplusplus/Symbols.h
vendored
3
src/libs/3rdparty/cplusplus/Symbols.h
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user