-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang] SemaOverload
Qualifiers::isAddressSpaceSupersetOf
called with wrong order of arguments
#64020
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
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
@llvm/issue-subscribers-clang-frontend |
Good spot! I agree that the second if statement with Fee free to create PR and I am happy to help reviewing. Maybe the OpenCL example from the bug you have linked here could be used as a test case. |
HoBoIs
pushed a commit
to HoBoIs/llvm-project
that referenced
this issue
Sep 15, 2023
If there are two guides, one of them generated from a non-templated constructor and the other from a templated constructor, then the standard gives priority to the first. Clang detected ambiguity before, now the correct guide is chosen. As an unrelated minor change, fix the issue llvm#64020, which could've led to incorrect behavior if further development inserted code after a call to isAddressSpaceSubsetOf() which specified the two parameters in the wrong order.
SemaOverload
Qualifiers::isAddressSpaceSupersetOf
called with wrong order of arguments
erichkeane
pushed a commit
that referenced
this issue
Oct 4, 2023
…66487) If there are two guides, one of them generated from a non-templated constructor and the other from a templated constructor, then the standard gives priority to the first. Clang detected ambiguity before, now the correct guide is chosen. The correct behavior is described in this paper: http://wg21.link/P0620R0 Example for the bug: http://godbolt.org/z/ee3e9qG78 As an unrelated minor change, fix the issue #64020, which could've led to incorrect behavior if further development inserted code after a call to `isAddressSpaceSubsetOf()`, which specified the two parameters in the wrong order. --------- Co-authored-by: hobois <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in clang/lib/Sema/SemaOverload.cpp clang::isBetterOverloadCandidate line 10243,10245 Qualifiers::isAddressSpaceSupersetOf is called with the same arguments (AS2, AS1), making the 2nd call unnecessary. I think the order of the parameters are meant to be swapped in one of them (I think in the 2nd one). This can lead to a future bug if Qualifiers::isAddressSpaceSupersetOf (AS1,AS2) is true and an other check is added later after line 10248.
The text was updated successfully, but these errors were encountered: