File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -2463,16 +2463,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
2463
2463
// A DeclRefExpr for a reference initialized by a constant expression can
2464
2464
// appear without being odr-used. Directly emit the constant initializer.
2465
2465
VD->getAnyInitializer (VD);
2466
- const auto *BD = dyn_cast_or_null<BlockDecl>(CurCodeDecl);
2467
- if (E->isNonOdrUse () == NOUR_Constant && VD->getType ()->isReferenceType () &&
2468
- // Do not emit if it is private OpenMP variable.
2469
- // FIXME: This should be handled in odr-use marking, not here.
2470
- !(E->refersToEnclosingVariableOrCapture () &&
2471
- ((CapturedStmtInfo &&
2472
- (LocalDeclMap.count (VD->getCanonicalDecl ()) ||
2473
- CapturedStmtInfo->lookup (VD->getCanonicalDecl ()))) ||
2474
- LambdaCaptureFields.lookup (VD->getCanonicalDecl ()) ||
2475
- (BD && BD->capturesVariable (VD))))) {
2466
+ if (E->isNonOdrUse () == NOUR_Constant && VD->getType ()->isReferenceType ()) {
2476
2467
llvm::Constant *Val =
2477
2468
ConstantEmitter (*this ).emitAbstract (E->getLocation (),
2478
2469
*VD->evaluateValue (),
You can’t perform that action at this time.
0 commit comments