diff --git a/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp b/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp index 86008af19f7..3db47a824ed 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp +++ b/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp @@ -1,4 +1,4 @@ -// semmle-extractor-options: --clang --clang_version 190000 +// semmle-extractor-options: --clang --clang_version 210000 struct S { void f() {} @@ -121,3 +121,11 @@ bool b_is_scoped_enum2 = __is_scoped_enum(int); bool b_is_trivially_relocatable1 = __is_trivially_relocatable(int); bool b_is_trivially_relocatable2 = __is_trivially_relocatable(void); + +struct S3{ + S3(S3 &); + S3& operator=(S3&); +}; + +bool bok_is_bitwise_cloneable1 = __is_bitwise_cloneable(int); +bool bok_is_bitwise_cloneable2 = __is_bitwise_cloneable(S3); diff --git a/cpp/ql/test/library-tests/builtins/type_traits/expr.expected b/cpp/ql/test/library-tests/builtins/type_traits/expr.expected index 55bf0757a49..1728a48f423 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/expr.expected +++ b/cpp/ql/test/library-tests/builtins/type_traits/expr.expected @@ -165,6 +165,10 @@ | clang.cpp:122:36:122:66 | int | | | | clang.cpp:123:36:123:67 | __is_trivially_relocatable | void | 0 | | clang.cpp:123:36:123:67 | void | | | +| clang.cpp:130:34:130:60 | __is_bitwise_cloneable | int | 1 | +| clang.cpp:130:34:130:60 | int | | | +| clang.cpp:131:34:131:59 | S3 | | | +| clang.cpp:131:34:131:59 | __is_bitwise_cloneable | S3 | 0 | | file://:0:0:0:0 | 0 | | 0 | | file://:0:0:0:0 | 0 | | 0 | | file://:0:0:0:0 | 1 | | 1 | @@ -211,6 +215,16 @@ | gcc.cpp:29:45:29:93 | __reference_converts_from_temporary | int &&,int && | 0 | | gcc.cpp:29:45:29:93 | int && | | | | gcc.cpp:29:45:29:93 | int && | | | +| gcc.cpp:33:24:33:45 | __is_invocable | f_type | 1 | +| gcc.cpp:33:24:33:45 | f_type | | | +| gcc.cpp:34:24:34:51 | __is_invocable | f_type,bool | 0 | +| gcc.cpp:34:24:34:51 | bool | | | +| gcc.cpp:34:24:34:51 | f_type | | | +| gcc.cpp:36:32:36:61 | __is_nothrow_invocable | f_type | 1 | +| gcc.cpp:36:32:36:61 | f_type | | | +| gcc.cpp:37:32:37:67 | __is_nothrow_invocable | f_type,bool | 0 | +| gcc.cpp:37:32:37:67 | bool | | | +| gcc.cpp:37:32:37:67 | f_type | | | | ms.cpp:38:41:38:45 | 0 | | 0 | | ms.cpp:88:27:88:45 | __has_assign | empty | 0 | | ms.cpp:88:27:88:45 | empty | | | diff --git a/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp b/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp index 54224343e7e..15f59812d2e 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp +++ b/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp @@ -1,4 +1,4 @@ -// semmle-extractor-options: --gnu_version 130000 +// semmle-extractor-options: --gnu_version 150000 __attribute__ ((aligned(8))) int v; bool b_has_attribute1 = __builtin_has_attribute(v, aligned); @@ -27,3 +27,11 @@ bool b_reference_constructs_from_temporary2 = __reference_constructs_from_tempor bool b_reference_converts_from_temporary1 = __reference_converts_from_temporary(int&&, int); bool b_reference_converts_from_temporary2 = __reference_converts_from_temporary(int&&, int&&); + +using f_type = void(*)() noexcept; + +bool b_is_invocable1 = __is_invocable(f_type); +bool b_is_invocable2 = __is_invocable(f_type, bool); + +bool b_is_nothrow_invocable1 = __is_nothrow_invocable(f_type); +bool b_is_nothrow_invocable2 = __is_nothrow_invocable(f_type, bool);