<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - With gcc flag -Werror programs are not compiling using the lib"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=122639">122639</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>With gcc flag -Werror programs are not compiling using the lib
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>cppunit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>1.14
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>General
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>groll@cs.uni-kl.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>markus.mohrhard@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If I use -Werror for compiling my program which uses cppunit it is not
compiling.
The error is:
error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
...
 note: ...this statement, but the latter is misleadingly indented as if it were
guarded by the ‘if’

This is because of line 520 and following in TestAssert.h:
 if ( cpputCorrectExceptionThrown_ )                                     \
             break;                                                      \
 CPPUNIT_NS::Asserter::fail( cpputMsg_,                                  \
                                  CPPUNIT_SOURCELINE() );                \

Here everything will be in one line for the compiler because of the macro
implementation and only the break is inside of the if body and not the
following stuff but it seems like the following has also to be in the if body.
This can be fixed with easy adding some brackets:

 if ( cpputCorrectExceptionThrown_ )                                     \
           {  break; }                                                   \
 CPPUNIT_NS::Asserter::fail( cpputMsg_,                                  \
                                  CPPUNIT_SOURCELINE() );                \</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>