Skip to content

Commit a9a4613

Browse files
committed
C++: Exclude operator bool from the reserved names
1 parent d18ada0 commit a9a4613

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

cpp/common/src/ext/stdcpp14.generated.names.model.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ extensions:
951951
- [C++14, atomic, std, atomic, exchange, bool, 'bool __i, memory_order __m', external]
952952
- [C++14, atomic, std, atomic, exchange, _Tp, '_Tp __i, memory_order __m', external]
953953
- [C++14, atomic, std, atomic, exchange, __pointer_type, '__pointer_type __p, memory_order __m', external]
954-
- [C++14, atomic, std, atomic, operator bool, bool, '', external]
955954
- [C++14, atomic, std, atomic, fetch_sub, __pointer_type, 'ptrdiff_t __d, memory_order __m', external]
956955
- [C++14, atomic, std, atomic, fetch_add, __pointer_type, 'ptrdiff_t __d, memory_order __m', external]
957956
- [C++14, atomic, std, atomic, compare_exchange_strong, bool, '__pointer_type & __p1, __pointer_type __p2, memory_order __m1, memory_order __m2', external]
@@ -1246,7 +1245,6 @@ extensions:
12461245
- [C++14, exception, std, bad_exception, what, const char *, '', external]
12471246
- [C++14, exception, 'std::__exception_ptr', '', swap, void, 'exception_ptr & __lhs, exception_ptr & __rhs', external]
12481247
- [C++14, exception, 'std::__exception_ptr', exception_ptr, swap, void, exception_ptr & (unnamed parameter 0), external]
1249-
- [C++14, exception, 'std::__exception_ptr', exception_ptr, operator bool, bool, '', external]
12501248
- [C++14, locale, std, '', isblank, bool, '_CharT __c, const locale & __loc', external]
12511249
- [C++14, locale, std, '', toupper, _CharT, '_CharT __c, const locale & __loc', external]
12521250
- [C++14, locale, std, '', tolower, _CharT, '_CharT __c, const locale & __loc', external]
@@ -1552,7 +1550,6 @@ extensions:
15521550
- [C++14, set, std, multiset, key_comp, key_compare, '', external]
15531551
- [C++14, set, std, multiset, value_comp, value_compare, '', external]
15541552
- [C++14, set, std, multiset, emplace_hint, iterator, 'const_iterator __pos, _Args && __args', external]
1555-
- [C++14, bitset, std, reference, operator bool, bool, '', external]
15561553
- [C++14, bitset, std, reference, flip, reference &, '', external]
15571554
- [C++14, bitset, std, bitset, size, size_t, '', external]
15581555
- [C++14, bitset, std, bitset, count, size_t, '', external]
@@ -1591,14 +1588,12 @@ extensions:
15911588
- [C++14, system_error, std, '', make_error_code, error_code, errc __e, external]
15921589
- [C++14, system_error, std, system_error, code, const error_code &, '', external]
15931590
- [C++14, system_error, std, error_code, value, int, '', external]
1594-
- [C++14, system_error, std, error_code, operator bool, bool, '', external]
15951591
- [C++14, system_error, std, error_code, clear, void, '', external]
15961592
- [C++14, system_error, std, error_code, assign, void, 'int __v, const error_category & __cat', external]
15971593
- [C++14, system_error, std, error_code, category, const error_category &, '', external]
15981594
- [C++14, system_error, std, error_code, message, string, '', external]
15991595
- [C++14, system_error, std, error_code, default_error_condition, error_condition, '', external]
16001596
- [C++14, system_error, std, error_condition, value, int, '', external]
1601-
- [C++14, system_error, std, error_condition, operator bool, bool, '', external]
16021597
- [C++14, system_error, std, error_condition, clear, void, '', external]
16031598
- [C++14, system_error, std, error_condition, assign, void, 'int __v, const error_category & __cat', external]
16041599
- [C++14, system_error, std, error_condition, category, const error_category &, '', external]
@@ -1729,7 +1724,6 @@ extensions:
17291724
- [C++14, mutex, std, mutex, native_handle, native_handle_type, '', external]
17301725
- [C++14, mutex, std, mutex, try_lock, bool, '', external]
17311726
- [C++14, mutex, std, unique_lock, swap, void, unique_lock<_Mutex> & __u, external]
1732-
- [C++14, mutex, std, unique_lock, operator bool, bool, '', external]
17331727
- [C++14, mutex, std, unique_lock, unlock, void, '', external]
17341728
- [C++14, mutex, std, unique_lock, lock, void, '', external]
17351729
- [C++14, mutex, std, unique_lock, try_lock, bool, '', external]
@@ -2192,7 +2186,6 @@ extensions:
21922186
- [C++14, vector, std, vector, emplace, iterator, 'const_iterator __pos, _Args && __args', external]
21932187
- [C++14, vector, std, vector, emplace_back, void, _Args && __args, external]
21942188
- [C++14, vector, std, _Bvector_base, get_allocator, allocator_type, '', external]
2195-
- [C++14, vector, std, _Bit_reference, operator bool, bool, '', external]
21962189
- [C++14, vector, std, _Bit_reference, flip, void, '', external]
21972190
- [C++14, queue, std, '', swap, void, 'priority_queue<_Tp, _Sequence, _Compare> & __x, priority_queue<_Tp, _Sequence, _Compare> & __y', external]
21982191
- [C++14, queue, std, '', swap, void, 'queue<_Tp, _Seq> & __x, queue<_Tp, _Seq> & __y', external]
@@ -2721,7 +2714,6 @@ extensions:
27212714
- [C++14, ostream, std, '', flush, 'basic_ostream<_CharT, _Traits> &', 'basic_ostream<_CharT, _Traits> & __os', external]
27222715
- [C++14, ostream, std, '', ends, 'basic_ostream<_CharT, _Traits> &', 'basic_ostream<_CharT, _Traits> & __os', external]
27232716
- [C++14, ostream, std, '', endl, 'basic_ostream<_CharT, _Traits> &', 'basic_ostream<_CharT, _Traits> & __os', external]
2724-
- [C++14, ostream, std, sentry, operator bool, bool, '', external]
27252717
- [C++14, ostream, std, basic_ostream, swap, void, 'basic_ostream<_CharT, _Traits> & __rhs', external]
27262718
- [C++14, ostream, std, basic_ostream, write, __ostream_type &, 'const char_type * __s, streamsize __n', external]
27272719
- [C++14, ostream, std, basic_ostream, put, __ostream_type &, char_type __c, external]
@@ -2730,7 +2722,6 @@ extensions:
27302722
- [C++14, ostream, std, basic_ostream, tellp, pos_type, '', external]
27312723
- [C++14, ostream, std, basic_ostream, flush, __ostream_type &, '', external]
27322724
- [C++14, istream, std, '', ws, 'basic_istream<_CharT, _Traits> &', 'basic_istream<_CharT, _Traits> & __in', external]
2733-
- [C++14, istream, std, sentry, operator bool, bool, '', external]
27342725
- [C++14, istream, std, basic_iostream, swap, void, 'basic_iostream<_CharT, _Traits> & __rhs', external]
27352726
- [C++14, istream, std, basic_istream, swap, void, 'basic_istream<_CharT, _Traits> & __rhs', external]
27362727
- [C++14, istream, std, basic_istream, get, int_type, '', external]
@@ -2844,7 +2835,6 @@ extensions:
28442835
- [C++14, ios, std, basic_ios, fill, char_type, '', external]
28452836
- [C++14, ios, std, basic_ios, fill, char_type, char_type __ch, external]
28462837
- [C++14, ios, std, basic_ios, setstate, void, iostate __state, external]
2847-
- [C++14, ios, std, basic_ios, operator bool, bool, '', external]
28482838
- [C++14, ios, std, basic_ios, clear, void, iostate __state, external]
28492839
- [C++14, ios, std, basic_ios, eof, bool, '', external]
28502840
- [C++14, ios, std, basic_ios, imbue, locale, const locale & __loc, external]
@@ -3343,7 +3333,6 @@ extensions:
33433333
- [C++14, functional, std, reference_wrapper, get, _Tp &, '', external]
33443334
- [C++14, functional, std, reference_wrapper, operator _Tp &, _Tp &, '', external]
33453335
- [C++14, functional, std, function, swap, void, function<..(..)> & __x, external]
3346-
- [C++14, functional, std, function, operator bool, bool, '', external]
33473336
- [C++14, functional, std, function, target, const _Functor *, '', external]
33483337
- [C++14, functional, std, function, target, _Functor *, '', external]
33493338
- [C++14, functional, std, function, target_type, const type_info &, '', external]
@@ -3379,7 +3368,6 @@ extensions:
33793368
- [C++14, scoped_allocator, std, scoped_allocator_adaptor, inner_allocator, inner_allocator_type &, '', external]
33803369
- [C++14, shared_mutex, std, '', swap, void, 'shared_lock<_Mutex> & __x, shared_lock<_Mutex> & __y', external]
33813370
- [C++14, shared_mutex, std, shared_lock, swap, void, shared_lock<_Mutex> & __u, external]
3382-
- [C++14, shared_mutex, std, shared_lock, operator bool, bool, '', external]
33833371
- [C++14, shared_mutex, std, shared_lock, unlock, void, '', external]
33843372
- [C++14, shared_mutex, std, shared_lock, lock, void, '', external]
33853373
- [C++14, shared_mutex, std, shared_lock, try_lock, bool, '', external]
@@ -3843,7 +3831,6 @@ extensions:
38433831
- [C++14, memory, std, unique_ptr, swap, void, 'unique_ptr<_Tp[], _Dp> & __u', external]
38443832
- [C++14, memory, std, unique_ptr, swap, void, 'unique_ptr<_Tp, _Dp> & __u', external]
38453833
- [C++14, memory, std, unique_ptr, get, pointer, '', external]
3846-
- [C++14, memory, std, unique_ptr, operator bool, bool, '', external]
38473834
- [C++14, memory, std, unique_ptr, reset, void, nullptr_t (unnamed parameter 0), external]
38483835
- [C++14, memory, std, unique_ptr, reset, void, pointer __p, external]
38493836
- [C++14, memory, std, unique_ptr, reset, void, _Up __p, external]
@@ -3866,7 +3853,6 @@ extensions:
38663853
- [C++14, memory, std, __shared_ptr, swap, void, '__shared_ptr<_Tp, _Lp> & __other', external]
38673854
- [C++14, memory, std, __shared_ptr, get, element_type *, '', external]
38683855
- [C++14, memory, std, __shared_ptr, unique, bool, '', external]
3869-
- [C++14, memory, std, __shared_ptr, operator bool, bool, '', external]
38703856
- [C++14, memory, std, __shared_ptr, reset, void, '', external]
38713857
- [C++14, memory, std, __shared_ptr, reset, _SafeConv, _Yp * __p, external]
38723858
- [C++14, memory, std, __shared_ptr, reset, _SafeConv, '_Yp * __p, _Deleter __d, _Alloc __a', external]

scripts/generate_standard_library_models/cpp/queries/libraryFunctionModel.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ where
99
not f.isCompilerGenerated() and
1010
// exclude user defined operators
1111
not f instanceof Operator and
12+
// exclude "operator bool", which doesn't seem to be considered as an Operator
13+
not f.getName() = "operator bool" and
1214
not f.isFromTemplateInstantiation(_) and
1315
not f instanceof Constructor and
1416
not f instanceof Destructor and

0 commit comments

Comments
 (0)