Skip to content

[Clang][Sema] Fix template name lookup for operator= #90999

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

Merged
merged 2 commits into from
May 3, 2024

Conversation

sdkrystian
Copy link
Member

@sdkrystian sdkrystian commented May 3, 2024

This fixes a bug in #90152 where operator= was never looked up in the current instantiation, resulting in < never being interpreted as the start of a template argument list.

Since function templates are not copy/move assignment operators, the fix is accomplished by allowing lookup in the current instantiation for operator= when looking up a template name.

Still needs tests (which are currently in progress). Not sure whether a release note is needed as this fixes something introduced in this release.

@sdkrystian sdkrystian requested a review from erichkeane May 3, 2024 19:34
Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for release notes,as you said, this is a fix within this release.

@sdkrystian sdkrystian merged commit 3191e0b into llvm:main May 3, 2024
sdkrystian added a commit to sdkrystian/llvm-project that referenced this pull request May 9, 2024
sdkrystian added a commit that referenced this pull request May 9, 2024
… from #91498, #90999, and #90152 (#91620)

This reverts changes in #91498, #90999, and #90152 which make
`operator=` dependent whenever the current class is templated.
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Oct 22, 2024
cherry-picked:
8009bbe [email protected]              Tue Apr 30 14:25:09 2024 -0400 Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (llvm#84050)" (llvm#90152)
3191e0b [email protected]              Fri May  3 17:07:52 2024 -0400 [Clang][Sema] Fix template name lookup for operator= (llvm#90999)
62b5b61 [email protected]              Wed May  8 20:49:59 2024 -0400 [Clang][Sema] Fix lookup of dependent operator= outside of complete-class contexts (llvm#91498)
75ebcbf [email protected]              Thu May  9 16:34:40 2024 -0400 [Clang][Sema] Revert changes to operator= lookup in templated classes from llvm#91498, llvm#90999, and llvm#90152 (llvm#91620)
596a9c1 [email protected]              Mon May 13 12:24:46 2024 -0400 [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (llvm#91972)
fd87d76 [email protected]              Mon May 20 13:55:01 2024 -0400 [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (llvm#92318)
e75b58c [email protected]              Mon May 20 14:50:58 2024 -0400 [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (llvm#92449)
bae2c54 [email protected] Mon Jul  1 20:55:57 2024 +0300 [clang][NFC] Move documentation of `Sema` functions into `Sema.h`
e6d305e [email protected]                 Mon Sep  4 16:54:42 2023 +0200 Add support of Windows Trace Logging macros

Change-Id: I521b2ebabd7eb9a0df78c577992bfd8508ba44fd
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Mar 27, 2025
… lookup (llvm#91620)

This patch cherry-pick missing part of 75ebcbf.

Fixes: SWDEV-520199

The original commit message is:

[Clang][Sema] Revert changes to operator= lookup in templated classes from llvm#91498, llvm#90999, and llvm#90152 (llvm#91620)

This reverts changes in llvm#91498, llvm#90999, and llvm#90152 which make
`operator=` dependent whenever the current class is templated.

Change-Id: I352db5cc20ecf4a0ccdbb921c63da0867651ffc4
rocm-ci pushed a commit to ROCm/llvm-project that referenced this pull request Apr 11, 2025
… lookup (llvm#91620)

This patch cherry-pick missing part of 75ebcbf.

Fixes: SWDEV-520199

The original commit message is:

[Clang][Sema] Revert changes to operator= lookup in templated classes from llvm#91498, llvm#90999, and llvm#90152 (llvm#91620)

This reverts changes in llvm#91498, llvm#90999, and llvm#90152 which make
`operator=` dependent whenever the current class is templated.

Change-Id: I352db5cc20ecf4a0ccdbb921c63da0867651ffc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants