Skip to content

Commit fcb870c

Browse files
Merge remote-tracking branch 'origin/main' into michaelrfairhurst/implement-concurrency7-package
2 parents a739041 + 7f7ce3d commit fcb870c

6 files changed

+30
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `M5-3-1` - `EachOperandOfTheOperatorOfTheLogicalAndOrTheLogicalOperatorsShallHaveTypeBool.ql`:
2+
- Consistently exclude results in unevaluated contexts associated with uninstantiated templates, for example `noexcept` specifiers and `static_assert`s.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `A2-7-3` - `UndocumentedUserDefinedType.ql`
2+
- Fixes #718. Include trailing characters after group comment endings with ///@{ ... ///@}.

cpp/autosar/src/rules/A2-7-3/UndocumentedUserDefinedType.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private predicate isInFunctionScope(Declaration d) {
2828
private string doxygenCommentGroupStrings(boolean opening) {
2929
opening = true and result = ["///@{", "/**@{*/"]
3030
or
31-
opening = false and result = ["///@}", "/**@}*/"]
31+
opening = false and result = ["///@}%", "/**@}*/"]
3232
}
3333

3434
pragma[inline]

cpp/autosar/src/rules/M5-3-1/EachOperandOfTheOperatorTheLogicalAndOrTheLogicalOperatorsShallHaveTypeBool.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ where
2525
) and
2626
t = operand.getType() and
2727
not t.getUnderlyingType().getUnspecifiedType() instanceof BoolType and
28+
// Ignore cases where the type is unknown - this will typically be in unevaluated contexts
29+
// within uninstantiated templates. It's necessary to check for this explicitly because
30+
// not all unevaluated contexts are considered to be `isFromUninstantiatedTemplate(_)`,
31+
// e.g. `noexcept` specifiers
32+
not t instanceof UnknownType and
2833
not exists(ReferenceType rt |
2934
rt = t.getUnderlyingType().getUnspecifiedType() and rt.getBaseType() instanceof BoolType
3035
) and

cpp/autosar/test/rules/A2-7-3/test.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,14 @@ class ClassG2 { // COMPLIANT
225225
class ClassG3 { // COMPLIANT
226226
public:
227227
friend int foo3() { return 1; } // NON_COMPLIANT
228+
};
229+
230+
/// @brief A Doxygen comment.
231+
class ClassH { // COMPLIANT
232+
public:
233+
/// @brief Group with comment at the end.
234+
///@{
235+
void m(); // COMPLIANT
236+
void n(); // COMPLIANT
237+
///@} End of group
228238
};

cpp/autosar/test/rules/M5-3-1/test.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@ template <typename T = int> class A {
2525
void f() {
2626
A<int> a;
2727
a.test1();
28-
}
28+
}
29+
30+
template <typename T> constexpr bool some_variable_template_v = false;
31+
template <> constexpr bool some_variable_template_v<int> = true;
32+
33+
template <typename S>
34+
void template_with_no_except() noexcept(some_variable_template_v<S> &&
35+
true) { // COMPLIANT
36+
}
37+
void test_template() { template_with_no_except<int>(); }

0 commit comments

Comments
 (0)