I think I found out what is going on in pr12104. It is a mismatch from Sema and CodeGen's views of what is needed. In the testcase:
template <int dimm> struct Patch {
static const unsigned int no_neighbor = -1;
};
template <int dim>
const unsigned int Patch<dim>::no_neighbor;
void f(int);
void g() {
f(Patch<1>::no_neighbor);
}
template struct Patch<1>;
Sema logic is that we already have a definition because of the out of
line decl. CodeGen's logic is that this is a decl that can be
deferred, but it never sees anything that forces it to emit it. This
patch adds a method to be called when we see an explicit template
instantiation definition.
Cheers,
Rafael
t.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
