<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 --- - Properly resolve class-instance value within a template class"
   href="http://llvm.org/bugs/show_bug.cgi?id=20961">20961</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Properly resolve class-instance value within a template class
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>TableGen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>anemet@apple.com
          </td>
        </tr>

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

        <tr>
          <th>CC</th>
          <td>chisophugis@gmail.com, llvmbugs@cs.uiuc.edu, tstellar@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This testcase (originally from Tom):

class A <int op1> {
  int OP1 = op1;
}

class B <int op2> {
  A OP2 = A<op2>;
  int OP3 = OP2.OP1;
}

def b : B <1>;

def z {
  int k = b.OP3;
  int z = b.OP2.OP1;
}

generates:

------------- Classes -----------------
class A<int A:op1 = ?> {
  int OP1 = A:op1;
  string NAME = ?;
}
class B<int B:op2 = ?> {
  A OP2 = anonymous_0;
  int OP3 = OP2.OP1;
  string NAME = ?;
}
------------- Defs -----------------
def anonymous_0 {       // A
  int OP1 = B:op2;
  string NAME = ?;
}
def b { // B
  A OP2 = anonymous_0;
  int OP3 = B:op2;
  string NAME = ?;
}
def z {
  int k = B:op2;
  int z = b.OP2.OP1;
  string NAME = ?;
}

Analysis:
<a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140908/235018.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140908/235018.html</a>

As part of fixing this bug we should also consider removing the flag
ResolveFirst from Record. 

My initial idea is to have common base class for SubClassReference and
MultiClass which would contain a vector of Record representing class-instance
variables that are used within the class or the multiclass.  These would then
be instantiated first thing as part of instantiating the enclosing
class/multiclass.</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>