Kaydet (Commit) 6f1c2025 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Caolán McNamara

tools: re-order members of SvRefBase to work around clang 3.5 bug

http://fpaste.org/285206/ has minimized reproducer

Change-Id: I898dfe0c3246a4ee2b093559530db5446d31e8bc
Reviewed-on: https://gerrit.libreoffice.org/19692Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6917797c
......@@ -92,21 +92,19 @@ protected:
/** Classes that want to be referenced-counted via SvRef<T>, should extend this base class */
class TOOLS_DLLPUBLIC SvRefBase
{
// work around a clang 3.5 optimization bug: if the bNoDelete is *first*
// it mis-compiles "if (--nRefCount == 0)" and never deletes any object
unsigned int nRefCount : 31;
// the only reason this is not bool is because MSVC cannot handle mixed type bitfields
#if defined(__AFL_HAVE_MANUAL_INIT)
bool bNoDelete;
#else
unsigned int bNoDelete : 1;
#endif
unsigned int nRefCount : 31;
protected:
virtual ~SvRefBase();
public:
SvRefBase() : bNoDelete(1), nRefCount(0) {}
SvRefBase() : nRefCount(0), bNoDelete(1) {}
SvRefBase( const SvRefBase & /* rObj */ ) : bNoDelete(1), nRefCount(0) {}
SvRefBase(const SvRefBase &) : nRefCount(0), bNoDelete(1) {}
SvRefBase & operator = ( const SvRefBase & )
{ return *this; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment