Skip to content

Commit ad4df6d

Browse files
committed
Address Erich's feedback
1 parent 16eed40 commit ad4df6d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,10 +3025,10 @@ class OverloadExpr : public Expr {
30253025

30263026
public:
30273027
struct FindResult {
3028-
OverloadExpr *Expression;
3029-
bool IsAddressOfOperand;
3030-
bool IsAddressOfOperandWithParen;
3031-
bool HasFormOfMemberPointer;
3028+
OverloadExpr *Expression = nullptr;
3029+
bool IsAddressOfOperand = false;
3030+
bool IsAddressOfOperandWithParen = false;
3031+
bool HasFormOfMemberPointer = false;
30323032
};
30333033

30343034
/// Finds the overloaded expression in the given expression \p E of
@@ -3053,9 +3053,6 @@ class OverloadExpr : public Expr {
30533053
Result.IsAddressOfOperandWithParen = HasParen;
30543054
Result.Expression = Ovl;
30553055
} else {
3056-
Result.HasFormOfMemberPointer = false;
3057-
Result.IsAddressOfOperand = false;
3058-
Result.IsAddressOfOperandWithParen = false;
30593056
Result.Expression = cast<OverloadExpr>(E);
30603057
}
30613058

clang/lib/Sema/SemaExpr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5813,11 +5813,15 @@ static TypoCorrection TryTypoCorrectionForCall(Sema &S, Expr *Fn,
58135813
return TypoCorrection();
58145814
}
58155815

5816+
// [C++26][[expr.unary.op]/p4
5817+
// A pointer to member is only formed when an explicit &
5818+
// is used and its operand is a qualified-id not enclosed in parentheses.
58165819
static bool isParenthetizedAndQualifiedAddressOfExpr(Expr *Fn) {
58175820
if (!isa<ParenExpr>(Fn))
58185821
return false;
58195822

58205823
Fn = Fn->IgnoreParens();
5824+
58215825
auto *UO = dyn_cast<UnaryOperator>(Fn);
58225826
if (!UO || UO->getOpcode() != clang::UO_AddrOf)
58235827
return false;

0 commit comments

Comments
 (0)