forked from qt-creator/qt-creator
C++11: Parse alias declarations.
The parser no longer fails declarations like: using Foo = std::vector<int>::iterator; Change-Id: Ib3a552ebbe0147fa138db6448a52cdba8f9b9207 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
34
src/libs/3rdparty/cplusplus/AST.cpp
vendored
34
src/libs/3rdparty/cplusplus/AST.cpp
vendored
@@ -4431,3 +4431,37 @@ unsigned AlignofExpressionAST::lastToken() const
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** \generated */
|
||||
unsigned AliasDeclarationAST::firstToken() const
|
||||
{
|
||||
if (using_token)
|
||||
return using_token;
|
||||
if (identifier_token)
|
||||
return identifier_token;
|
||||
if (equal_token)
|
||||
return equal_token;
|
||||
if (typeId)
|
||||
if (unsigned candidate = typeId->firstToken())
|
||||
return candidate;
|
||||
if (semicolon_token)
|
||||
return semicolon_token;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** \generated */
|
||||
unsigned AliasDeclarationAST::lastToken() const
|
||||
{
|
||||
if (semicolon_token)
|
||||
return semicolon_token + 1;
|
||||
if (typeId)
|
||||
if (unsigned candidate = typeId->lastToken())
|
||||
return candidate;
|
||||
if (equal_token)
|
||||
return equal_token + 1;
|
||||
if (identifier_token)
|
||||
return identifier_token + 1;
|
||||
if (using_token)
|
||||
return using_token + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user