forked from qt-creator/qt-creator
C++11: Make 'enum struct', enum-base and opaque enum decls work.
For declarations like: enum struct Foo : long int; Change-Id: Id813efdbc31c8d70a4b40bb0101dc33a8dd2556a Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
14
src/libs/3rdparty/cplusplus/AST.cpp
vendored
14
src/libs/3rdparty/cplusplus/AST.cpp
vendored
@@ -1077,9 +1077,16 @@ unsigned EnumSpecifierAST::firstToken() const
|
||||
{
|
||||
if (enum_token)
|
||||
return enum_token;
|
||||
if (key_token)
|
||||
return key_token;
|
||||
if (name)
|
||||
if (unsigned candidate = name->firstToken())
|
||||
return candidate;
|
||||
if (colon_token)
|
||||
return colon_token;
|
||||
if (type_specifier_list)
|
||||
if (unsigned candidate = type_specifier_list->firstToken())
|
||||
return candidate;
|
||||
if (lbrace_token)
|
||||
return lbrace_token;
|
||||
if (enumerator_list)
|
||||
@@ -1104,9 +1111,16 @@ unsigned EnumSpecifierAST::lastToken() const
|
||||
return candidate;
|
||||
if (lbrace_token)
|
||||
return lbrace_token + 1;
|
||||
if (type_specifier_list)
|
||||
if (unsigned candidate = type_specifier_list->lastToken())
|
||||
return candidate;
|
||||
if (colon_token)
|
||||
return colon_token + 1;
|
||||
if (name)
|
||||
if (unsigned candidate = name->lastToken())
|
||||
return candidate;
|
||||
if (key_token)
|
||||
return key_token + 1;
|
||||
if (enum_token)
|
||||
return enum_token + 1;
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user