Skip to content

[ADT] Fix missing 'template' keyword #98252

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/include/llvm/ADT/ArrayRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>());
Comment on lines +463 to +464
Copy link
Contributor

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>());
      |                                        ^~
      |                                        ;

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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.

return *this;
}

Expand Down
Loading