Skip to content

Commit 632e9df

Browse files
committed
DeadCode: Add failing test case for static_asserts
static_assert generates a DeclStmt which is considered dead.
1 parent cc527b1 commit 632e9df

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cpp/autosar/test/rules/M0-1-9/test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,7 @@ int test_dead_code(int x) {
7676
} catch (...) { // NON_COMPLIANT
7777
}
7878

79+
static_assert(1); // COMPLIANT
80+
7981
return live5 + live6; // COMPLIANT
8082
}

0 commit comments

Comments
 (0)