From 8646e95b6f91942e7741830dc057daa0e9a40aed Mon Sep 17 00:00:00 2001 From: tycho Date: Wed, 11 Mar 2015 10:39:49 +0000 Subject: Fixed style and removed false positives Relaxed the rules for < followed by an && and removed rule for < following an && --- src/CheckBasicStyle.lua | 6 +++--- src/Generating/IntGen.h | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/CheckBasicStyle.lua b/src/CheckBasicStyle.lua index 648a5711b..16e34e321 100644 --- a/src/CheckBasicStyle.lua +++ b/src/CheckBasicStyle.lua @@ -101,9 +101,9 @@ local g_ViolationPatterns = {"&&[^(]+!=", "Add parenthesis around comparison"}, {"!=[^)]+||", "Add parenthesis around comparison"}, {"||[^(]+!=", "Add parenthesis around comparison"}, - {"<[^)T][^)]*&&", "Add parenthesis around comparison"}, -- Must take special care of templates: "template fn(Args && ...)" - {"&&[^(]+<", "Add parenthesis around comparison"}, - {"<[^)T][^)]*||", "Add parenthesis around comparison"}, -- Must take special care of templates: "template fn(Args && ...)" + {"<[^)>]*&&", "Add parenthesis around comparison"}, -- Must take special care of templates: "template fn(Args && ...)" + -- Cannot check a < following a && due to functions of the form x fn(y&& a, z c) + {"<[^)>]*||", "Add parenthesis around comparison"}, -- Must take special care of templates: "template fn(Args && ...)" {"||[^(]+<", "Add parenthesis around comparison"}, -- Cannot check ">" because of "obj->m_Flag &&". Check at least ">=": {">=[^)]+&&", "Add parenthesis around comparison"}, diff --git a/src/Generating/IntGen.h b/src/Generating/IntGen.h index 1ffc15c6b..fac500fa8 100644 --- a/src/Generating/IntGen.h +++ b/src/Generating/IntGen.h @@ -73,14 +73,19 @@ public: // Code adapted from http://stackoverflow.com/questions/7858817/unpacking-a-tuple-to-call-a-matching-function-pointer template -struct seq { }; +struct seq +{ +}; template -struct gens : gens { }; +struct gens : gens +{ +}; template -struct gens<0, S...> { - typedef seq type; +struct gens<0, S...> +{ + typedef seq type; }; -- cgit v1.2.3