<html>
    <head>
      <base href="http://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 --- - Poor recovery for use of unknown identifier"
   href="http://llvm.org/bugs/show_bug.cgi?id=15819">15819</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Poor recovery for use of unknown identifier
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre><stdin>:1:29: error: unknown type name 'B'
struct A {}; void f() { A x(B); }
                            ^
<stdin>:1:28: warning: parentheses were disambiguated as a function declaration
[-Wvexing-parse]
struct A {}; void f() { A x(B); }
                           ^~~
<stdin>:1:29: note: add a pair of parentheses to declare a variable
struct A {}; void f() { A x(B); }
                            ^
                            ( )

Um. What. The first diagnostic is bad -- we should be expecting 'B' to be a
variable, not a type, here, because a function declaration at block scope is
very unlikely.

The second diagnostic is very bad. I'm not sure whether we kept the type or
dropped it, but either way, we shouldn't issue this diagnostic if we had a
parse error in the declaration. The note is also broken -- observe that it
suggests adding the close-paren after the existing close-paren, not before it
where it belongs.</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>