@@ -5280,7 +5280,8 @@ static bool EvaluateVarDecl(EvalInfo &Info, const VarDecl *VD) {
5280
5280
if (InitE->isValueDependent())
5281
5281
return false;
5282
5282
5283
- if (VD->getType()->isReferenceType()) {
5283
+ if (VD->getType()->isReferenceType() &&
5284
+ !VD->getType()->isFunctionReferenceType()) {
5284
5285
return EvaluateInitForDeclOfReferenceType(Info, VD, InitE, Result, Val);
5285
5286
} else if (!EvaluateInPlace(Val, Info, Result, InitE)) {
5286
5287
// Wipe out any partially-computed value, to allow tracking that this
@@ -6924,7 +6925,8 @@ static bool HandleConstructorCall(const Expr *E, const LValue &This,
6924
6925
isa<CXXDefaultInitExpr>(Init));
6925
6926
FullExpressionRAII InitScope(Info);
6926
6927
6927
- if (FD && FD->getType()->isReferenceType()) {
6928
+ if (FD && FD->getType()->isReferenceType() &&
6929
+ !FD->getType()->isFunctionReferenceType()) {
6928
6930
LValue Result;
6929
6931
if (!EvaluateInitForDeclOfReferenceType(Info, FD, Init, Result,
6930
6932
*Value)) {
@@ -10962,7 +10964,8 @@ bool RecordExprEvaluator::VisitCXXParenListOrInitListExpr(
10962
10964
10963
10965
APValue &FieldVal = Result.getStructField(Field->getFieldIndex());
10964
10966
10965
- if (Field->getType()->isReferenceType()) {
10967
+ if (Field->getType()->isReferenceType() &&
10968
+ !Field->getType()->isFunctionReferenceType()) {
10966
10969
LValue Result;
10967
10970
if (!EvaluateInitForDeclOfReferenceType(Info, Field, Init, Result,
10968
10971
FieldVal)) {
0 commit comments