guitargeek wrote:

Conceptually, yes! #223305 does cover this case: `InstantiationRequested` 
records the point of instantiation, and `FunctionDefinitionInstantiated`, then 
`revertDefinitionArrival` resets the body (and also clears the invalid flag, 
which would additionally fix the misleading "no matching function" diagnostic 
after an instantiation error). Two things from this PR that #223305 would need 
as well:

1. The stale `UndefinedButUsed` entry from the failed input, which otherwise 
produces a spurious `-Wundefined-inline` warning after the rollback.
2. The test, which should carry over unchanged.

My suggestion would be to land this small, targeted fix with its test now, so 
users get the fix in the meantime. Once #223305 is wired in, its rollback can 
replace `ForgetDroppedInstantiations()` and the test keeps guarding the 
behaviour. If you'd rather not have the interim fix, I'm happy to close this 
and contribute the test and the `UndefinedButUsed` handling to #223305 instead.

What do you prefer?

https://github.com/llvm/llvm-project/pull/228330
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to