@@ -20,23 +20,25 @@ import codingstandards.cpp.BannedFunctions
20
20
class BannedCharacterHandlingFunction extends Function {
21
21
BannedCharacterHandlingFunction ( ) {
22
22
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 ( [
31
23
"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"
33
28
] ) 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" )
36
37
}
37
38
}
38
39
39
40
from 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