File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 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 3333 // The function is defined in this database
3434 f .hasDefinition ( ) and
3535 // 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 {
3030void lambda_example () noexcept {
3131 auto with_capture = [=]() {};
3232 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);
3346}
You can’t perform that action at this time.
0 commit comments