Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A15-4-4: Support deviation on the function declaration #816

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 @@ -21,7 +21,7 @@ import codingstandards.cpp.exceptions.ExceptionFlow

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
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