<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 --- - typedef causes instantiation of a class which fails due to an incomplete type"
   href="http://llvm.org/bugs/show_bug.cgi?id=16174">16174</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>typedef causes instantiation of a class which fails due to an incomplete type
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tommitissari@hotmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>template <typename T>
struct A
{
    struct B
    {
        struct C
        {
            T data; // #[0]
        };

        C data; // #[1]
    };

    typedef typename B::C X; // #[2]
};

struct I // #[4]
: A<I>   // #[3]
{
};

int main()
{
    return 0;
}

----

[0]: Error: Field has incomplete type 'I'
[1]: In instantiation of member class 'A<I>::B::C' requested here
[2]: In instantiation of member class 'A<I>::B' requested here
[3]: In instantiation of template class 'A<I>' requested here
[4]: Definition of 'I' is not complete until the closing "}"

If you comment out the line #[1], the code compiles.</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>