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
2 changes: 2 additions & 0 deletions change_notes/2024-12-10-a15-4-4-deviations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `A15-4-4` - `MissingNoExcept.ql`:
- Enable deviations on either declarations or definitions.
2 changes: 1 addition & 1 deletion cpp/autosar/src/rules/A15-4-4/MissingNoExcept.ql
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ predicate mayCallThrowingFunctions(Function f) {

from Function f
where
not isExcluded(f, Exceptions1Package::missingNoExceptQuery()) and
not isExcluded(f.getADeclarationEntry(), Exceptions1Package::missingNoExceptQuery()) and
// No thrown exceptions
not exists(getAFunctionThrownType(f, _)) and
// But not marked noexcept(true)
Expand Down
11 changes: 11 additions & 0 deletions cpp/autosar/test/rules/A15-4-4/coding-standards.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<codingstandards>
<!--GENERATED: DO NOT MODIFY. Changes should be made to coding-standards.yml instead.-->
<deviations>
<deviations-entry>
<rule-id>A15-4-4</rule-id>
<justification>Suppress entry.</justification>
<code-identifier>a-15-4-4-deviation</code-identifier>
</deviations-entry>
</deviations>
</codingstandards>
10 changes: 9 additions & 1 deletion cpp/autosar/test/rules/A15-4-4/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@ std::string test_fp_reported_in_424(
s3.append(s1.c_str(), s1.size());
s3.append(s2.c_str(), s2.size());
return s3;
}
}

void test_no_except_deviated_decl(); // a-15-4-4-deviation

void test_no_except_deviated_decl() {}

void test_no_except_deviated_defn();

void test_no_except_deviated_defn() {} // a-15-4-4-deviation
Loading