Yuao Ma wrote:
BTW, The current trunk seems to have some problems with diagnostic location: https://godbolt.org/z/bcrvn9xo4
In the last days, there were some diagnostic changes; possibly those caused an intermittent issue? Otherwise, it looks ok. Namely: The '1' points to the space after '='in 'square = "42"', which seems to be a reasonable location for the error: "Error: Cannot convert CHARACTER(2) to INTEGER(4) at (1)". A nicer output would be '~~~~~~~1–––––' with '1' under '=' and '~~~' going from 'square...' to '...42"', but the current one seems to be sufficient. Tobias PS: I think there is room for improvement in gfortran in general regarding the column data - both were '1' points to - and adding more ranges. Admittedly, range support is relatively new in gfortran. Additionally, parsing support is old and we have not always ensured that the location points to the most sensible place instead of just somewhere in the expression. But we should at least try to improve both old output and when adding new features. Note: in dg-error/dg-warning, if you start the reg-expr string with, e.g., '12:' it means that the '1' is expected in column 12, i.e. the column shown for '<file>:<line>[.<col>]:'. That's often not needed but if you want to make sure that the column position is correct, you can use it in the testcase. We could also add fancier testcases, checking for the '~~~~1~~~~~' but that's more effort, which in general it not worthwhile.