diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2024-01-30 13:38:18 -0500 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2024-01-30 13:38:18 -0500 |
commit | 201eb2b5775cf193c97c60a5eb790003a1e6bedb (patch) | |
tree | f11f41d4e2747e9737dd1c7122a771f75df3e921 /clang/lib/AST/ExprConstant.cpp | |
parent | 3477bcf4b94395e2c0ed77a139e54240cfe4f27d (diff) | |
download | llvm-201eb2b5775cf193c97c60a5eb790003a1e6bedb.zip llvm-201eb2b5775cf193c97c60a5eb790003a1e6bedb.tar.gz llvm-201eb2b5775cf193c97c60a5eb790003a1e6bedb.tar.bz2 |
Revert "[clang] static operators should evaluate object argument (#68485)"
This reverts commit 30155fc0ef4fbdce2d79434aaae8d58b2fabb20a.
It seems to have broken some tests in clangd:
http://45.33.8.238/linux/129484/step_9.txt
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 6345389..a41bdac 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -7951,8 +7951,7 @@ public: // Overloaded operator calls to member functions are represented as normal // calls with '*this' as the first argument. const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD); - if (MD && - (MD->isImplicitObjectMemberFunction() || (OCE && MD->isStatic()))) { + if (MD && MD->isImplicitObjectMemberFunction()) { // FIXME: When selecting an implicit conversion for an overloaded // operator delete, we sometimes try to evaluate calls to conversion // operators without a 'this' parameter! @@ -7961,11 +7960,7 @@ public: if (!EvaluateObjectArgument(Info, Args[0], ThisVal)) return false; - - // If we are calling a static operator, the 'this' argument needs to be - // ignored after being evaluated. - if (MD->isInstance()) - This = &ThisVal; + This = &ThisVal; // If this is syntactically a simple assignment using a trivial // assignment operator, start the lifetimes of union members as needed, |