diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index 8a9c201dc5d1be492b55da70e59f949fb0145df7..6ab5c9b92ec048f91e18340b753a05a083ffe101 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -1178,7 +1178,7 @@ unsigned DeclaratorListAST::lastToken() const
 {
     for (const DeclaratorListAST *it = this; it; it = it->next) {
         if (! it->next)
-            return it->lastToken();
+            return it->declarator->lastToken();
     }
     return 0;
 }