https://github.com/mizvekov requested changes to this pull request.

What problem is this trying to fix here?

At first glance, I think it's a problem that we ast-print instantiations as 
explicit specializations. If we fix that, does your problem go away?

Secondly, I agree that if we would print an implicit instantiation as a 
specialization, then we should use canonical arguments, and these should be 
printed with the expected suffix, but this patch is too narrow focused on 
64-bit unsigned.

I think the right approach here would be that if we have a converted template 
argument, then we might as well consider it to be canonical and print it always 
suffixed. If we didn't lose the as-writen argument, then we would have an 
expression and these would always print as-written.

I think the above change would be justified by design, but I am not sure that 
motivation aligns with ROOTs needs here.
It would make ast-print more consistent, but it shouldn't change semantics of 
the code if it round trips.

On a related note, if we do explicit specialization in source code, then we 
always print the argument suffixed, but we shouldn't in this case, and also the 
same incorrect thing happens for the declaration of the explicit instantiation.

https://github.com/llvm/llvm-project/pull/129235
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to