title: Qt Moc generates code with undefined behaviour
body: <p>I have a simple class which has a QT signal that gives me trouble when compiling the moc generated code. I don't use the qmake buildsystem, but my scons build script calls qt' moc command directly.</p>
  
  <p>The relevant source file <strong>"write_qstring.h"</strong> is:</p>
  
  <pre><code>#ifndef LOG_WRITE_QSTRING_POLICY_H
  #define LOG_WRITE_QSTRING_POLICY_H
  
  #include &lt;QObject&gt;
  #include &lt;QString&gt;
  
  namespace Log
  {
  class WriteQString : public QObject
      {
      Q_OBJECT
      public:
      signals:
      void Changed(QString newString);
      };
  
  }
  
  #endif // LOG_WRITE_QSTRING_POLICY_H
  </code></pre>
  
  <p>I run the moc compiler with the command:</p>
  
  <blockquote>
    <p>/opt/Qt/5.2.0/gcc_64/bin/moc -DQT_CORE_LIB
    -I/opt/Qt/5.2.0/gcc_64/include/QtCore -I/opt/Qt/5.2.0/gcc_64/include -o moc_write_qstring.cc write_qstring.h</p>
  </blockquote>
  
  <p>and then I compile the generated moc_write_qstring.cc using clang++:</p>
  
  <blockquote>
    <p>clang++ -o moc_write_qstring.o -c -Weverything -pedantic -g -std=c++11
    -fcxx-exceptions -pthread -fdiagnostics-fixit-info -fPIC -Wno-c++98-compat -Wno-documentation-unknown-command -Wno-documentation -Wno-padded -Wno-weak-vtables -Wno-exit-time-destructors -Wno-global-constructors -isystem/opt/Qt/5.2.0/gcc_64/include -isystem/opt/Qt/5.2.0/gcc_64/include/QtCore -DQT_CORE_LIB -I/opt/Qt/5.2.0/gcc_64/include/QtCore moc_write_qstring.cc</p>
  </blockquote>
  
  <p>This gives a warning about undefined behaviour:</p>
  
  <blockquote>
    <p>warning: dereference of type '_t <em>' (aka 'void
    (Log::WriteQString::</em>*)(QString)') that was reinterpret_cast from type
    'void **' has undefined behavior [-Wundefined-reinterpret-cast]
    With the relevant line being:
    if (*reinterpret_cast&lt;_t *>(func) ==
    static_cast&lt;_t>(&amp;WriteQString::Changed)) {</p>
  </blockquote>
  
  <p>Since the compiler is warning about undefined behaviour I can only think the code is broken, but why is the metacompiler emitting broken code? <strong>What did I do wrong here? is it a c++11 problem??</strong></p>
  
  <p>Output of clang++ --version</p>
  
  <blockquote>
    <p>Ubuntu clang version 3.5-1~exp1 (trunk) (based on LLVM 3.5) Target:
    x86_64-pc-linux-gnu Thread model: posix</p>
  </blockquote>
  
  <p>Output of qmake --version</p>
  
  <blockquote>
    <p>QMake version 3.0 Using Qt version 5.2.0 in /opt/Qt/5.2.0/gcc_64/lib</p>
  </blockquote>