-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[F03] bogus error: Could not resolve generic type bound procedure #533 #849
base: master
Are you sure you want to change the base?
Conversation
…ng-compiler#533 Earlier a tbp arg was added for few type bound procedure calls (with/without nopass clause). This was inconsistent. While procedure matching, procedures with nopass clauses were not considered. This has been fixed. Now a tbp arg will be added to all type bound procedure calls and this tbp arg will be considered/discarded depending on the procedure (with/without nopass clause) being matched. Change-Id: I73a1b0c15852b8d2302048d44db4aa26f1f0a9ac
Change-Id: Icc4334dcb22ca0e46b6ece3c651652729505e024
Change-Id: I200132907086a9ca4a6af5fbe26279ce9473f94d
results(1) = 9 .eq. A%f(10) | ||
results(2) = 99 .eq. A%f1(100) | ||
results(3) = 999 .eq. A%f2(1000) | ||
results(4) = 9999 .eq. A%f3(10000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you call the real ones also through the generic name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had fogotten to add a check for functions without any parameter. I will add them too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you call the real ones also through the generic name?
Based on the type of the argument passed, the function call gets resolved. What do u mean by calling the real functions thru generic name.? We can always call the actual functions with their names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was pointing out that you are calling only the integer ones. Call the real ones also in the test for completeness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops sorry, my bad. Sure I will add the check for real type as well.
tools/flang1/flang1exe/semant2.c
Outdated
// One tbp argument will be added to a type bound procedure call | ||
// with NOPASS clause. | ||
argno = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the same change not required in the else portion below?
Can you add a test for operator also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is for generic type bound procedures only, so we do not need this for else part.
I tried to come up with a test case for operator to see if this fix has any side effects but I couldn't.
I also checked if any test case from flang testing infrastructure matches this scenario. none of the tests has the case which enters this piece of code with operator.
This piece of code is being used only by type bound procedures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to restrict this change only to generic type bound procedures. I will do this change and push it for review again.
Change-Id: I2268f5ae7100429b666f561de455eeef2ca32017
Change-Id: Idd1d60a7b3b2761dd36df2a8f60020257e2aedb5
Earlier a tbp arg was added for few type bound procedure calls (with/without nopass clause).
This was inconsistent. While procedure matching, procedures with nopass clauses were
not considered.
This has been fixed.
Now a tbp arg will be added to all type bound procedure calls and this tbp arg will be
considered/discarded depending on the procedure (with/without nopass clause) being matched.