forked from qt-creator/qt-creator
C++: Store template typename argument declarator type
Differentiate class from typename. Used by a follow-up commit for pretty printing, preserving the original declarator. Change-Id: I496505f5062abb69d5552e5422db256d49d164c4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
e920921f27
commit
e919746808
2
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
2
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -2388,9 +2388,11 @@ bool Bind::visit(TypenameTypeParameterAST *ast)
|
||||
// unsigned dot_dot_dot_token = ast->dot_dot_dot_token;
|
||||
const Name *name = this->name(ast->name);
|
||||
ExpressionTy type_id = this->expression(ast->type_id);
|
||||
CPlusPlus::Kind classKey = translationUnit()->tokenKind(ast->classkey_token);
|
||||
|
||||
TypenameArgument *arg = control()->newTypenameArgument(sourceLocation, name);
|
||||
arg->setType(type_id);
|
||||
arg->setClassDeclarator(classKey == T_CLASS);
|
||||
ast->symbol = arg;
|
||||
_scope->addMember(arg);
|
||||
return false;
|
||||
|
||||
2
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
2
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
@@ -171,11 +171,13 @@ void Argument::visitSymbol0(SymbolVisitor *visitor)
|
||||
|
||||
TypenameArgument::TypenameArgument(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name)
|
||||
: Symbol(translationUnit, sourceLocation, name)
|
||||
, _isClassDeclarator(false)
|
||||
{ }
|
||||
|
||||
TypenameArgument::TypenameArgument(Clone *clone, Subst *subst, TypenameArgument *original)
|
||||
: Symbol(clone, subst, original)
|
||||
, _type(clone->type(original->_type, subst))
|
||||
, _isClassDeclarator(original->_isClassDeclarator)
|
||||
{ }
|
||||
|
||||
TypenameArgument::~TypenameArgument()
|
||||
|
||||
3
src/libs/3rdparty/cplusplus/Symbols.h
vendored
3
src/libs/3rdparty/cplusplus/Symbols.h
vendored
@@ -187,6 +187,8 @@ public:
|
||||
virtual ~TypenameArgument();
|
||||
|
||||
void setType(const FullySpecifiedType &type);
|
||||
void setClassDeclarator(bool isClassDecl) { _isClassDeclarator = isClassDecl; }
|
||||
bool isClassDeclarator() const { return _isClassDeclarator; }
|
||||
|
||||
// Symbol's interface
|
||||
virtual FullySpecifiedType type() const;
|
||||
@@ -202,6 +204,7 @@ protected:
|
||||
|
||||
private:
|
||||
FullySpecifiedType _type;
|
||||
bool _isClassDeclarator;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT Block: public Scope
|
||||
|
||||
Reference in New Issue
Block a user