Commit 8744dab3 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed fistToken/lastToken for BaseSpecifierAST.

parent 658a2276
...@@ -360,6 +360,10 @@ unsigned BaseSpecifierAST::firstToken() const ...@@ -360,6 +360,10 @@ unsigned BaseSpecifierAST::firstToken() const
{ {
if (virtual_token && access_specifier_token) if (virtual_token && access_specifier_token)
return std::min(virtual_token, access_specifier_token); return std::min(virtual_token, access_specifier_token);
if (virtual_token)
return virtual_token;
if (access_specifier_token)
return access_specifier_token;
return name->firstToken(); return name->firstToken();
} }
...@@ -368,7 +372,7 @@ unsigned BaseSpecifierAST::lastToken() const ...@@ -368,7 +372,7 @@ unsigned BaseSpecifierAST::lastToken() const
if (name) if (name)
return name->lastToken(); return name->lastToken();
else if (virtual_token && access_specifier_token) else if (virtual_token && access_specifier_token)
return std::min(virtual_token, access_specifier_token) + 1; return std::max(virtual_token, access_specifier_token) + 1;
else if (virtual_token) else if (virtual_token)
return virtual_token + 1; return virtual_token + 1;
else if (access_specifier_token) else if (access_specifier_token)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment