Eliminate 'constructor with 1 argument is not explicit' cppcheck warning
authorIvan Maidanski <ivmai@mail.ru>
Wed, 14 Sep 2016 22:03:15 +0000 (01:03 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 14 Sep 2016 22:04:49 +0000 (01:04 +0300)
commit569fd66c4a7165499ed45f4881693f6657c55312
treec4dc6f108ac3b225458fac6d3dab52905d97c3a9
parent3c577f4e6a48549e616d879a1b39bcd2d8e14261
Eliminate 'constructor with 1 argument is not explicit' cppcheck warning

Note that -D CPPCHECK should be passed to cppcheck to activate
this workaround.

* include/gc_allocator.h (GC_ATTR_EXPLICIT): New macro (defined to
"explicit" keyword if at least C++11 or CPPCHECK, otherwise to empty).
* include/gc_allocator.h (gc_allocator::gc_allocator,
gc_allocator_ignore_off_page::gc_allocator_ignore_off_page,
traceable_allocator::traceable_allocator): Use GC_ATTR_EXPLICIT.
* tests/test_cpp.cc (A::A, B::B, C::C, D::D): Likewise.
* tests/test_cpp.cc (GC_ATTR_EXPLICIT): Define macro (as empty) unless
already defined in included gc_allocator.h.
include/gc_allocator.h
tests/test_cpp.cc