don't interpret C++ templates with indirection/pointer/reference operators as operators
[ardour.git] / tools / cstyle.py
index bad8309daea4ff8c7f2db3718d7dc7fbce81a142..314d7746ae36fc458169e563cd5a7bc37fbc1cf4 100755 (executable)
@@ -210,7 +210,8 @@ class CStyleChecker:
                                self.error (msg)
 
                if re.search ("[a-zA-Z0-9][<>!=^/&\|]{1,2}[a-zA-Z0-9]", line):
-                       if not re.search (".*#include.*[a-zA-Z0-9]/[a-zA-Z]", line):
+                        # ignore #include <foo.h> and C++ templates with indirection/pointer/reference operators
+                       if not re.search (".*#include.*[a-zA-Z0-9]/[a-zA-Z]", line) and not re.search ("[a-zA-Z0-9_]>[&\*]", line):
                                self.error ("missing space around operator")
 
                self.last_line_indent = indent