diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 21d4782c7d..d065b0bc06 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -970,9 +970,11 @@ sub scanfile { my $bad = $2; my $prefix = $1; my $suff = $3; - checkwarn("BANNEDFUNC", - $line, length($prefix), $file, $ol, - "use of $bad is banned"); + if($prefix !~ /(->|\.)$/) { + checkwarn("BANNEDFUNC", + $line, length($prefix), $file, $ol, + "use of $bad is banned"); + } my $search = quotemeta($prefix . $bad . $suff); my $replace = $prefix . 'x' x (length($bad) + 1); $l =~ s/$search/$replace/; diff --git a/tests/data/test1185 b/tests/data/test1185 index 3f7cd9fb70..a24548c9a0 100644 --- a/tests/data/test1185 +++ b/tests/data/test1185 @@ -88,6 +88,9 @@ void startfunc(int a, int b) { // CPP comment ? + int d = impl->magicbad(1); /* member function always allowed */ + int e = impl.magicbad(); /* member function always allowed */ + /* comment does not end