Avoid false-positive dependent name lookup error by not depending on auto keyword#12483
Merged
Avoid false-positive dependent name lookup error by not depending on auto keyword#12483
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Lafi7e
previously approved these changes
Aug 5, 2022
skottmckay
reviewed
Aug 5, 2022
| num_roi_cols, | ||
| reinterpret_cast<typename ToCudaType<T>::MappedType*>(Y.MutableData<T>()), | ||
| reinterpret_cast<typename ToCudaType<T>::MappedType*>(Y.template MutableData<T>()), | ||
| this->mode_ == RoiAlignMode::avg, |
Contributor
There was a problem hiding this comment.
Is there a build issue where this is required?
If not, please do not add unnecessary 'template ' qualifiers as they add unnecessary noise to the code. They should only be needed if the 'Tensor' type is one of the templatized types (in this case if T == Tensor and Y was of type T you would need it).
You're fetching a Tensor from the context right? If the rocm build is complaining do we need to specify Tensor& for Y instead of auto?
However, line 50 calls X_ptr->Data and you haven't updated that so it's not clear why Y.MutableData is an issue but X_ptr->Data is not.
This reverts commit 8612c33.
ROCm's hip clang complaints that "use 'template' keyword to treat 'Foo' as a dependent template name" where Foo is not a dependent template name. Instead, avoid the using of auto keyword fixes the error here.
Contributor
Author
|
@wejoncy Not your fault. clang to be blamed. |
skottmckay
approved these changes
Aug 5, 2022
wejoncy
approved these changes
Aug 5, 2022
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Fix dependent name lookup in class template to access templated method.
Motivation and Context
C++ grammar enforcement.