Skip to content

Commit dd82a84

Browse files
authored
[Clang] Fix an assertion failure introduced by #93430 (#100313)
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.
1 parent 8a77961 commit dd82a84

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5730,7 +5730,6 @@ static bool isParenthetizedAndQualifiedAddressOfExpr(Expr *Fn) {
57305730
if (!UO || UO->getOpcode() != clang::UO_AddrOf)
57315731
return false;
57325732
if (auto *DRE = dyn_cast<DeclRefExpr>(UO->getSubExpr()->IgnoreParens())) {
5733-
assert(isa<FunctionDecl>(DRE->getDecl()) && "expected a function");
57345733
return DRE->hasQualifier();
57355734
}
57365735
if (auto *OVL = dyn_cast<OverloadExpr>(UO->getSubExpr()->IgnoreParens()))

clang/test/SemaCXX/cxx2b-deducing-this.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,10 @@ void g() {
895895
}
896896

897897
namespace P2797 {
898+
899+
int bar(void) { return 55; }
900+
int (&fref)(void) = bar;
901+
898902
struct C {
899903
void c(this const C&); // #first
900904
void c() &; // #second
@@ -915,6 +919,8 @@ struct C {
915919
(&C::c)(C{});
916920
(&C::c)(*this); // expected-error {{call to non-static member function without an object argument}}
917921
(&C::c)();
922+
923+
(&fref)();
918924
}
919925
};
920926
}

0 commit comments

Comments
 (0)