-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[Clang] Fix an assertion failure introduced by #93430 #100313
Conversation
The PR llvm#93430 introduced an assertion that did not make any sense. and caused a regression. The fix is to simply remove the assertion. No changelog. the intent is to backport this fix to clang 19.
@llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) ChangesThe PR #93430 introduced an assertion that did not make any sense. and caused a regression. The fix is to simply remove the assertion. No changelog. the intent is to backport this fix to clang 19. Full diff: https://github.com/llvm/llvm-project/pull/100313.diff 2 Files Affected:
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 8d24e34520e77..0a65213b0af33 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5711,7 +5711,6 @@ static bool isParenthetizedAndQualifiedAddressOfExpr(Expr *Fn) {
if (!UO || UO->getOpcode() != clang::UO_AddrOf)
return false;
if (auto *DRE = dyn_cast<DeclRefExpr>(UO->getSubExpr()->IgnoreParens())) {
- assert(isa<FunctionDecl>(DRE->getDecl()) && "expected a function");
return DRE->hasQualifier();
}
if (auto *OVL = dyn_cast<OverloadExpr>(UO->getSubExpr()->IgnoreParens()))
diff --git a/clang/test/SemaCXX/cxx2b-deducing-this.cpp b/clang/test/SemaCXX/cxx2b-deducing-this.cpp
index 5cbc1f735383b..4811b6052254c 100644
--- a/clang/test/SemaCXX/cxx2b-deducing-this.cpp
+++ b/clang/test/SemaCXX/cxx2b-deducing-this.cpp
@@ -895,6 +895,10 @@ void g() {
}
namespace P2797 {
+
+int bar(void) { return 55; }
+int (&fref)(void) = bar;
+
struct C {
void c(this const C&); // #first
void c() &; // #second
@@ -915,6 +919,8 @@ struct C {
(&C::c)(C{});
(&C::c)(*this); // expected-error {{call to non-static member function without an object argument}}
(&C::c)();
+
+ (&fref)();
}
};
}
|
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.
LGTM
/cherry-pick dd82a84 |
The PR llvm#93430 introduced an assertion that did not make any sense. and caused a regression. The fix is to simply remove the assertion. No changelog. the intent is to backport this fix to clang 19. (cherry picked from commit dd82a84)
/pull-request #100407 |
Summary: The PR #93430 introduced an assertion that did not make any sense. and caused a regression. The fix is to simply remove the assertion. No changelog. the intent is to backport this fix to clang 19. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250628
The PR llvm#93430 introduced an assertion that did not make any sense. and caused a regression. The fix is to simply remove the assertion. No changelog. the intent is to backport this fix to clang 19. (cherry picked from commit dd82a84)
The PR #93430 introduced an assertion that did not make any sense. and caused a regression. The fix is to simply remove the assertion.
No changelog. the intent is to backport this fix to clang 19.