Fixed #8441 (MISRA Addon: FP 12.3 issued for initializer lists)
This commit is contained in:
parent
7699f6432b
commit
480d84d69c
|
@ -621,9 +621,9 @@ def misra_12_2(data):
|
||||||
|
|
||||||
def misra_12_3(data):
|
def misra_12_3(data):
|
||||||
for token in data.tokenlist:
|
for token in data.tokenlist:
|
||||||
if token.str != ',' or token.scope.type == 'Enum':
|
if token.str != ',' or token.scope.type == 'Enum' or token.scope.type == 'Class' or token.scope.type == 'Global':
|
||||||
continue
|
continue
|
||||||
if token.astParent and token.astParent.str in {'(', ',', '{'}:
|
if token.astParent and token.astParent.str in ['(', ',', '{']:
|
||||||
continue
|
continue
|
||||||
reportError(token, 12, 3)
|
reportError(token, 12, 3)
|
||||||
|
|
||||||
|
@ -1072,6 +1072,7 @@ def loadRuleTexts(filename):
|
||||||
num2 = 0
|
num2 = 0
|
||||||
appendixA = False
|
appendixA = False
|
||||||
ruleText = False
|
ruleText = False
|
||||||
|
global ruleTexts
|
||||||
for line in open(filename, 'rt'):
|
for line in open(filename, 'rt'):
|
||||||
line = line.replace('\r', '').replace('\n', '')
|
line = line.replace('\r', '').replace('\n', '')
|
||||||
if len(line) == 0:
|
if len(line) == 0:
|
||||||
|
@ -1098,11 +1099,9 @@ def loadRuleTexts(filename):
|
||||||
if ruleText:
|
if ruleText:
|
||||||
num2 = num2 + 1
|
num2 = num2 + 1
|
||||||
num = num1 * 100 + num2
|
num = num1 * 100 + num2
|
||||||
global ruleTexts
|
|
||||||
ruleTexts[num] = line
|
ruleTexts[num] = line
|
||||||
ruleText = True
|
ruleText = True
|
||||||
elif ruleText and re.match(r'^[a-z].*', line):
|
elif ruleText and re.match(r'^[a-z].*', line):
|
||||||
global ruleTexts
|
|
||||||
num = num1 * 100 + num2
|
num = num1 * 100 + num2
|
||||||
ruleTexts[num] = ruleTexts[num] + ' ' + line
|
ruleTexts[num] = ruleTexts[num] + ' ' + line
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
// #8441
|
||||||
|
class C {
|
||||||
|
int a;
|
||||||
|
int b;
|
||||||
|
C() : a(1), b(1) { c; }
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue