Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void test_nullptr() {
int l3 = 0; // COMPLIANT - use of 0 literal with no conversion to pointer
f3(f1, nullptr); // COMPLIANT - use of nullptr
f1(NULL); // NON_COMPLIANT - use of NULL macro
// f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by clang or by CodeQL when mimicking clang
f3("0"); // COMPLIANT - "0" is not a literal zero
// f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by
// clang or by CodeQL when mimicking clang
f3("0"); // COMPLIANT - "0" is not a literal zero
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
| templates.cpp:42:12:42:13 | A1 | Type 'A1' with limited visibility is not used. |

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, targets next branch.

| templates.cpp:93:11:93:12 | A1 | Type 'A1' with limited visibility is not used. |
| test.cpp:5:9:5:10 | T1 | Type 'T1' with limited visibility is not used. |
| test.cpp:31:8:31:9 | A2 | Type 'A2' with limited visibility is not used. |
| test.cpp:61:28:61:29 | C1<<unnamed>> | Type 'C1<<unnamed>>' with limited visibility is not used. |
Expand Down
2 changes: 1 addition & 1 deletion cpp/misra/test/rules/RULE-0-2-3/templates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace use_as_template_parameter_type {
* parameter
*/
namespace use_as_template_parameter_default_value {
class A1 { // COMPLIANT[False positive]
class A1 { // COMPLIANT
static const int a = 42;
};

Expand Down
11 changes: 6 additions & 5 deletions cpp/misra/test/rules/RULE-7-0-6/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,12 @@ void test_template_functions() {

// Test initialization forms
std::int32_t f12(std::int8_t l1) {
std::int16_t l2 = l1; // COMPLIANT
std::int16_t l3{l1}; // COMPLIANT
std::int16_t l4(l1); // COMPLIANT
// std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by CodeQL when mimicking clang
return l1; // COMPLIANT
std::int16_t l2 = l1; // COMPLIANT
std::int16_t l3{l1}; // COMPLIANT
std::int16_t l4(l1); // COMPLIANT
// std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by
// CodeQL when mimicking clang
return l1; // COMPLIANT
}

std::int32_t test_return() {
Expand Down
Loading