<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Bad error message for extra parens around declaration inside if"
   href="https://llvm.org/bugs/show_bug.cgi?id=25834">25834</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bad error message for extra parens around declaration inside if
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

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

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>htam@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This code:

    extern int foo();

    int main(void) {
        if ((auto x = foo())) {
            return 1;
        }
        return 0;
    }

When compiled with `clang++ -std=c++11` produces the following error messages:
test.cc:5:15: error: expected ')'
    if ((auto x = foo())) {
              ^
test.cc:5:9: note: to match this '('
    if ((auto x = foo())) {
        ^
test.cc:5:25: error: expected expression
    if ((auto x = foo())) {
                        ^
2 errors generated.

This is not a great error message.  I'd expect something like "declaration with
extraneous parentheses" and a fixit to remove the extra parentheses.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>