File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ * ` A15-4-4 ` : remove false positives reported on uninsantiated templates.
Original file line number Diff line number Diff line change 33
33
// The function is defined in this database
34
34
f .hasDefinition ( ) and
35
35
// This function is not an overriden call operator of a lambda expression
36
- not exists ( LambdaExpression lambda | lambda .getLambdaFunction ( ) = f )
37
- select f , "Function " + f .getName ( ) + " could be declared noexcept(true)."
36
+ not exists ( LambdaExpression lambda | lambda .getLambdaFunction ( ) = f ) and
37
+ // Exclude results from uinstantiated templates
38
+ not f .isFromUninstantiatedTemplate ( _)
39
+ select f , "Function " + f .getQualifiedName ( ) + " could be declared noexcept(true)."
Original file line number Diff line number Diff line change @@ -30,4 +30,17 @@ class A {
30
30
void lambda_example () noexcept {
31
31
auto with_capture = [=]() {};
32
32
auto empty_capture = []() {};
33
+ }
34
+
35
+ #include < utility>
36
+ template <typename TypeA, typename TypeB>
37
+ void swap_wrapper (TypeA lhs,
38
+ TypeB rhs) noexcept (noexcept (std::swap(*lhs, *rhs))) {
39
+ std::swap (*lhs, *rhs);
40
+ }
41
+
42
+ void test_swap_wrapper () noexcept {
43
+ int a = 0 ;
44
+ int b = 1 ;
45
+ swap_wrapper (&a, &b);
33
46
}
You can’t perform that action at this time.
0 commit comments