-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[ADT] Fix missing 'template' keyword #98252
Conversation
@llvm/pr-subscribers-llvm-adt Author: Krystian Stasiowski (sdkrystian) ChangesFixes instances where the Full diff: https://github.com/llvm/llvm-project/pull/98252.diff 1 Files Affected:
diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h
index ac40ec4a6b240..18fff7808ace1 100644
--- a/llvm/include/llvm/ADT/ArrayRef.h
+++ b/llvm/include/llvm/ADT/ArrayRef.h
@@ -460,8 +460,8 @@ namespace llvm {
OwningArrayRef &operator=(OwningArrayRef &&Other) {
delete[] this->data();
- this->MutableArrayRef<T>::operator=(Other);
- Other.MutableArrayRef<T>::operator=(MutableArrayRef<T>());
+ this->template MutableArrayRef<T>::operator=(Other);
+ Other.template MutableArrayRef<T>::operator=(MutableArrayRef<T>());
return *this;
}
|
this->template MutableArrayRef<T>::operator=(Other); | ||
Other.template MutableArrayRef<T>::operator=(MutableArrayRef<T>()); |
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 fails with Ubuntu-20.04 g++.
llvm/include/llvm/ADT/ArrayRef.h:463:40: error: expected ‘;’ before ‘::’ token
463 | this->template MutableArrayRef<T>::operator=(Other);
| ^~
| ;
llvm/include/llvm/ADT/ArrayRef.h:464:40: error: expected ‘;’ before ‘::’ token
464 | Other.template MutableArrayRef<T>::operator=(MutableArrayRef<T>());
| ^~
| ;
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.
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
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 appears to be a GCC bug. Requesting guidance from @AaronBallman @erichkeane @zygoloid.
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.
Could we revert for now?
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.
@chapuni I dont think this is something that can be fixed in clang. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94799
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.
So, we should revert #92957 for now, unless excluding problematic host compilers would be agreed.
Fixes instances where the
template
keyword should be used to interpret<
as the delimiter of a template-argument-list after #92957.