@@ -20,23 +20,25 @@ import codingstandards.cpp.BannedFunctions
2020class BannedCharacterHandlingFunction extends Function {
2121 BannedCharacterHandlingFunction ( ) {
2222 this .hasGlobalOrStdName ( [
23- "isalnum" , "isalpha" , "isblank" , "iscntrl" , "isdigit" , "isgraph" , "islower" , "isprint" ,
24- "ispunct" , "isspace" , "isupper" , "isxdigit" , "tolower" , "toupper" ,
25- "iswalnum" , "iswalpha" , "iswblank" , "iswcntrl" , "iswctype" , "iswdigit" , "iswgraph" ,
26- "iswlower" , "iswprint" , "iswpunct" , "iswspace" , "iswupper" , "iswxdigit" , "towctrans" ,
27- "towlower" , "towupper" , "wctrans" , "wctype"
28- ] ) and
29- not (
30- this .hasGlobalOrStdName ( [
3123 "isalnum" , "isalpha" , "isblank" , "iscntrl" , "isdigit" , "isgraph" , "islower" , "isprint" ,
32- "ispunct" , "isspace" , "isupper" , "isxdigit" , "tolower" , "toupper"
24+ "ispunct" , "isspace" , "isupper" , "isxdigit" , "tolower" , "toupper" , "iswalnum" , "iswalpha" ,
25+ "iswblank" , "iswcntrl" , "iswctype" , "iswdigit" , "iswgraph" , "iswlower" , "iswprint" ,
26+ "iswpunct" , "iswspace" , "iswupper" , "iswxdigit" , "towctrans" , "towlower" , "towupper" ,
27+ "wctrans" , "wctype"
3328 ] ) and
34- this .getACallToThisFunction ( ) .( FunctionCall ) .getNumberOfArguments ( ) = 2
35- )
29+ // Exclude the functions which pass a reference to a std::locale as the second parameter
30+ not this .getParameter ( 1 )
31+ .getType ( )
32+ .getUnspecifiedType ( )
33+ .( ReferenceType )
34+ .getBaseType ( )
35+ .( UserType )
36+ .hasQualifiedName ( "std" , "locale" )
3637 }
3738}
3839
3940from BannedFunctions< BannedCharacterHandlingFunction > :: Use use
40- where
41- not isExcluded ( use , BannedAPIsPackage:: characterHandlingFunctionRestrictionsQuery ( ) )
42- select use , use .getAction ( ) + " banned character handling function '" + use .getFunctionName ( ) + "' from <cctype> or <cwctype>."
41+ where not isExcluded ( use , BannedAPIsPackage:: characterHandlingFunctionRestrictionsQuery ( ) )
42+ select use ,
43+ use .getAction ( ) + " banned character handling function '" + use .getFunctionName ( ) +
44+ "' from <cctype> or <cwctype>."
0 commit comments