Q(UrlTwo)Flags: avoid undefined behavior

Loading an enum with a value that isn't in the enum is undefined,
according to Clang's usan.

So when doing logical operations on QFlags<E>, don't go through
the QFlags(E) constructor, but via QFlags(QFlag) (=int) instead.

Apply the same change to QUrlTwoFlags.

Change-Id: I5f27e22c4d831482fcbba88b97cb124fb005e3fd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QUrlTwoFlag: add two missing constexpr

The other member functions that can be constexpr already are, only these
were missing.

Change-Id: I717c74b210b45cfb8af9168d61e27e3ff2f6a9c9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
tst_QFlags: make constExpr() check compile on clang trunk

The problem is the verifyConstExpr<>() line involving the ~ operator.

The result as an integer is a value that can no longer be represented
in an int. This is known at compile time and thus template deduction,
which only has an int to match against, fails.

To fix, use an unsigned int as the first template argument of
verifyConstExpr<>().

Clang's error message for this is really sub-optimal, cf.
   http://llvm.org/bugs/show_bug.cgi?id=17834

Change-Id: I3a77dc54d2bee12b016d75724ac1bd7801f4cf2d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>