@@ -1986,7 +1986,13 @@ static boolean skipPostArgumentStuff (
1986
1986
break ;
1987
1987
1988
1988
default :
1989
- if (isType (token , TOKEN_NONE ))
1989
+ /* "override" and "final" are only keywords in the declaration of a virtual
1990
+ * member function, so need to be handled specially, not as keywords */
1991
+ if (isLanguage (Lang_cpp ) && isType (token , TOKEN_NAME ) &&
1992
+ (strcmp ("override" , vStringValue (token -> name )) == 0 ||
1993
+ strcmp ("final" , vStringValue (token -> name )) == 0 ))
1994
+ ;
1995
+ else if (isType (token , TOKEN_NONE ))
1990
1996
;
1991
1997
else if (info -> isKnrParamList && info -> parameterCount > 0 )
1992
1998
++ elementCount ;
@@ -2839,8 +2845,20 @@ static void tagCheck (statementInfo *const st)
2839
2845
st -> declaration == DECL_NAMESPACE ||
2840
2846
st -> declaration == DECL_PROGRAM )
2841
2847
{
2842
- if (isType (prev , TOKEN_NAME ))
2848
+ tokenInfo * name_token = (tokenInfo * )prev ;
2849
+
2850
+ /* C++ 11 allows class <name> final { ... } */
2851
+ if (isLanguage (Lang_cpp ) && isType (prev , TOKEN_NAME ) &&
2852
+ strcmp ("final" , vStringValue (prev -> name )) == 0 &&
2853
+ isType (prev2 , TOKEN_NAME ))
2854
+ {
2855
+ name_token = (tokenInfo * )prev2 ;
2856
+ copyToken (st -> blockName , name_token );
2857
+ }
2858
+ else if (isType (name_token , TOKEN_NAME ))
2859
+ {
2843
2860
copyToken (st -> blockName , prev );
2861
+ }
2844
2862
else
2845
2863
{
2846
2864
/* For an anonymous struct or union we use a unique ID
0 commit comments