rsmith added a comment. In https://reviews.llvm.org/D26166#584285, @ahatanak wrote:
> It seems to me that the root of the problem is that the template > instantiation S2<int> is left in an incomplete state and VarDecl s2 in the > AST, which is of type S2<int>, is marked invalid. As I mentioned in my > previous comment, I tried to fix this by calling hasUncompilableErrorOccurred > instead of hasFatalErrorOccurred in > InstantiatingTemplate::InstantiatingTemplate, but that didn't seem correct as > a large number of regression tests failed. What is the right way to fix this? Ah, I see. Try changing that to `hasFatalErrorOccurred() && hasUncompilableErrorOccurred()`. (The former indicates we don't need more diagnostics, and the latter indicates we don't need a complete AST; if both flags are set, then we don't need to instantiate any more templates.) https://reviews.llvm.org/D26166 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits